WordPress.org

Plugin Directory

Changeset 472089


Ignore:
Timestamp:
12/07/11 16:48:04 (2 years ago)
Author:
sivel
Message:

Updates for WP 3.3, for where to enqueue and register scripts at.

Location:
shadowbox-js/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • shadowbox-js/trunk/inc/frontend.php

    r394417 r472089  
    3333        // This allows for selecting to delete options from the admin page 
    3434        if ( ! empty ( $this->options ) ) { 
    35             add_action ( 'plugins_loaded' , array ( &$this , 'styles' ) , 7 ); 
    36             add_action ( 'plugins_loaded' , array ( &$this , 'scripts' ) , 8 ); 
     35            add_action ( 'init' , array ( &$this , 'styles' ) , 7 ); 
     36            add_action ( 'init' , array ( &$this , 'scripts' ) , 8 ); 
    3737            if ( $this->get_option ( 'smartLoad' ) == 'false' ) 
    38                 add_action ( 'wp_footer' , array ( &$this , 'configure' ) , 11 ); 
     38                add_action ( 'wp_footer' , array ( &$this , 'configure' ) , 21 ); 
    3939 
    4040            // Automatically add Shadowbox to links 
     
    7272                $posts[$i]->post_content = $this->add_attr_to_link ( $posts[$i]->post_content , $posts[$i] ); 
    7373                if ( preg_match ( '%(?<!\[)\[gallery[ \]]%i', $posts[$i]->post_content ) && $this->get_option ( 'smartLoad' ) == 'true' ) 
    74                     $this->possibly_enqueue ( 'shadowbox' ); 
     74                    add_action( 'wp_enqueue_scripts', array( &$this, 'possibly_enqueue' ) ); 
    7575                if ( ! empty ( $posts[$i]->post_excerpt ) ) { 
    7676                    $posts[$i]->post_excerpt = $this->add_attr_to_link ( $posts[$i]->post_excerpt , $posts[$i] ); 
    7777                    if ( preg_match ( '%(?<!\[)\[gallery[ \]]%i', $posts[$i]->post_excerpt ) && $this->get_option ( 'smartLoad' ) == 'true' ) 
    78                         $this->possibly_enqueue ( 'shadowbox' ); 
     78                        add_action( 'wp_enqueue_scripts', array( &$this, 'possibly_enqueue' ) ); 
    7979                } 
    8080            } 
     
    150150            $shadowbox = $shadowbox_url; 
    151151        } else { 
    152             $shadowbox = add_query_arg ( array ( 'action' => 'shadowboxjs' , 'cache' => $md5) , admin_url ( 'admin-ajax.php' , $scheme ) ); 
     152            $shadowbox = add_query_arg ( array ( 'action' => 'shadowboxjs' , 'cache' => $md5 ) , admin_url ( 'admin-ajax.php' , $scheme ) ); 
    153153        } 
    154154 
     
    170170     * @since 3.0.0.0 
    171171     */ 
    172     function possibly_enqueue ( $script ) { 
     172    function possibly_enqueue ( $deprecated = '' ) { 
    173173        if ( did_action ( 'wp_head' ) ) 
    174174            return; 
     
    178178 
    179179        wp_enqueue_script ( $this->get_option ( 'library' ) ); 
    180         wp_enqueue_script ( $script ); 
    181         add_action ( 'wp_footer' , array ( &$this , 'configure' ) , 11 ); 
     180        wp_enqueue_script ( 'shadowbox' ); 
     181        add_action ( 'wp_footer' , array ( &$this , 'configure' ) , 21 ); 
    182182    } 
    183183 
     
    189189     */ 
    190190    function configure () { 
    191         $plugin_url = $this->plugin_url(); 
     191        $plugin_url = $this->plugin_url (); 
    192192        $library = $this->get_option ( 'library' ); 
    193193        $start =  "\n<!-- Begin Shadowbox JS v{$this->version} -->\n"; 
     
    345345        // Check to see if we need to try to load shadowbox and dependencies into the footer 
    346346        if ( preg_match ( $slbox_rel_pattern , $content ) && $this->get_option ( 'smartLoad' ) == 'true' ) { 
    347             $this->possibly_enqueue ( 'shadowbox' ); 
     347            $this->possibly_enqueue (); 
    348348        } 
    349349 
  • shadowbox-js/trunk/shadowbox-js.php

    r394417 r472089  
    88 * 
    99 * @author Matt Martz <matt@sivel.net> 
    10  * @version 3.0.3.8 
     10 * @version 3.0.3.9 
    1111 * @package shadowbox-js 
    1212 */ 
     
    1616Plugin URI:   http://sivel.net/wordpress/shadowbox-js/ 
    1717Description:  A javascript media viewer similar to Lightbox and Thickbox. Supports all types of media, not just images. 
    18 Version:      3.0.3.8 
     18Version:      3.0.3.9 
    1919Author:       Matt Martz 
    2020Author URI:   http://sivel.net/ 
     
    5656     * @var int 
    5757     */ 
    58     var $version = '3.0.3.8'; 
     58    var $version = '3.0.3.9'; 
    5959 
    6060    /** 
  • shadowbox-js/trunk/shadowbox-title-push.php

    r394417 r472089  
    1414Plugin URI:   http://sivel.net/wordpress/shadowbox-js/ 
    1515Description:  Push the title attribute from the img tag to the anchor tag 
    16 Version:      3.0.3.8 
     16Version:      3.0.3.9 
    1717Author:       Matt Martz 
    1818Author URI:   http://sivel.net/ 
Note: See TracChangeset for help on using the changeset viewer.