diff --git a/wp-admin/custom-background.php b/wp-admin/custom-background.php index e53cd7d244..46a61ccbb1 100644 --- a/wp-admin/custom-background.php +++ b/wp-admin/custom-background.php @@ -22,7 +22,7 @@ class Custom_Background { * @since 3.0.0 * @access private */ - var $admin_header_callback; + private $admin_header_callback; /** * Callback for header div. @@ -31,7 +31,7 @@ class Custom_Background { * @since 3.0.0 * @access private */ - var $admin_image_div_callback; + private $admin_image_div_callback; /** * Holds the page menu hook. @@ -40,7 +40,7 @@ class Custom_Background { * @since 3.0.0 * @access private */ - var $page = ''; + private $page = ''; /** * Constructor - Register administration header callback. @@ -50,7 +50,7 @@ class Custom_Background { * @param callback $admin_image_div_callback Optional custom image div output callback. * @return Custom_Background */ - function __construct($admin_header_callback = '', $admin_image_div_callback = '') { + public function __construct($admin_header_callback = '', $admin_image_div_callback = '') { $this->admin_header_callback = $admin_header_callback; $this->admin_image_div_callback = $admin_image_div_callback; @@ -58,12 +58,23 @@ class Custom_Background { add_action( 'wp_ajax_set-background-image', array( $this, 'wp_set_background_image' ) ); } + /** + * Make private properties readable for backwards compatibility + * + * @since 4.0.0 + * @param string $name + * @return mixed + */ + public function __get( $name ) { + return $this->$name; + } + /** * Set up the hooks for the Custom Background admin page. * * @since 3.0.0 */ - function init() { + public function init() { if ( ! current_user_can('edit_theme_options') ) return; @@ -82,7 +93,7 @@ class Custom_Background { * * @since 3.0.0 */ - function admin_load() { + public function admin_load() { get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __('Overview'), @@ -109,7 +120,7 @@ class Custom_Background { * * @since 3.0.0 */ - function take_action() { + public function take_action() { if ( empty($_POST) ) return; @@ -176,7 +187,7 @@ class Custom_Background { * * @since 3.0.0 */ - function admin_page() { + public function admin_page() { ?>

@@ -343,7 +354,7 @@ if ( current_theme_supports( 'custom-background', 'default-color' ) ) * * @since 3.0.0 */ - function handle_upload() { + public function handle_upload() { if ( empty($_FILES) ) return; @@ -397,7 +408,7 @@ if ( current_theme_supports( 'custom-background', 'default-color' ) ) * * @since 3.4.0 */ - function attachment_fields_to_edit( $form_fields ) { + public function attachment_fields_to_edit( $form_fields ) { return $form_fields; } @@ -406,7 +417,7 @@ if ( current_theme_supports( 'custom-background', 'default-color' ) ) * * @since 3.4.0 */ - function filter_upload_tabs( $tabs ) { + public function filter_upload_tabs( $tabs ) { return $tabs; } diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php index 3344223eac..8eb5312389 100644 --- a/wp-admin/custom-header.php +++ b/wp-admin/custom-header.php @@ -22,7 +22,7 @@ class Custom_Image_Header { * @since 2.1.0 * @access private */ - var $admin_header_callback; + private $admin_header_callback; /** * Callback for header div. @@ -31,7 +31,7 @@ class Custom_Image_Header { * @since 3.0.0 * @access private */ - var $admin_image_div_callback; + private $admin_image_div_callback; /** * Holds default headers. @@ -40,7 +40,7 @@ class Custom_Image_Header { * @since 3.0.0 * @access private */ - var $default_headers = array(); + private $default_headers = array(); /** * Holds custom headers uploaded by the user. @@ -49,7 +49,7 @@ class Custom_Image_Header { * @since 3.2.0 * @access private */ - var $uploaded_headers = array(); + private $uploaded_headers = array(); /** * Holds the page menu hook. @@ -58,7 +58,7 @@ class Custom_Image_Header { * @since 3.0.0 * @access private */ - var $page = ''; + private $page = ''; /** * Constructor - Register administration header callback. @@ -68,7 +68,7 @@ class Custom_Image_Header { * @param callback $admin_image_div_callback Optional custom image div output callback. * @return Custom_Image_Header */ - function __construct($admin_header_callback, $admin_image_div_callback = '') { + public function __construct($admin_header_callback, $admin_image_div_callback = '') { $this->admin_header_callback = $admin_header_callback; $this->admin_image_div_callback = $admin_image_div_callback; @@ -80,12 +80,23 @@ 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 + * @param string $name + * @return mixed + */ + public function __get( $name ) { + return $this->$name; + } + /** * Set up the hooks for the Custom Header admin page. * * @since 2.1.0 */ - function init() { + public function init() { if ( ! current_user_can('edit_theme_options') ) return; @@ -106,7 +117,7 @@ class Custom_Image_Header { * * @since 3.0.0 */ - function help() { + public function help() { get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __('Overview'), @@ -148,7 +159,7 @@ class Custom_Image_Header { * * @return int Current step */ - function step() { + public function step() { if ( ! isset( $_GET['step'] ) ) return 1; @@ -167,7 +178,7 @@ class Custom_Image_Header { * * @since 2.1.0 */ - function js_includes() { + public function js_includes() { $step = $this->step(); if ( ( 1 == $step || 3 == $step ) ) { @@ -185,7 +196,7 @@ class Custom_Image_Header { * * @since 2.7.0 */ - function css_includes() { + public function css_includes() { $step = $this->step(); if ( ( 1 == $step || 3 == $step ) && current_theme_supports( 'custom-header', 'header-text' ) ) @@ -199,7 +210,7 @@ class Custom_Image_Header { * * @since 2.6.0 */ - function take_action() { + public function take_action() { if ( ! current_user_can('edit_theme_options') ) return; @@ -245,7 +256,7 @@ class Custom_Image_Header { * * @since 3.0.0 */ - function process_default_headers() { + public function process_default_headers() { global $_wp_default_headers; if ( !empty($this->headers) ) @@ -275,7 +286,7 @@ class Custom_Image_Header { * * @since 3.0.0 */ - function show_header_selector( $type = 'default' ) { + public function show_header_selector( $type = 'default' ) { if ( 'default' == $type ) { $headers = $this->default_headers; } else { @@ -312,7 +323,7 @@ class Custom_Image_Header { * * @since 2.1.0 */ - function js() { + public function js() { $step = $this->step(); if ( ( 1 == $step || 3 == $step ) && current_theme_supports( 'custom-header', 'header-text' ) ) $this->js_1(); @@ -325,7 +336,7 @@ class Custom_Image_Header { * * @since 2.6.0 */ - function js_1() { + public function js_1() { $default_color = ''; if ( current_theme_supports( 'custom-header', 'default-text-color' ) ) { $default_color = get_theme_support( 'custom-header', 'default-text-color' ); @@ -341,13 +352,13 @@ class Custom_Image_Header { var default_color = '', header_text_fields; - function pickColor(color) { + public function pickColor(color) { $('#name').css('color', color); $('#desc').css('color', color); $('#text-color').val(color); } - function toggle_text() { + public function toggle_text() { var checked = $('#display-header-text').prop('checked'), text_color; header_text_fields.toggle( checked ); @@ -389,10 +400,10 @@ class Custom_Image_Header { * * @since 2.6.0 */ - function js_2() { ?> + public function js_2() { ?>