-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Don't use the custom 'Template Parts' page with WP 6.1 and above #45158
Conversation
5b27479
to
229cb23
Compare
|
||
$needs_custom_page = true; | ||
foreach ( $submenu['themes.php'] as $menu_item ) { | ||
if ( str_contains( $menu_item[2], 'site-editor.php?postType=wp_template_part' ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure whether there is any other way to query this, but just from my gut feeling this feels rather fragile. But I will still approve the PR since we can follow up with a more robust solution and this does fix the bug that is currently present.
@priethor, @juanmaguitar, can we backport this into 14.4? It would be great to land the fix in the plugin before WP 6.1 is released |
Cherry-picked to the 14.4 branch in 55180ae ✅ |
Thank you, @priethor! |
What?
PR adds a check not to register the custom 'Template Parts' page for WP 6.1 and above. This also prevents displaying two menu items with 'Template Parts' under the Appearance.
Why?
The custom page is only needed for older WP versions, where required restrictions are missing from
site-editor.php
.Testing Instructions
site-editor.php
path.Screenshots or screencast