WordPress.org

Plugin Directory

Changeset 576389


Ignore:
Timestamp:
07/23/12 23:33:38 (21 months ago)
Author:
batmoo
Message:

Mark static functions as static, props i8ramin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lazy-load/trunk/lazy-load.php

    r576386 r576389  
    1717    const version = '0.4'; 
    1818 
    19     function init() { 
     19    static function init() { 
    2020        add_action( 'wp_enqueue_scripts', array( __CLASS__, 'add_scripts' ) ); 
    2121        add_filter( 'the_content', array( __CLASS__, 'add_image_placeholders' ), 99 ); // run this later, so other content filters have run, including image_add_wh on WP.com 
     
    2323    } 
    2424 
    25     function add_scripts() { 
     25    static function add_scripts() { 
    2626        wp_enqueue_script( 'wpcom-lazy-load-images',  self::get_url( 'js/lazy-load.js' ), array( 'jquery', 'jquery-sonar' ), self::version, true ); 
    2727        wp_enqueue_script( 'jquery-sonar', self::get_url( 'js/jquery.sonar.min.js' ), array( 'jquery' ), self::version, true ); 
    2828    } 
    2929 
    30     function add_image_placeholders( $content ) { 
     30    static function add_image_placeholders( $content ) { 
    3131        // Don't lazyload for feeds, previews, mobile 
    3232        if( is_feed() || is_preview() || ( function_exists( 'is_mobile' ) && is_mobile() ) ) 
     
    4646    } 
    4747 
    48     function get_url( $path = '' ) { 
     48    static function get_url( $path = '' ) { 
    4949        return plugins_url( ltrim( $path, '/' ), __FILE__ ); 
    5050    } 
Note: See TracChangeset for help on using the changeset viewer.