Full Site Editing: Improve compat with 3rd party Customizer links #38598
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Only try to move and/or remove Core's Customizer link when a block theme is active.
Note that this is a real-world issue on WordPress.com, where the AMP plugin uses the Customizer to autofocus an AMP section in the Customizer. You will not see the bug on a standard install as our load order is a bit different so the AMP callback to
admin_menu
calls prior togutenberg_remove_legacy_pages
, despite both being on the default10
priority. Any plugin that leverages the Customizer will see its link restored rather than the Customizer itself.Testing Instructions
Add a customizer-based appearance menu at an early priority. Eg:
Without this patch, you should see that the Third Party item is restored rather than the Core Customizer link. With this patch, both are maintained, but the Customizer is demoted according to the intent the original code by @Mamaduka in #37175
Screenshots
Before:
![Screen Shot 2022-02-07 at 15 23 08](https://cdn.statically.io/img/user-images.githubusercontent.com/195089/152874191-2e35c7c3-87fe-4bd6-8132-e82264caa6de.png)
After:
![Screen Shot 2022-02-07 at 15 23 45](https://cdn.statically.io/img/user-images.githubusercontent.com/195089/152874323-f7de51bf-0c97-4128-a8d3-b7f2b01a2b74.png)
Types of changes
Bug fix
Checklist:
*.native.js
files for terms that need renaming or removal).