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
This commit is contained in:
Jb Audras 2022-08-03 12:18:22 +00:00
parent b5b0c8e550
commit 66dba67484
6 changed files with 48 additions and 10 deletions

View File

@ -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%/';
}

View File

@ -66,9 +66,17 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
<td><input name="blogname" type="text" id="blogname" value="<?php form_option( 'blogname' ); ?>" class="regular-text" /></td>
</tr>
<?php
/* translators: Site tagline. */
$sample_tagline = __( 'Just another WordPress site' );
if ( is_multisite() ) {
/* translators: %s: Network title. */
$sample_tagline = sprintf( __( 'Just another %s site' ), get_network()->site_name );
}
?>
<tr>
<th scope="row"><label for="blogdescription"><?php _e( 'Tagline' ); ?></label></th>
<td><input name="blogdescription" type="text" id="blogdescription" aria-describedby="tagline-description" value="<?php form_option( 'blogdescription' ); ?>" class="regular-text" />
<td><input name="blogdescription" type="text" id="blogdescription" aria-describedby="tagline-description" value="<?php form_option( 'blogdescription' ); ?>" class="regular-text" placeholder="<?php echo $sample_tagline; ?>" />
<p class="description" id="tagline-description"><?php _e( 'In a few words, explain what this site is about.' ); ?></p></td>
</tr>

View File

@ -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.
*/

View File

@ -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.
*/

View File

@ -60,6 +60,18 @@ class Tests_General_wpGetDocumentTitle extends WP_UnitTestCase {
public function test__wp_render_title_tag() {
$this->go_to( '/' );
$this->expectOutputString( sprintf( "<title>%s</title>\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( "<title>%s &#8211; %s</title>\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 &#8211; 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 &#8211; 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 &#8211; Page 4 &#8211; Just another WordPress site', $this->blog_name ), wp_get_document_title() );
$this->assertSame( sprintf( '%s &#8211; Page 4', $this->blog_name ), wp_get_document_title() );
}
public function paged_title_parts( $parts ) {

View File

@ -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": "",