Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years 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 3 years ago.
customize-missing-wide.png (2.4 KB) - added by sabernhardt 3 years ago.
desktop width, without patch
customize-missing-narrow.png (2.7 KB) - added by sabernhardt 3 years ago.
mobile width (640px), without patch
customize-added-in-patch-wide.png (2.7 KB) - added by sabernhardt 3 years ago.
desktop width, with patch
customize-added-in-patch-narrow.png (2.9 KB) - added by sabernhardt 3 years ago.
mobile width (640px), with patch

Download all attachments as: .zip

Change History (12)

@pbiron
3 years ago

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


3 years ago

#2 @audrasjb
3 years ago

  • Milestone changed from Awaiting Review to 5.9

Moving for 5.9 consideration

#3 @audrasjb
3 years 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
3 years ago

desktop width, without patch

@sabernhardt
3 years ago

mobile width (640px), without patch

@sabernhardt
3 years ago

desktop width, with patch

@sabernhardt
3 years ago

mobile width (640px), with patch

#4 @sabernhardt
3 years 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
3 years 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
3 years 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
3 years ago

#54620 was marked as a duplicate.

Note: See TracTickets for help on using tickets.