WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/27/2016 06:06:50 AM (3 years ago)
Author:
wonderboymusic
Message:

Press This: the file for the WP_Press_This class should not produce side effects. Similar to what we did in r38355 for WP_Site_Icon, drop the instances of global instantiation for $wp_press_this via loading the file. The variable can be set inline when necessary. In most of those places, if the global is already set, the file does not load and stomp it currently.

See #37699.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ajax-actions.php

    r38355 r38397  
    31393139    if ( empty( $GLOBALS['wp_press_this'] ) ) {
    31403140        include( ABSPATH . 'wp-admin/includes/class-wp-press-this.php' );
     3141        $GLOBALS['wp_press_this'] = new WP_Press_This();
    31413142    }
    31423143
     
    31543155    if ( empty( $GLOBALS['wp_press_this'] ) ) {
    31553156        include( ABSPATH . 'wp-admin/includes/class-wp-press-this.php' );
     3157        $GLOBALS['wp_press_this'] = new WP_Press_This();
    31563158    }
    31573159
Note: See TracChangeset for help on using the changeset viewer.