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
This commit is contained in:
nacin 2011-10-12 16:22:50 +00:00
parent 0d8b1bdc51
commit aa06a7de9f

View File

@ -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;
}
/**