-
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
Update template descriptions for clarity and humanity. #29531
Conversation
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.
Love it, vast improvement. Much clearer.
There's one typo that needs fixing, and I left a bunch of optional tweaks. But big improvement.
), | ||
'single' => array( | ||
'title' => _x( 'Single', 'Template name', 'gutenberg' ), | ||
'description' => __( 'Used when a single entry that is not a Page is queried', 'gutenberg' ), | ||
'description' => __( 'Template used to display a single post or entry.', 'gutenberg' ), |
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.
Is the term "entry" valuable here? We might be able to do without that word entirely.
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.
It's to somehow differentiate from the single-post case.
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 think we should remove the single-post from the default set, actually.
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.
It is also important to clarify that the template can display post types other than post
, which comes in to play whenever a CPT is registered.
In fact this is the reason that single-post
was included as well. It's explicit nature means we can enable folks to intuitively add a template just for post
s which will likely be a common use case. There is a dedicated template for Pages, it makes sense for there to be a dedicated template for Posts as well, imo.
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 don't think that would be very intuitive. Pages are a special case when it comes to templates in WP. I don't think I have seen major themes that use single-post
. Almost always you want to capture as many single post type entities as possible with it, and discriminate pages, which are not chronological.
If a custom post type requires a special treatment, it makes sense for that to be created specifically.
), | ||
'single-post' => array( | ||
'title' => _x( 'Post', 'Template name', 'gutenberg' ), | ||
'description' => __( 'Used when a single Post is queried', 'gutenberg' ), | ||
'description' => __( 'Template used to display a single post type.', 'gutenberg' ), |
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.
"single post type" suggests some CPT action going on. I wonder if we can do without "type"?
), | ||
'singular' => array( | ||
'title' => _x( 'Singular', 'Template name', 'gutenberg' ), | ||
'description' => __( 'Used when a single entry is queried. This template will be overridden by the Single, Post, and Page templates where appropriate', 'gutenberg' ), | ||
'description' => __( 'Template used for displaying single views of the content. This template is a fallback for the Single, Post, and Page templates, which take precedence when they exist.', 'gutenberg' ), |
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.
👌
Size Change: +1 B (0%) Total Size: 1.39 MB
ℹ️ View Unchanged
|
This commit updates the descriptions used for templates to be more clear and direct, and add context when necessary.
Afterwards, it'd be really neat if we can make some things contextual to whether other templates are set. For example, showing what things a template applies to based on what other templates exist. We can use the sidebar to more clearly illustrate those relationships.