WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/25/2016 07:08:38 PM (3 years ago)
Author:
wonderboymusic
Message:

Site Icon: There is no good reason for class-wp-site-icon.php to drop a global instance of itself whenever the file is loaded. The lone use of the global instance of WP_Site_Icon is in an AJAX action that provides virtually no way to override - the file is loaded immediately before the global is used.

Let us remove the $wp_site_icon global. I will fall on the sword if this comes back to bite us (waiting with bated breath).

See #37699.

File:
1 edited

Legend:

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

    r38199 r38355  
    31633163 *
    31643164 * @since 4.3.0
    3165  *
    3166  * @global WP_Site_Icon $wp_site_icon
    31673165 */
    31683166function wp_ajax_crop_image() {
     
    31853183        case 'site-icon':
    31863184            require_once ABSPATH . '/wp-admin/includes/class-wp-site-icon.php';
    3187             global $wp_site_icon;
     3185            $wp_site_icon = new WP_Site_Icon();
    31883186
    31893187            // Skip creating a new attachment if the attachment is a Site Icon.
Note: See TracChangeset for help on using the changeset viewer.