[wp-trac] [WordPress Trac] #33411: remove_panel('nav_menus') action generates errors

WordPress Trac noreply at wordpress.org
Tue Aug 25 01:41:13 UTC 2015


#33411: remove_panel('nav_menus') action generates errors
---------------------------------+-----------------------------------------
 Reporter:  IstanbulMMV          |       Owner:
     Type:  defect (bug)         |      Status:  new
 Priority:  normal               |   Milestone:  4.3.1
Component:  Customize            |     Version:  4.3
 Severity:  normal               |  Resolution:
 Keywords:  2nd-opinion has-     |     Focuses:  javascript, administration
  patch                          |
---------------------------------+-----------------------------------------

Comment (by DrewAPicture):

 Replying to [comment:8 westonruter]:
 > With that in place, you could disable menus in the Customizer just with
 this plugin:
 >
 > {{{#!php
 > <?php
 > add_action( 'customize_manager_construct', function( $wp_customize ) {
 >       $wp_customize->nav_menus = false;
 > } );
 > }}}
 >
 > Nice and clean.

 Very interesting. I wonder what if any potential downsides there might be
 in placing such a general hook this high up in the stack.

 I'd almost be tempted use a dynamic hook with a whitelist based on the
 `nav_menus` and `widgets` properties to sort of lock it down to this
 specific context.

 The whitelist could be expanded in the future without opening the door
 wide to the scenario that any general-purpose hook brings: having to
 support any number of unexpected use-cases down the road.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33411#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list