Skip to content

Commit

Permalink
Editor: Update single default template description.
Browse files Browse the repository at this point in the history
In order to add more template types we need to update some copy from the current default templates provided.

This updates the `single` template copy as it's needed to clear up the ambiguity between the single template that is the fallback for any custom post type (including `post`) and the menu item to be added in a subsequent commit, that will allow the creation the `single-post` template and any `single_$post_type` template.

This commit backports the original PR from Gutenberg repository:
* [WordPress/gutenberg#41302 #41302: Site Editor: Update single default template copy]

Follow-up to [52062], [52331].

Props ntsekouras, bernhard-reiter, jameskoster, Mamaduka, scruffian.
Fixes #56534.

git-svn-id: https://develop.svn.wordpress.org/trunk@54104 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Sep 8, 2022
1 parent 423f653 commit 1439dc9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/wp-includes/block-template-utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ function get_default_block_template_types() {
'description' => __( 'Displays a single post or page.' ),
),
'single' => array(
'title' => _x( 'Single Post', 'Template name' ),
'description' => __( 'Displays a single post.' ),
'title' => _x( 'Single', 'Template name' ),
'description' => __( 'The default template for displaying any single post or attachment.' ),
),
'page' => array(
'title' => _x( 'Page', 'Template name' ),
Expand Down
4 changes: 2 additions & 2 deletions tests/phpunit/tests/block-template-utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ function test_build_block_template_result_from_file() {
$this->assertSame( 'single', $template->slug );
$this->assertSame( 'publish', $template->status );
$this->assertSame( 'theme', $template->source );
$this->assertSame( 'Single Post', $template->title );
$this->assertSame( 'Displays a single post.', $template->description );
$this->assertSame( 'Single', $template->title );
$this->assertSame( 'The default template for displaying any single post or attachment.', $template->description );
$this->assertSame( 'wp_template', $template->type );

// Test template parts.
Expand Down

0 comments on commit 1439dc9

Please sign in to comment.