From 66dba67484a2e0aaa7bcafc0fa70b33d64448f74 Mon Sep 17 00:00:00 2001 From: Jb Audras Date: Wed, 3 Aug 2022 12:18:22 +0000 Subject: [PATCH] Administration: Change default site tagline to an empty string. This changeset replaces the default "Just another WordPress site" tagline with an empty string for new installations. The reasoning is: 1. Not all themes display the tagline; 2. Not everyone changes the default tagline; 3. When people don't see the tagline in their theme, they may not realize it is still visible in some places, like feeds. The string "Just another WordPress site" and the related multisite string: "Just another {NETWORK} site" are now only used as a placeholder for the tagline admin option. Props markjaquith, Denis-de-Bernardy, westi, RyanMurphy, kovshenin, SergeyBiryukov, chriscct7, tyxla, hyperbrand, karmatosed, lukecavanagh, melchoyce, boemedia, khag7, sabernhardt, audrasjb, peterwilsoncc, costdev, martinkrcho, rafiahmedd. Fixes #6479. git-svn-id: https://develop.svn.wordpress.org/trunk@53815 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/schema.php | 5 +---- src/wp-admin/options-general.php | 10 +++++++++- tests/phpunit/tests/feed/atom.php | 10 ++++++++++ tests/phpunit/tests/feed/rss2.php | 11 +++++++++++ .../tests/general/wpGetDocumentTitle.php | 18 +++++++++++++++--- tests/qunit/fixtures/wp-api-generated.js | 4 ++-- 6 files changed, 48 insertions(+), 10 deletions(-) diff --git a/src/wp-admin/includes/schema.php b/src/wp-admin/includes/schema.php index a9978bc3b3..5a04ce4750 100644 --- a/src/wp-admin/includes/schema.php +++ b/src/wp-admin/includes/schema.php @@ -401,8 +401,7 @@ function populate_options( array $options = array() ) { 'siteurl' => $guessurl, 'home' => $guessurl, 'blogname' => __( 'My Site' ), - /* translators: Site tagline. */ - 'blogdescription' => __( 'Just another WordPress site' ), + 'blogdescription' => '', 'users_can_register' => 0, 'admin_email' => 'you@example.com', /* translators: Default start of the week. 0 = Sunday, 1 = Monday. */ @@ -555,8 +554,6 @@ function populate_options( array $options = array() ) { // 3.0.0 multisite. if ( is_multisite() ) { - /* translators: %s: Network title. */ - $defaults['blogdescription'] = sprintf( __( 'Just another %s site' ), get_network()->site_name ); $defaults['permalink_structure'] = '/%year%/%monthnum%/%day%/%postname%/'; } diff --git a/src/wp-admin/options-general.php b/src/wp-admin/options-general.php index 20c83fb1d8..5834c8a9d7 100644 --- a/src/wp-admin/options-general.php +++ b/src/wp-admin/options-general.php @@ -66,9 +66,17 @@ require_once ABSPATH . 'wp-admin/admin-header.php'; +site_name ); +} +?> - +

diff --git a/tests/phpunit/tests/feed/atom.php b/tests/phpunit/tests/feed/atom.php index 7b9ca4c405..4b965d49dd 100644 --- a/tests/phpunit/tests/feed/atom.php +++ b/tests/phpunit/tests/feed/atom.php @@ -51,6 +51,9 @@ class Tests_Feed_Atom extends WP_UnitTestCase { wp_set_object_terms( $post, self::$category->slug, 'category' ); } + // Assign a tagline option. + update_option( 'blogdescription', 'Just another WordPress site' ); + } /** @@ -63,6 +66,13 @@ class Tests_Feed_Atom extends WP_UnitTestCase { $this->excerpt_only = get_option( 'rss_use_excerpt' ); } + /** + * Tear down. + */ + public static function wpTearDownAfterClass() { + delete_option( 'blogdescription' ); + } + /** * This is a bit of a hack used to buffer feed content. */ diff --git a/tests/phpunit/tests/feed/rss2.php b/tests/phpunit/tests/feed/rss2.php index dcee021b0b..e365c62446 100644 --- a/tests/phpunit/tests/feed/rss2.php +++ b/tests/phpunit/tests/feed/rss2.php @@ -58,6 +58,10 @@ class Tests_Feed_RSS2 extends WP_UnitTestCase { foreach ( self::$posts as $post ) { wp_set_object_terms( $post, self::$category->slug, 'category' ); } + + // Assign a tagline option. + update_option( 'blogdescription', 'Just another WordPress site' ); + } /** @@ -75,6 +79,13 @@ class Tests_Feed_RSS2 extends WP_UnitTestCase { create_initial_taxonomies(); } + /** + * Tear down. + */ + public static function wpTearDownAfterClass() { + delete_option( 'blogdescription' ); + } + /** * This is a bit of a hack used to buffer feed content. */ diff --git a/tests/phpunit/tests/general/wpGetDocumentTitle.php b/tests/phpunit/tests/general/wpGetDocumentTitle.php index 08d9e033f3..b7b82c7093 100644 --- a/tests/phpunit/tests/general/wpGetDocumentTitle.php +++ b/tests/phpunit/tests/general/wpGetDocumentTitle.php @@ -60,6 +60,18 @@ class Tests_General_wpGetDocumentTitle extends WP_UnitTestCase { public function test__wp_render_title_tag() { $this->go_to( '/' ); + $this->expectOutputString( sprintf( "%s\n", $this->blog_name ) ); + _wp_render_title_tag(); + } + + /** + * @ticket 6479 + */ + public function test__wp_render_title_tag_with_blog_description() { + $this->go_to( '/' ); + + update_option( 'blogdescription', 'A blog description' ); + $this->expectOutputString( sprintf( "%s – %s\n", $this->blog_name, get_option( 'blogdescription' ) ) ); _wp_render_title_tag(); } @@ -99,12 +111,12 @@ class Tests_General_wpGetDocumentTitle extends WP_UnitTestCase { add_filter( 'document_title_parts', array( $this, 'front_page_title_parts' ) ); $this->go_to( '/' ); - $this->assertSame( sprintf( '%s – Just another WordPress site', $this->blog_name ), wp_get_document_title() ); + $this->assertSame( sprintf( '%s', $this->blog_name ), wp_get_document_title() ); update_option( 'show_on_front', 'posts' ); $this->go_to( '/' ); - $this->assertSame( sprintf( '%s – Just another WordPress site', $this->blog_name ), wp_get_document_title() ); + $this->assertSame( sprintf( '%s', $this->blog_name ), wp_get_document_title() ); } public function front_page_title_parts( $parts ) { @@ -135,7 +147,7 @@ class Tests_General_wpGetDocumentTitle extends WP_UnitTestCase { add_filter( 'document_title_parts', array( $this, 'paged_title_parts' ) ); - $this->assertSame( sprintf( '%s – Page 4 – Just another WordPress site', $this->blog_name ), wp_get_document_title() ); + $this->assertSame( sprintf( '%s – Page 4', $this->blog_name ), wp_get_document_title() ); } public function paged_title_parts( $parts ) { diff --git a/tests/qunit/fixtures/wp-api-generated.js b/tests/qunit/fixtures/wp-api-generated.js index 485746dbc2..e8b4290577 100644 --- a/tests/qunit/fixtures/wp-api-generated.js +++ b/tests/qunit/fixtures/wp-api-generated.js @@ -7,7 +7,7 @@ var mockedApiResponse = {}; mockedApiResponse.Schema = { "name": "Test Blog", - "description": "Just another WordPress site", + "description": "", "url": "http://example.org", "home": "http://example.org", "gmt_offset": "0", @@ -12286,7 +12286,7 @@ mockedApiResponse.CommentModel = { mockedApiResponse.settings = { "title": "Test Blog", - "description": "Just another WordPress site", + "description": "", "url": "http://example.org", "email": "admin@example.org", "timezone": "",