Avoid repeatedly checking specific post format.

Will only check for a specific post format if it’s a post format
archive page.

See https://core.trac.wordpress.org/changeset/30854
Fixes #664.
This commit is contained in:
Konstantin Obenland 2014-12-22 10:11:39 +01:00
parent 47ee126fb4
commit 37d283481f
1 changed files with 20 additions and 18 deletions

View File

@ -147,7 +147,8 @@ function the_archive_title( $before = '', $after = '' ) {
$title = sprintf( __( 'Month: %s', '_s' ), get_the_date( _x( 'F Y', 'monthly archives date format', '_s' ) ) ); $title = sprintf( __( 'Month: %s', '_s' ), get_the_date( _x( 'F Y', 'monthly archives date format', '_s' ) ) );
} elseif ( is_day() ) { } elseif ( is_day() ) {
$title = sprintf( __( 'Day: %s', '_s' ), get_the_date( _x( 'F j, Y', 'daily archives date format', '_s' ) ) ); $title = sprintf( __( 'Day: %s', '_s' ), get_the_date( _x( 'F j, Y', 'daily archives date format', '_s' ) ) );
} elseif ( is_tax( 'post_format', 'post-format-aside' ) ) { } elseif ( is_tax( 'post_format' ) ) {
if ( is_tax( 'post_format', 'post-format-aside' ) ) {
$title = _x( 'Asides', 'post format archive title', '_s' ); $title = _x( 'Asides', 'post format archive title', '_s' );
} elseif ( is_tax( 'post_format', 'post-format-gallery' ) ) { } elseif ( is_tax( 'post_format', 'post-format-gallery' ) ) {
$title = _x( 'Galleries', 'post format archive title', '_s' ); $title = _x( 'Galleries', 'post format archive title', '_s' );
@ -165,6 +166,7 @@ function the_archive_title( $before = '', $after = '' ) {
$title = _x( 'Audio', 'post format archive title', '_s' ); $title = _x( 'Audio', 'post format archive title', '_s' );
} elseif ( is_tax( 'post_format', 'post-format-chat' ) ) { } elseif ( is_tax( 'post_format', 'post-format-chat' ) ) {
$title = _x( 'Chats', 'post format archive title', '_s' ); $title = _x( 'Chats', 'post format archive title', '_s' );
}
} elseif ( is_post_type_archive() ) { } elseif ( is_post_type_archive() ) {
$title = sprintf( __( 'Archives: %s', '_s' ), post_type_archive_title( '', false ) ); $title = sprintf( __( 'Archives: %s', '_s' ), post_type_archive_title( '', false ) );
} elseif ( is_tax() ) { } elseif ( is_tax() ) {