Make WordPress Core


Ignore:
Timestamp:
12/15/2014 07:31:48 AM (10 years ago)
Author:
nacin
Message:

Avoid repeatedly calling is_tax( 'post_format', '...' ) in get_the_archive_title().

see #21995.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/general-template.php

    r30682 r30854  
    11521152    } elseif ( is_day() ) {
    11531153        $title = sprintf( __( 'Day: %s' ), get_the_date( _x( 'F j, Y', 'daily archives date format' ) ) );
    1154     } elseif ( is_tax( 'post_format', 'post-format-aside' ) ) {
    1155         $title = _x( 'Asides', 'post format archive title' );
    1156     } elseif ( is_tax( 'post_format', 'post-format-gallery' ) ) {
    1157         $title = _x( 'Galleries', 'post format archive title' );
    1158     } elseif ( is_tax( 'post_format', 'post-format-image' ) ) {
    1159         $title = _x( 'Images', 'post format archive title' );
    1160     } elseif ( is_tax( 'post_format', 'post-format-video' ) ) {
    1161         $title = _x( 'Videos', 'post format archive title' );
    1162     } elseif ( is_tax( 'post_format', 'post-format-quote' ) ) {
    1163         $title = _x( 'Quotes', 'post format archive title' );
    1164     } elseif ( is_tax( 'post_format', 'post-format-link' ) ) {
    1165         $title = _x( 'Links', 'post format archive title' );
    1166     } elseif ( is_tax( 'post_format', 'post-format-status' ) ) {
    1167         $title = _x( 'Statuses', 'post format archive title' );
    1168     } elseif ( is_tax( 'post_format', 'post-format-audio' ) ) {
    1169         $title = _x( 'Audio', 'post format archive title' );
    1170     } elseif ( is_tax( 'post_format', 'post-format-chat' ) ) {
    1171         $title = _x( 'Chats', 'post format archive title' );
     1154    } elseif ( is_tax( 'post_format' ) ) {
     1155        if ( is_tax( 'post_format', 'post-format-aside' ) ) {
     1156            $title = _x( 'Asides', 'post format archive title' );
     1157        } elseif ( is_tax( 'post_format', 'post-format-gallery' ) ) {
     1158            $title = _x( 'Galleries', 'post format archive title' );
     1159        } elseif ( is_tax( 'post_format', 'post-format-image' ) ) {
     1160            $title = _x( 'Images', 'post format archive title' );
     1161        } elseif ( is_tax( 'post_format', 'post-format-video' ) ) {
     1162            $title = _x( 'Videos', 'post format archive title' );
     1163        } elseif ( is_tax( 'post_format', 'post-format-quote' ) ) {
     1164            $title = _x( 'Quotes', 'post format archive title' );
     1165        } elseif ( is_tax( 'post_format', 'post-format-link' ) ) {
     1166            $title = _x( 'Links', 'post format archive title' );
     1167        } elseif ( is_tax( 'post_format', 'post-format-status' ) ) {
     1168            $title = _x( 'Statuses', 'post format archive title' );
     1169        } elseif ( is_tax( 'post_format', 'post-format-audio' ) ) {
     1170            $title = _x( 'Audio', 'post format archive title' );
     1171        } elseif ( is_tax( 'post_format', 'post-format-chat' ) ) {
     1172            $title = _x( 'Chats', 'post format archive title' );
     1173        }
    11721174    } elseif ( is_post_type_archive() ) {
    11731175        $title = sprintf( __( 'Archives: %s' ), post_type_archive_title( '', false ) );
     
    12021204function the_archive_description( $before = '', $after = '' ) {
    12031205    $description = get_the_archive_description();
    1204 
    1205     if ( ! empty( $description ) ) {
     1206    if ( $description ) {
    12061207        echo $before . $description . $after;
    12071208    }
     
    12161217 */
    12171218function get_the_archive_description() {
    1218 
    12191219    /**
    12201220     * Filter the archive description.
Note: See TracChangeset for help on using the changeset viewer.