-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Open
Labels
[Feature] Templates APIRelated to API powering block template functionality in the Site EditorRelated to API powering block template functionality in the Site Editor[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Description
Description
Custom page templates added with the theme_templates or theme_{$post_type}_templates filters can no longer be selected in the post editor. If a post is assigned a template that was previously made available through one of these filters, the template panel doesn't appear at all.
My guess is that this change occurred in #56817, but I didn't verify that.
Step-by-step reproduction instructions
- Add the demonstration filter below to a site running WordPress 6.4 or earlier.
- Edit a post, and assign it
My Custom Templateusing the template panel. - Update the site to WordPress 6.5 or later.
- Open the post in the post editor, and observe that the template panel doesn't appear.
- Create a new post in the post editor, and observe that
My Custom Templatecan't be selected in the template panel.
Screenshots, screen recording, code snippet
add_filter(
'theme_templates',
function ( $post_templates ) {
$post_templates['my-custom-template'] = 'My Custom Template';
return $post_templates;
},
);Environment info
WordPress 6.4–6.6 with the default theme. Gutenberg isn't installed.
Please confirm that you have searched existing issues in the repo.
- Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
- Yes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
[Feature] Templates APIRelated to API powering block template functionality in the Site EditorRelated to API powering block template functionality in the Site Editor[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Type
Projects
Status
🦵 Punted to 7.0