Open carolinan opened 2 months ago
TLDR: It seems the data for this template does not exist in the entity records.
The title and description of the default templates are defined in the core: https://github.com/WordPress/wordpress-develop/blob/a78540b0881a195ec8488bb6bdf878114d75f8b8/src/wp-includes/block-template-utils.php#L141
Therefore, it may be a good idea to submit a core ticket.
By the way, you can change the title and description by using the default_template_types
filter hook:
function twentytwentyfour_add_default_template( $default_template_types ) {
$default_template_types['taxonomy-post_format-post-format-link'] = array(
'title' => __( 'Link Post Format' ),
'description' => __( 'Description.' ),
);
return $default_template_types;
}
add_action( 'default_template_types', 'twentytwentyfour_add_default_template' );
This hook is not only reflected in the DataViews, but also in the template sidebar, for example:
Thank you!
Adding a link to the core ticket and PR meanwhile: https://core.trac.wordpress.org/ticket/62326
Description
When a block theme includes the HTML file for a post format archive, the Site Editor and Data Views shows the template without a description and without a human-readable name. Instead it uses the slug, name from the HTML file.
It is as if the Data Views do not recognise that the template is part of the template hierachy.
Step-by-step reproduction instructions
First, you need a block theme, and you need to enable post format support on the active theme.
Example:
Next, add a post format archive template inside the
templates
folder. The content of the file does not matter for this test. I have used the link post format as example:templates/taxonomy-post_format-post-format-link.html
Optionally, create one or more posts with the link post format assigned.
Go to Appearance > Editor > Templates. Note that the link archive is available, but uses the whole slug as the template name.
Screenshots, screen recording, code snippet
Environment info
WordPress 6.6.2, with and without Gutenberg trunk.
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.