[wp-trac] [WordPress Trac] #36335: Next generation: core autoloader proposal
WordPress Trac
noreply at wordpress.org
Sun Aug 28 01:04:12 UTC 2016
#36335: Next generation: core autoloader proposal
-----------------------------+------------------
Reporter: dnaber-de | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: 4.7
Component: General | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
-----------------------------+------------------
Comment (by kraftbj):
Since this landed, there seems to be an order issue where WP_Screen isn't
being loaded until, at least, after the `admin_init` hook. I'm unfamiliar
with the methods we're using to debug it immediately.
Prior, no notice thrown. After:
{{{
NOTICE: wp-includes/functions.php:4027 - convert_to_screen(),
add_meta_box() was called incorrectly. 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. Please see Debugging in WordPress for more information. (This
message was added in version 3.3.0.)
require_once('wp-admin/admin.php'), do_action('admin_init'),
Akismet_Admin::admin_init, add_meta_box, convert_to_screen,
_doing_it_wrong, trigger_error
}}}
When `add_meta_box` has the screen arg set as a string,
`convert_to_screen` fires. `convert_to_screen` checks `if ( !
class_exists( 'WP_Screen', false ) ) {`, which then throws the
`_doing_it_wrong`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36335#comment:103>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list