From aa06a7de9f317b5a5e825feff6326ba7e97d9ff6 Mon Sep 17 00:00:00 2001 From: nacin Date: Wed, 12 Oct 2011 16:22:50 +0000 Subject: [PATCH] Don't instantiate WP_Screen in convert_to_screen() for now. see #18785. git-svn-id: http://svn.automattic.com/wordpress/trunk@18949 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/screen.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/wp-admin/includes/screen.php b/wp-admin/includes/screen.php index e9e3dc4598..491db7eddb 100644 --- a/wp-admin/includes/screen.php +++ b/wp-admin/includes/screen.php @@ -231,7 +231,7 @@ function convert_to_screen( $screen ) { $screen .= '-user'; $screen = (string) apply_filters( 'screen_meta_screen', $screen ); - $screen = new WP_Screen( $screen ); + $screen = (object) array( 'id' => $screen, 'base' => $screen ); return $screen; } @@ -248,10 +248,7 @@ function convert_to_screen( $screen ) { * @todo: deprecate? */ function add_contextual_help( $screen, $help ) { - if ( is_string( $screen ) ) - $screen = convert_to_screen( $screen ); - - $screen->add_old_compat_help( $help ); + WP_Screen::add_old_compat_help( $screen, $help ); } /** @@ -560,8 +557,8 @@ final class WP_Screen { self::$_options[ $this->id ] = array(); } - function add_old_compat_help( $help ) { - self::$_old_compat_help[ $this->id ] = $help; + static function add_old_compat_help( $screen, $help ) { + self::$_old_compat_help[ $screen ] = $help; } /**