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 Template using 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 Template can'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.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Description
Custom page templates added with the
theme_templatesortheme_{$post_type}_templatesfilters 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
My Custom Templateusing the template panel.My Custom Templatecan't be selected in the template panel.Screenshots, screen recording, code snippet
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.
Please confirm that you have tested with all plugins deactivated except Gutenberg.