[wp-trac] [WordPress Trac] #33411: remove_panel('nav_menus') action generates errors
WordPress Trac
noreply at wordpress.org
Tue Aug 18 22:17:57 UTC 2015
#33411: remove_panel('nav_menus') action generates errors
----------------------------+-----------------------------
Reporter: IstanbulMMV | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Customize | Version: 4.3
Severity: normal | Keywords:
Focuses: administration |
----------------------------+-----------------------------
After removing the nav_menus panel in the Customizer, all custom panels
are rendered above the Active theme section regardless of the priority a
custom panel has been allocated.
$wp_customize->remove_panel( 'nav_menus' ) also generates the php error
"Trying to get property of non-object in /wp-includes/class-wp-customize-
nav-menus.php on line 340"
Example code:
{{{
function custom_customize_register( $wp_customize ) {
$wp_customize->remove_panel( 'nav_menus' );
$wp_customize->remove_panel( 'widgets' ); // Works perfectly.
$wp_customize->add_panel( 'contact_details', array(
'title' => __( 'Contact Details' ),
'priority' => 200,
) );
$wp_customize->add_section( 'address_details', array(
'title' => __( 'Address Details' ),
'panel' => 'contact_details',
) );
$wp_customize->add_setting( 'phone_number', array(
'type' => 'option',
) );
$wp_customize->add_control( 'phone_number', array(
'label' => __( 'Phone Number' ),
'section' => 'address_details',
) );
}
add_action( 'customize_register', 'custom_customize_register', 1000 );
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33411>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list