In `Custom_Image_Header`:

* In [28481], `$admin_header_callback` and `$admin_image_div_callback` were set to `private` based on their erroneous `@param` values
* `$admin_header_callback` and `$admin_image_div_callback` are used as hook callbacks - as such, they must be `public`
* In [28521] and [28524], magic methods were added for back-compat
* Currently, there are 4 properties marked `private`: `$uploaded_headers`, `$default_headers`, `$page`, and `$updated` - `$page` and `$uploaded_headers` are never used and `$updated` was added by me in [30187] during 4.1. `$default_headers` does not necessarily need to be `private`

Set `$admin_header_callback` and `$admin_image_div_callback` to `public`.
Remove the `$page` property - it duplicated the `$page` local var and is referenced/used nowhere.
Remove the `$uploaded_headers` property - it is used nowhere and is dead code.
Set `$default_headers` to `public`.
Remove the magic methods - they were beyond overkill and rendered moot by the above changes.

See #30891.

Built from https://develop.svn.wordpress.org/trunk@31134


git-svn-id: http://core.svn.wordpress.org/trunk@31115 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-01-10 22:11:22 +00:00
parent 61f5cc459e
commit a56d920454
2 changed files with 4 additions and 78 deletions

View File

@ -20,18 +20,16 @@ class Custom_Image_Header {
*
* @var callback
* @since 2.1.0
* @access private
*/
private $admin_header_callback;
public $admin_header_callback;
/**
* Callback for header div.
*
* @var callback
* @since 3.0.0
* @access private
*/
private $admin_image_div_callback;
public $admin_image_div_callback;
/**
* Holds default headers.
@ -40,25 +38,7 @@ class Custom_Image_Header {
* @since 3.0.0
* @access private
*/
private $default_headers = array();
/**
* Holds custom headers uploaded by the user.
*
* @var array
* @since 3.2.0
* @access private
*/
private $uploaded_headers = array();
/**
* Holds the page menu hook.
*
* @var string
* @since 3.0.0
* @access private
*/
private $page = '';
public $default_headers = array();
/**
* @var bool
@ -84,58 +64,6 @@ class Custom_Image_Header {
add_action( 'wp_ajax_custom-header-remove', array( $this, 'ajax_header_remove' ) );
}
/**
* Make private properties readable for backwards compatibility.
*
* @since 4.0.0
* @access public
*
* @param string $name Property to get.
* @return mixed Property.
*/
public function __get( $name ) {
return $this->$name;
}
/**
* Make private properties settable for backwards compatibility.
*
* @since 4.0.0
* @access public
*
* @param string $name Property to set.
* @param mixed $value Property value.
* @return mixed Newly-set property.
*/
public function __set( $name, $value ) {
return $this->$name = $value;
}
/**
* Make private properties checkable for backwards compatibility.
*
* @since 4.0.0
* @access public
*
* @param string $name Property to check if set.
* @return bool Whether the property is set.
*/
public function __isset( $name ) {
return isset( $this->$name );
}
/**
* Make private properties un-settable for backwards compatibility.
*
* @since 4.0.0
* @access public
*
* @param string $name Property to unset.
*/
public function __unset( $name ) {
unset( $this->$name );
}
/**
* Set up the hooks for the Custom Header admin page.
*
@ -147,8 +75,6 @@ class Custom_Image_Header {
return;
}
$this->page = $page;
add_action( "admin_print_scripts-$page", array( $this, 'js_includes' ) );
add_action( "admin_print_styles-$page", array( $this, 'css_includes' ) );
add_action( "admin_head-$page", array( $this, 'help' ) );

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.2-alpha-31133';
$wp_version = '4.2-alpha-31134';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.