Avoid repeatedly calling is_tax( 'post_format', '...' ) in get_the_archive_title().
see #21995. git-svn-id: https://develop.svn.wordpress.org/trunk@30854 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
34a2576fd6
commit
7344a29063
@ -1151,24 +1151,26 @@ function get_the_archive_title() {
|
||||
$title = sprintf( __( 'Month: %s' ), get_the_date( _x( 'F Y', 'monthly archives date format' ) ) );
|
||||
} elseif ( is_day() ) {
|
||||
$title = sprintf( __( 'Day: %s' ), get_the_date( _x( 'F j, Y', 'daily archives date format' ) ) );
|
||||
} elseif ( is_tax( 'post_format', 'post-format-aside' ) ) {
|
||||
$title = _x( 'Asides', 'post format archive title' );
|
||||
} elseif ( is_tax( 'post_format', 'post-format-gallery' ) ) {
|
||||
$title = _x( 'Galleries', 'post format archive title' );
|
||||
} elseif ( is_tax( 'post_format', 'post-format-image' ) ) {
|
||||
$title = _x( 'Images', 'post format archive title' );
|
||||
} elseif ( is_tax( 'post_format', 'post-format-video' ) ) {
|
||||
$title = _x( 'Videos', 'post format archive title' );
|
||||
} elseif ( is_tax( 'post_format', 'post-format-quote' ) ) {
|
||||
$title = _x( 'Quotes', 'post format archive title' );
|
||||
} elseif ( is_tax( 'post_format', 'post-format-link' ) ) {
|
||||
$title = _x( 'Links', 'post format archive title' );
|
||||
} elseif ( is_tax( 'post_format', 'post-format-status' ) ) {
|
||||
$title = _x( 'Statuses', 'post format archive title' );
|
||||
} elseif ( is_tax( 'post_format', 'post-format-audio' ) ) {
|
||||
$title = _x( 'Audio', 'post format archive title' );
|
||||
} elseif ( is_tax( 'post_format', 'post-format-chat' ) ) {
|
||||
$title = _x( 'Chats', 'post format archive title' );
|
||||
} elseif ( is_tax( 'post_format' ) ) {
|
||||
if ( is_tax( 'post_format', 'post-format-aside' ) ) {
|
||||
$title = _x( 'Asides', 'post format archive title' );
|
||||
} elseif ( is_tax( 'post_format', 'post-format-gallery' ) ) {
|
||||
$title = _x( 'Galleries', 'post format archive title' );
|
||||
} elseif ( is_tax( 'post_format', 'post-format-image' ) ) {
|
||||
$title = _x( 'Images', 'post format archive title' );
|
||||
} elseif ( is_tax( 'post_format', 'post-format-video' ) ) {
|
||||
$title = _x( 'Videos', 'post format archive title' );
|
||||
} elseif ( is_tax( 'post_format', 'post-format-quote' ) ) {
|
||||
$title = _x( 'Quotes', 'post format archive title' );
|
||||
} elseif ( is_tax( 'post_format', 'post-format-link' ) ) {
|
||||
$title = _x( 'Links', 'post format archive title' );
|
||||
} elseif ( is_tax( 'post_format', 'post-format-status' ) ) {
|
||||
$title = _x( 'Statuses', 'post format archive title' );
|
||||
} elseif ( is_tax( 'post_format', 'post-format-audio' ) ) {
|
||||
$title = _x( 'Audio', 'post format archive title' );
|
||||
} elseif ( is_tax( 'post_format', 'post-format-chat' ) ) {
|
||||
$title = _x( 'Chats', 'post format archive title' );
|
||||
}
|
||||
} elseif ( is_post_type_archive() ) {
|
||||
$title = sprintf( __( 'Archives: %s' ), post_type_archive_title( '', false ) );
|
||||
} elseif ( is_tax() ) {
|
||||
@ -1201,8 +1203,7 @@ function get_the_archive_title() {
|
||||
*/
|
||||
function the_archive_description( $before = '', $after = '' ) {
|
||||
$description = get_the_archive_description();
|
||||
|
||||
if ( ! empty( $description ) ) {
|
||||
if ( $description ) {
|
||||
echo $before . $description . $after;
|
||||
}
|
||||
}
|
||||
@ -1215,7 +1216,6 @@ function the_archive_description( $before = '', $after = '' ) {
|
||||
* @return string Archive description.
|
||||
*/
|
||||
function get_the_archive_description() {
|
||||
|
||||
/**
|
||||
* Filter the archive description.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user