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/tests/phpunit/tests/general/template.php

    r37866 r38355  
    11<?php
    2 
    32/**
    43 * A set of unit tests for functions in wp-includes/general-template.php
    54 *
    65 * @group template
     6 * @group site_icon
    77 */
     8
     9require_once( ABSPATH . 'wp-admin/includes/class-wp-site-icon.php' );
     10
    811class Tests_General_Template extends WP_UnitTestCase {
    9 
    10     public $wp_site_icon;
     12    protected $wp_site_icon;
    1113    public $site_icon_id;
    1214    public $site_icon_url;
     
    1820        parent::setUp();
    1921
    20         require_once ABSPATH . 'wp-admin/includes/class-wp-site-icon.php';
    21         $this->wp_site_icon = $GLOBALS['wp_site_icon'];
     22        $this->wp_site_icon = new WP_Site_Icon();
    2223    }
    2324
Note: See TracChangeset for help on using the changeset viewer.