Make WordPress Core

Changeset 52414


Ignore:
Timestamp:
12/25/2021 03:15:16 AM (3 years ago)
Author:
SergeyBiryukov
Message:

Toolbar: Show the Customize link on front end when using a block theme if any plugins use the Customizer.

In WordPress 5.9, when a block theme is being used, the Appearance → Customize admin menu item is not present unless a plugin uses the Customizer.

The Customize admin bar node should be shown on the front end if any plugins are using the Customizer, even if the current theme is a block theme.

This commit mirrors a similar check in the admin menu to determine if the Customize link should be displayed.

Follow-up to [52069], [52134], [52158], [52178].

Props pbiron, audrasjb, sabernhardt, costdev.
Fixes #54683.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/admin-bar.php

    r52330 r52414  
    447447    global $wp_customize;
    448448
    449     // Don't show if a block theme is activated.
    450     if ( wp_is_block_theme() ) {
     449    // Don't show if a block theme is activated and no plugins use the customizer.
     450    if ( wp_is_block_theme() && ! has_action( 'customize_register' ) ) {
    451451        return;
    452452    }
Note: See TracChangeset for help on using the changeset viewer.