Skip to content

Commit

Permalink
Administration: Change default site tagline to an empty string.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
audrasjb committed Aug 3, 2022
1 parent b5b0c8e commit 66dba67
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 10 deletions.
5 changes: 1 addition & 4 deletions src/wp-admin/includes/schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down Expand Up @@ -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%/';
}

Expand Down
10 changes: 9 additions & 1 deletion src/wp-admin/options-general.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,17 @@
<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>

Expand Down
10 changes: 10 additions & 0 deletions tests/phpunit/tests/feed/atom.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
wp_set_object_terms( $post, self::$category->slug, 'category' );
}

// Assign a tagline option.
update_option( 'blogdescription', 'Just another WordPress site' );

}

/**
Expand All @@ -63,6 +66,13 @@ public function set_up() {
$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.
*/
Expand Down
11 changes: 11 additions & 0 deletions tests/phpunit/tests/feed/rss2.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
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' );

}

/**
Expand All @@ -75,6 +79,13 @@ public function set_up() {
create_initial_taxonomies();
}

/**
* Tear down.
*/
public static function wpTearDownAfterClass() {
delete_option( 'blogdescription' );
}

/**
* This is a bit of a hack used to buffer feed content.
*/
Expand Down
18 changes: 15 additions & 3 deletions tests/phpunit/tests/general/wpGetDocumentTitle.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@ public function add_title_tag_support() {
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();
}
Expand Down Expand Up @@ -99,12 +111,12 @@ public function test_front_page_title() {
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 ) {
Expand Down Expand Up @@ -135,7 +147,7 @@ public function test_paged_title() {

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 ) {
Expand Down
4 changes: 2 additions & 2 deletions tests/qunit/fixtures/wp-api-generated.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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": "",
Expand Down

0 comments on commit 66dba67

Please sign in to comment.