Skip to content

Commit

Permalink
Document meta: Improve the consistency of <title>s (#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
renintw authored Oct 18, 2023
1 parent 8337225 commit 68bdf02
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions source/wp-content/themes/wporg-showcase-2022/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -406,15 +406,18 @@ function document_title( $parts ) {
$parts['title'] = sprintf( __( '%s - WordPress Showcase', 'wporg' ), $parts['title'] );
} elseif ( is_tag() ) {
// translators: %s: The name of the tag
$parts['title'] = sprintf( __( 'Sites tagged as "%s"', 'wporg' ), strtolower( $parts['title'] ) );
$parts['title'] = sprintf( __( 'Showcase sites tagged as "%s"', 'wporg' ), strtolower( $parts['title'] ) );
} elseif ( is_category() ) {
// translators: %s: The name of the tag
$parts['title'] = sprintf( __( 'Sites categorized as "%s"', 'wporg' ), strtolower( $parts['title'] ) );
$parts['title'] = sprintf( __( 'Showcase sites categorized as "%s"', 'wporg' ), strtolower( $parts['title'] ) );
} elseif ( is_author() ) {
// translators: %s: Author name
$parts['title'] = sprintf( __( 'Showcase sites by %s', 'wporg' ), $parts['title'] );
} else {
$term_names = wp_list_pluck( get_applied_filter_list(), 'name' );
if ( $term_names ) {
// translators: %s list of terms used for filtering.
$parts['title'] = sprintf( __( 'Sites filtered by: %s', 'wporg' ), implode( ', ', $term_names ) );
// translators: %s: list of terms used for filtering
$parts['title'] = sprintf( __( 'Showcase sites filtered by: %s', 'wporg' ), implode( ', ', $term_names ) );
}
}

Expand Down

0 comments on commit 68bdf02

Please sign in to comment.