Skip to content
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

Post formats: Make title and description human readable #69275

Merged
merged 2 commits into from
Feb 24, 2025

Conversation

carolinan
Copy link
Contributor

What?

Closes #65319

This PR adds a new 6.8 compatibility file with a filter that makes the title and description of the post format templates human readable.
This change is already merged into WordPress 6.8 in https://core.trac.wordpress.org/ticket/62326
No additional PHP backport from Gutenberg to core is needed.

Why?

In the template data views, the post format templates showed the slug instead of a title, and there was no description.

How?

Filters default_template_types to add a description and title to the different post format templates.

Testing Instructions

First, you need a block theme, and you need to enable post format support on the active theme.

Example:

function twentytwentyfour_setup(){
	add_theme_support( 'post-formats', array( 'standard', 'aside', 'gallery', 'audio', 'video', 'link', 'image', 'chat', 'status', 'quote' ) );
}

add_action( 'after_setup_theme', 'twentytwentyfour_setup' );

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

Go to Appearance > Editor > Templates.
Note that the link archive is available, and that there is a name and description.

Screenshots or screencast

After: The link post format template on the Site Editor Template screen has a readable name and description.
Screenshot 2025-02-21 120542

@carolinan carolinan added [Type] Enhancement A suggestion for improvement. No Core Sync Required Indicates that any changes do not need to be synced to WordPress Core labels Feb 21, 2025
@carolinan carolinan marked this pull request as ready for review February 21, 2025 11:18
Copy link

github-actions bot commented Feb 21, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: carolinan <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: Mamaduka <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@carolinan carolinan added [Type] Bug An existing feature does not function as intended and removed [Type] Enhancement A suggestion for improvement. labels Feb 21, 2025
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @carolinan!

@carolinan carolinan merged commit b06588e into trunk Feb 24, 2025
61 checks passed
@carolinan carolinan deleted the update/post-format-template-texts branch February 24, 2025 05:04
@github-actions github-actions bot added this to the Gutenberg 20.4 milestone Feb 24, 2025
Kallyan01 pushed a commit to Kallyan01/gutenberg that referenced this pull request Feb 24, 2025
)

* Post formats: Make title and description human readable

Co-authored-by: carolinan <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: Mamaduka <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
No Core Sync Required Indicates that any changes do not need to be synced to WordPress Core [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Post formats: Archive templates have no description and use the slug instead of a readable name
3 participants