Make WordPress Core

Opened 18 months ago

Closed 18 months ago

Last modified 18 months ago

#54683 closed defect (bug) (fixed)

Allow the Customize admin bar node to show on the front-end when using a block theme if any plugins use the Customizer.

Reported by: pbiron's profile pbiron Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.9 Priority: normal
Severity: normal Version: 5.9
Component: Toolbar Keywords: has-patch has-screenshots
Focuses: Cc:

Description

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

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

Note: since not that many plugins use the Customizer, I don't think it's essential that this get fixed before 5.9 is released...though, I certainly wouldn't object if the release leads want to include this in 5.9 :-)

Attachments (5)

54683.diff (1002 bytes) - added by pbiron 18 months ago.
customize-missing-wide.png (2.4 KB) - added by sabernhardt 18 months ago.
desktop width, without patch
customize-missing-narrow.png (2.7 KB) - added by sabernhardt 18 months ago.
mobile width (640px), without patch
customize-added-in-patch-wide.png (2.7 KB) - added by sabernhardt 18 months ago.
desktop width, with patch
customize-added-in-patch-narrow.png (2.9 KB) - added by sabernhardt 18 months ago.
mobile width (640px), with patch

Download all attachments as: .zip

Change History (12)

@pbiron
18 months ago

This ticket was mentioned in Slack in #core by pbiron. View the logs.


18 months ago

#2 @audrasjb
18 months ago

  • Milestone changed from Awaiting Review to 5.9

Moving for 5.9 consideration

#3 @audrasjb
18 months ago

Thanks @pbiron it looks like a fair change to the current implementation.
Even is there is not so much plugins using this in the repository, I do think a lot of developers may use customize_register in their own self-made plugins, so it's probably worth to consider this use case.

@sabernhardt
18 months ago

desktop width, without patch

@sabernhardt
18 months ago

mobile width (640px), without patch

@sabernhardt
18 months ago

desktop width, with patch

@sabernhardt
18 months ago

mobile width (640px), with patch

#4 @sabernhardt
18 months ago

  • Component changed from Customize to Toolbar
  • Keywords has-screenshots added

I had customize_register in a custom plugin to create each of the screenshots.

If anyone else wants to test it, you can use this code:

add_action( 'customize_register', '__return_true' );

#5 @costdev
18 months ago

Test Report

Env

  • WordPress: trunk
  • Chrome 96.0.4664.110
  • Windows 10
  • Theme: Twenty Twenty-Two
  • Plugins: Simple Customizer

Steps to test

  1. Install and activate a plugin that uses the Customizer.
  2. Navigate to the site's home page.
  3. The "Customize" admin bar item should not be displayed.
  4. Apply patch 54683.diff.
  5. Refresh the home page.
  6. The "Customize" admin bar item should be displayed.

Results

  • Before 54683.diff: No "Customize" admin bar item.
  • After 54683.diff: The "Customize" admin bar item is shown.
  • Patch works as expected. 👍

#6 @SergeyBiryukov
18 months ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 52414:

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.

#7 @dlh
18 months ago

#54620 was marked as a duplicate.

Note: See TracTickets for help on using tickets.