-
Notifications
You must be signed in to change notification settings - Fork 351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blank Canvas: Customizer Fixes #2984
Conversation
function blank_canvas_remove_customizer_settings( $wp_customize ) { | ||
|
||
// Remove the navigation menus Customizer panel. | ||
$wp_customize->get_panel( 'nav_menus' )->active_callback = '__return_false'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expected to be able to use something like $wp_customize->remove_panel( 'nav_menus' )
, but it throws an error:
Notice: WP_Customize_Manager::remove_panel was called incorrectly. Removing nav_menus manually will cause PHP warnings. Use the customize_loaded_components filter instead. Please see Debugging in WordPress for more information. (This message was added in version 4.5.0.)
The approach I used instead comes from this thread, and seems to work in my testing.
This looks good, but I note that it also removes Content Options which I think could be useful. |
Oh right, I forgot to mention that part! This PR doesn't explicitly remove that panel, it just removes Jetpack's "Author Bio" setting in that panel, since the theme won't display an author bio. If that is the only setting in the panel, the panel disappears on its own when it's empty. |
In that case I'll 🚢 |
This PR tidies up customizer options for the Blank Canvas theme:
blank_canvas_remove_parent_theme_features
function, to ensure that the nav menu areas are actually removed (Fixes Blank Canvas: Deregistered menu locations are still appearing in the Customizer #2980)Screenshots