[wp-trac] [WordPress Trac] #33648: Removing nav menu panel in Customizer causes PHP notice

WordPress Trac noreply at wordpress.org
Tue Sep 1 16:28:09 UTC 2015


#33648: Removing nav menu panel in Customizer causes PHP notice
--------------------------+------------------------------
 Reporter:  ericlewis     |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Customize     |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------
Description changed by ericlewis:

Old description:

> I'm removing the nav menu panel contextually for a minimalist Customizer
> experience.
>
> If you remove the nav menu panel, the
> [https://github.com/WordPress/WordPress/blob/4.3/wp-includes/class-wp-
> customize-nav-menus.php#L340 l10n configuration breaks] because it
> directly attempts to get the title from the nav menu panel object.
>
>  e.g.
>
> {{{
> <?php
> add_action( 'customize_register', function($manager) {
>         global $wp_customize;
>
>         foreach ( $wp_customize->panels() as $key => $panel ) {
>                 $wp_customize->remove_panel( $key );
>         }
>
>         foreach ( $wp_customize->sections() as $key => $section ) {
>                 $wp_customize->remove_section( $key );
>         }
>
> }, 50, 1 );
> }}}

New description:

 I'm removing the nav menu panel contextually for a minimalist Customizer
 experience.

 If you remove the nav menu panel, the
 [https://github.com/WordPress/WordPress/blob/4.3/wp-includes/class-wp-
 customize-nav-menus.php#L340 l10n configuration breaks] because it
 directly attempts to get the title from the nav menu panel object.

 e.g.

 {{{
 #!php
 <?php
 add_action( 'customize_register', function($manager) {
         global $wp_customize;

         foreach ( $wp_customize->panels() as $key => $panel ) {
                 $wp_customize->remove_panel( $key );
         }

         foreach ( $wp_customize->sections() as $key => $section ) {
                 $wp_customize->remove_section( $key );
         }

 }, 50, 1 );
 }}}

--

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


More information about the wp-trac mailing list