Skip to content
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

Merged
merged 8 commits into from
Jan 8, 2021
Merged

Conversation

kjellr
Copy link
Contributor

@kjellr kjellr commented Jan 7, 2021

This PR tidies up customizer options for the Blank Canvas theme:

  • It increases the priority of the 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)
  • It removes the "Navigation" panel from the customizer entirely, since no menu areas are present in this theme. (I guess this doesn't disappear automatically?)
  • It removes Seedlet's widget area, so the Widgets panel should no longer appear.
  • It adds a message to the top of the "Site Identity" panel, to clarify that the title and tagline will never appear on single posts and pages.

Screenshots

Before After
Screen Shot 2021-01-07 at 2 07 51 PM Screen Shot 2021-01-07 at 2 06 50 PM
Before After
Screen Shot 2021-01-07 at 2 09 10 PM Screen Shot 2021-01-07 at 2 10 54 PM

@kjellr kjellr added [Type] Bug Something isn't working [Type] Enhancement New feature or request [Theme] Blank Canvas labels Jan 7, 2021
@kjellr kjellr requested a review from a team January 7, 2021 19:11
@kjellr kjellr self-assigned this Jan 7, 2021
function blank_canvas_remove_customizer_settings( $wp_customize ) {

// Remove the navigation menus Customizer panel.
$wp_customize->get_panel( 'nav_menus' )->active_callback = '__return_false';
Copy link
Contributor Author

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.

@scruffian
Copy link
Member

This looks good, but I note that it also removes Content Options which I think could be useful.

@kjellr
Copy link
Contributor Author

kjellr commented Jan 8, 2021

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.

@scruffian
Copy link
Member

In that case I'll 🚢

@scruffian scruffian merged commit a2dd8f8 into trunk Jan 8, 2021
@scruffian scruffian deleted the update/blank-canvas/customizer-fixes branch January 8, 2021 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Theme] Blank Canvas [Type] Bug Something isn't working [Type] Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Blank Canvas: Deregistered menu locations are still appearing in the Customizer
2 participants