[wp-trac] [WordPress Trac] #37526: Introduce the possibility to register new administration panels

WordPress Trac noreply at wordpress.org
Sat Jul 30 10:35:00 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          |   Keywords:  2nd-opinion needs-patch
  Focuses:  multisite       |
----------------------------+-------------------------------------
 I'm currently trying to build a plugin that implements a completely custom
 administration panel. Unfortunately it's currently not possible to fully
 make it work with the Core implementation. Therefore my proposal is to
 introduce a function like `register_administration_panel( $name, $args )`
 that developers can use to build their own custom admin panel and have
 Core support it. They would need to take care of the functionality for
 that panel themselves - the registration would only ensure that the parts
 that are unified for all administration panels in Core will act in a
 compatible manner.

 WordPress Core supports two additional administration panels on Multisite
 ('network' and 'user') which could leverage that function as well. The
 idea is that everywhere we currently check for `is_network_admin()` and
 `is_user_admin()`, we'd now use the administration panels registered to
 detect where we currently are. This would provide a flexible API and also
 clean up some code. The default admin would not be checked for there,
 instead it will be the fallback as it currently is in Core implementation
 as well.

 Note that registering a custom administration panel should be considered
 an edge-case. The reason I personally would appreciate that functionality
 for is that I'm building a plugin that implements a global administration
 panel (for Multinetwork). Note that while the examples I mentioned are all
 Multisite-related, the function shouldn't be restricted to Multisite. The
 average plugin won't and shouldn't use it, but the function can be useful
 for custom projects which require an interface that other plugins should
 not interact with at all, for example a member area of a membership site
 with custom functionality.

 Introducing this functionality would also make #37445 and #37446
 unnecessary (two tickets I opened earlier).

 I will add a patch as a proof-of-concept of what this could look like.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37526>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list