Changeset 394409
- Timestamp:
- 06/08/2011 01:52:45 AM (15 years ago)
- File:
-
- 1 edited
-
shadowbox-js/tags/3.0.3.6/inc/frontend.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
shadowbox-js/tags/3.0.3.6/inc/frontend.php
r391939 r394409 40 40 // Automatically add Shadowbox to links 41 41 if ( $this->is_automatic ( 'any' ) ) { 42 add_filter ( 'the_posts' , array ( &$this , 'process_posts_early' ) , 10 , 2 ); 42 if ( $this->get_option ( 'smartLoad' ) == 'false' ) 43 add_filter ( 'the_content', array ( &$this, 'add_attr_to_link' ) , 12 , 2 ); 44 else 45 add_filter ( 'the_posts' , array ( &$this , 'process_posts_early' ) , 10 , 2 ); 43 46 add_filter ( 'wp_get_attachment_link' , array ( &$this , 'add_attr_to_link' ) , 12 , 2 ); 44 47 } … … 187 190 $plugin_url = $this->plugin_url(); 188 191 $library = $this->get_option ( 'library' ); 189 $start = "\n<!-- Begin Shadowbox JS -->\n";192 $start = "\n<!-- Begin Shadowbox JS v{$this->version} -->\n"; 190 193 $start .= "<!-- Selected Players: " . implode ( ', ', (array) $this->get_option ( 'players' ) ) . " -->\n"; 191 194 $end = "<!-- End Shadowbox JS -->\n\n"; … … 211 214 // The full Shadowbox configuration 212 215 $init = "<script type=\"text/javascript\">\n"; 213 $init .= "/ /<![CDATA[\n";216 $init .= "/* <![CDATA[ */\n"; 214 217 $init .= " var shadowbox_conf = {\n"; 215 218 $init .= rtrim ( $init_opts , " ,\n" ) . "\n"; 216 219 $init .= " };\n"; 217 220 $init .= " Shadowbox.init(shadowbox_conf);\n"; 218 $init .= "/ /]]>\n";221 $init .= "/* ]]> */\n"; 219 222 $init .= "</script>\n"; 220 223 … … 254 257 255 258 // Set the album ID, if the image is coming from a gallery use the gallery ID, otherwise use the ID of the post 256 if ( is_object ( $post_or_id ) ) {259 if ( is_object ( $post_or_id ) ) { 257 260 $albumid = "sbpost-{$post_or_id->ID}"; 258 } elseif ( is_int ( $post_or_id ) && $post_or_id != 0 ) {261 } elseif ( is_int ( $post_or_id ) && $post_or_id != 0 ) { 259 262 $p = get_post ( $post_or_id ); 260 263 $albumid = "sbalbum-{$p->post_parent}"; 261 264 } else { 262 $albumid = "sbgroup-" . time(); 265 global $post; 266 if ( isset ( $post) && is_object ( $post ) && is_int ( $post->ID ) ) 267 $albumid = "sbpost-{$post->ID}"; 268 else 269 $albumid = "sbgroup-" . time(); 263 270 } 264 271
Note: See TracChangeset
for help on using the changeset viewer.