From 5f7706e5e84eb989c94b017843fe2a37eab0e795 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sun, 28 Aug 2016 02:24:14 +0000 Subject: [PATCH] Admin: allow `WP_Screen` to be checked via autoload in `convert_to_screen()`. Props kraftbj. See #36335. git-svn-id: https://develop.svn.wordpress.org/trunk@38414 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/template.php b/src/wp-admin/includes/template.php index 6d3fb0d715..dce84fc43a 100644 --- a/src/wp-admin/includes/template.php +++ b/src/wp-admin/includes/template.php @@ -1989,7 +1989,7 @@ function _wp_admin_html_begin() { * @return WP_Screen Screen object. */ function convert_to_screen( $hook_name ) { - if ( ! class_exists( 'WP_Screen', false ) ) { + if ( ! class_exists( 'WP_Screen' ) ) { _doing_it_wrong( 'convert_to_screen(), add_meta_box()', __( "Likely direct inclusion of wp-admin/includes/template.php in order to use add_meta_box(). This is very wrong. Hook the add_meta_box() call into the add_meta_boxes action instead." ), '3.3.0' ); return (object) array( 'id' => '_invalid', 'base' => '_are_belong_to_us' ); }