[wp-trac] [WordPress Trac] #37526: Introduce the possibility to register new administration panels
WordPress Trac
noreply at wordpress.org
Sat Jul 30 10:54:03 UTC 2016
#37526: Introduce the possibility to register new administration panels
-------------------------------------+------------------------------
Reporter: flixos90 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Administration | Version:
Severity: normal | Resolution:
Keywords: 2nd-opinion needs-patch | Focuses: multisite
-------------------------------------+------------------------------
Comment (by flixos90):
[attachment:37526.diff] is a first take on what this functionality could
look like.
* `register_administration_panel( $name, $args )` and related getter
functions are introduced in `wp-admin/includes/misc.php`
* the 'network' and 'user' administration panels are registered using that
function (in `wp-admin/admin.php`; plugins can use it on `admin_init`)
* areas that perform general checks on which administration panel is
currently active now use the new functionality (not sure if I covered it
all yet though); affected by this:
* the `menu.php` file which is included (in `wp-admin/admin.php`)
* the private and public hooks run to allow modification of the admin
menu (in `wp-admin/includes/menu.php`)
* the admin title tag content and the hook for admin notices (in `wp-
admin/admin-header.php`)
* the process of setting the `$in_admin` property of `WP_Screen` (in
`wp-admin/includes/class-wp-screen.php`)
* the function that `self_admin_url()` uses to return the current
admin URL (in `wp-includes/link-template.php`)
One problem yet to be solved is the definition of `WP_BLOG_ADMIN` in the
beginning of `wp-admin/admin.php`: at this point the administration panels
are not registered yet, so we can't properly detect that. I'm not sure
whether this is a real problem since the constant is only used in
`is_blog_admin()` (and even there, only before the current screen is set).
Maybe we can ignore the constant in some way and modify `is_blog_admin()`
since the blog admin is the default admin anyway. The registered
administration panels could be checked, and if none of them is active,
assume we're in the blog admin.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37526#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list