Skip to content

Commit

Permalink
Update template descriptions for clarity and humanity. (#29531)
Browse files Browse the repository at this point in the history
- Modifies all default template descriptions.
  • Loading branch information
mtias authored Mar 4, 2021
1 parent f5b36f3 commit 9bf17a6
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
44 changes: 22 additions & 22 deletions lib/full-site-editing/default-template-types.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,71 +15,71 @@ function gutenberg_get_default_template_types() {
$default_template_types = array(
'index' => array(
'title' => _x( 'Index', 'Template name', 'gutenberg' ),
'description' => __( 'The default template which is used when no other template can be found', 'gutenberg' ),
'description' => __( 'The default template used when no other template is available. This is a required template in WordPress.', 'gutenberg' ),
),
'home' => array(
'title' => _x( 'Home', 'Template name', 'gutenberg' ),
'description' => __( 'The home page template, which is the front page by default. If you use a static front page this is the template for the page with the latest posts', 'gutenberg' ),
'description' => __( 'Template used for the main page that displays blog posts. This is the front page by default in WordPress. If a static front page is set, this is the template used for the page that contains the latest blog posts.', 'gutenberg' ),
),
'front-page' => array(
'title' => _x( 'Front Page', 'Template name', 'gutenberg' ),
'description' => __( 'Used when the site home page is queried', 'gutenberg' ),
'description' => __( 'Template used to render the front page of the site, whether it displays blog posts or a static page. The front page template takes precedence over the "Home" template.', 'gutenberg' ),
),
'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' ),
),
'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 blog post.', 'gutenberg' ),
),
'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' ),
),
'page' => array(
'title' => _x( 'Page', 'Template name', 'gutenberg' ),
'description' => __( 'Used when an individual Page is queried', 'gutenberg' ),
'description' => __( 'Template used to display individual pages.', 'gutenberg' ),
),
'archive' => array(
'title' => _x( 'Archive', 'Template name', 'gutenberg' ),
'description' => __( 'Used when multiple entries are queried. This template will be overridden by the Category, Author, and Date templates where appropriate', 'gutenberg' ),
'description' => __( 'The archive template displays multiple entries at once. It is used as a fallback for the Category, Author, and Date templates, which take precedence when they are available.', 'gutenberg' ),
),
'author' => array(
'title' => _x( 'Author Archive', 'Template name', 'gutenberg' ),
'description' => __( 'Used when a list of Posts from a single author is queried', 'gutenberg' ),
'title' => _x( 'Author', 'Template name', 'gutenberg' ),
'description' => __( 'Archive template used to display a list of posts from a single author.', 'gutenberg' ),
),
'category' => array(
'title' => _x( 'Post Category Archive', 'Template name', 'gutenberg' ),
'description' => __( 'Used when a list of Posts from a category is queried', 'gutenberg' ),
'title' => _x( 'Category', 'Template name', 'gutenberg' ),
'description' => __( 'Archive template used to display a list of posts from the same category.', 'gutenberg' ),
),
'taxonomy' => array(
'title' => _x( 'Taxonomy Archive', 'Template name', 'gutenberg' ),
'description' => __( 'Used when a list of posts from a taxonomy is queried', 'gutenberg' ),
'title' => _x( 'Taxonomy', 'Template name', 'gutenberg' ),
'description' => __( 'Archive template used to display a list of posts from the same taxonomy.', 'gutenberg' ),
),
'date' => array(
'title' => _x( 'Date Archive', 'Template name', 'gutenberg' ),
'description' => __( 'Used when a list of Posts from a certain date are queried', 'gutenberg' ),
'title' => _x( 'Date', 'Template name', 'gutenberg' ),
'description' => __( 'Archive template used to display a list of posts from a specific date.', 'gutenberg' ),
),
'tag' => array(
'title' => _x( 'Tag Archive', 'Template name', 'gutenberg' ),
'description' => __( 'Used when a list of Posts with a certain tag is queried', 'gutenberg' ),
'title' => _x( 'Tag', 'Template name', 'gutenberg' ),
'description' => __( 'Archive template used to display a list of posts with a given tag.', 'gutenberg' ),
),
'attachment' => array(
'title' => __( 'Media', 'gutenberg' ),
'description' => __( 'Used when a Media entry is queried', 'gutenberg' ),
'description' => __( 'Template used to display individual media items or attachments.', 'gutenberg' ),
),
'search' => array(
'title' => _x( 'Search Results', 'Template name', 'gutenberg' ),
'description' => __( 'Used when a visitor searches the site', 'gutenberg' ),
'title' => _x( 'Search', 'Template name', 'gutenberg' ),
'description' => __( 'Template used to display search results.', 'gutenberg' ),
),
'privacy-policy' => array(
'title' => __( 'Privacy Policy', 'gutenberg' ),
'description' => '',
),
'404' => array(
'title' => _x( '404', 'Template name', 'gutenberg' ),
'description' => __( 'Used when the queried content cannot be found', 'gutenberg' ),
'description' => __( 'Template shown when no content is found.', 'gutenberg' ),
),
);

Expand Down
4 changes: 2 additions & 2 deletions packages/e2e-tests/specs/experiments/settings-sidebar.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ describe( 'Settings sidebar', () => {
expect( templateCardBeforeNavigation ).toMatchObject( {
title: 'Index',
description:
'The default template which is used when no other template can be found',
'The default template used when no other template is available. This is a required template in WordPress.',
} );
expect( templateCardAfterNavigation ).toMatchObject( {
title: '404',
description: 'Used when the queried content cannot be found',
description: 'Template shown when no content is found.',
} );
} );
} );
Expand Down
2 changes: 1 addition & 1 deletion phpunit/class-block-templates-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function test_gutenberg_build_template_result_from_file() {
$this->assertEquals( 'publish', $template->status );
$this->assertEquals( false, $template->is_custom );
$this->assertEquals( 'Single', $template->title );
$this->assertEquals( 'Used when a single entry that is not a Page is queried', $template->description );
$this->assertEquals( 'Template used to display a single blog post.', $template->description );
$this->assertEquals( 'wp_template', $template->type );

// Test template parts.
Expand Down
4 changes: 2 additions & 2 deletions phpunit/class-wp-rest-template-controller-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function find_and_normalize_template_by_id( $templates, $id ) {
'raw' => 'Index',
'rendered' => 'Index',
),
'description' => 'The default template which is used when no other template can be found',
'description' => 'The default template used when no other template is available. This is a required template in WordPress.',
'status' => 'publish',
'is_custom' => false,
'type' => 'wp_template',
Expand Down Expand Up @@ -121,7 +121,7 @@ public function test_get_item() {
'raw' => 'Index',
'rendered' => 'Index',
),
'description' => 'The default template which is used when no other template can be found',
'description' => 'The default template used when no other template is available. This is a required template in WordPress.',
'status' => 'publish',
'is_custom' => false,
'type' => 'wp_template',
Expand Down

0 comments on commit 9bf17a6

Please sign in to comment.