Make WordPress Core

Ticket #38545: 38545.14.diff

File 38545.14.diff, 3.5 KB (added by Confridin, 5 years ago)

Fix 38545.13.diff file path

  • src/wp-includes/general-template.php

     
    15581558 */
    15591559function get_the_archive_title() {
    15601560        $title = __( 'Archives' );
    1561 
     1561        $prefix = '';
    15621562        if ( is_category() ) {
    1563                 /* translators: Category archive title. %s: Category name. */
    1564                 $title = sprintf( __( 'Category: %s' ), single_cat_title( '', false ) );
     1563                $title = single_cat_title( '', false );
     1564                $prefix = __( 'Category: ' );
    15651565        } elseif ( is_tag() ) {
    1566                 /* translators: Tag archive title. %s: Tag name. */
    1567                 $title = sprintf( __( 'Tag: %s' ), single_tag_title( '', false ) );
     1566                $title = single_tag_title( '', false );
     1567                $prefix = __( 'Tag: ' );
    15681568        } elseif ( is_author() ) {
    1569                 /* translators: Author archive title. %s: Author name. */
    1570                 $title = sprintf( __( 'Author: %s' ), '<span class="vcard">' . get_the_author() . '</span>' );
     1569                $title = '<span class="vcard">' . get_the_author() . '</span>';
     1570                $prefix = __( 'Author: ' );
    15711571        } elseif ( is_year() ) {
    1572                 /* translators: Yearly archive title. %s: Year. */
    1573                 $title = sprintf( __( 'Year: %s' ), get_the_date( _x( 'Y', 'yearly archives date format' ) ) );
     1572                $title = get_the_date( _x( 'Y', 'yearly archives date format' ) );
     1573                $prefix = __( 'Year: ' );
    15741574        } elseif ( is_month() ) {
    1575                 /* translators: Monthly archive title. %s: Month name and year. */
    1576                 $title = sprintf( __( 'Month: %s' ), get_the_date( _x( 'F Y', 'monthly archives date format' ) ) );
     1575                $title = get_the_date( _x( 'F Y', 'monthly archives date format' ) );
     1576                $prefix = __( 'Month: ' );
    15771577        } elseif ( is_day() ) {
    1578                 /* translators: Daily archive title. %s: Date. */
    1579                 $title = sprintf( __( 'Day: %s' ), get_the_date( _x( 'F j, Y', 'daily archives date format' ) ) );
     1578                $title = get_the_date( _x( 'F j, Y', 'daily archives date format' ) );
     1579                $prefix = __( 'Day: ' );
    15801580        } elseif ( is_tax( 'post_format' ) ) {
    15811581                if ( is_tax( 'post_format', 'post-format-aside' ) ) {
    15821582                        $title = _x( 'Asides', 'post format archive title' );
     
    15981598                        $title = _x( 'Chats', 'post format archive title' );
    15991599                }
    16001600        } elseif ( is_post_type_archive() ) {
    1601                 /* translators: Post type archive title. %s: Post type name. */
    1602                 $title = sprintf( __( 'Archives: %s' ), post_type_archive_title( '', false ) );
     1601                $title = post_type_archive_title( '', false );
     1602                $prefix = __( 'Archives: ' );
    16031603        } elseif ( is_tax() ) {
    16041604                $queried_object = get_queried_object();
    16051605                if ( $queried_object ) {
    16061606                        $tax = get_taxonomy( $queried_object->taxonomy );
    1607                         /* translators: Taxonomy term archive title. 1: Taxonomy singular name, 2: Current taxonomy term. */
    1608                         $title = sprintf( __( '%1$s: %2$s' ), $tax->labels->singular_name, single_term_title( '', false ) );
     1607                        $title = single_term_title( '', false );
     1608                        /* translators: Taxonomy term archive title. 1: Taxonomy singular name. */
     1609                        $prefix = sprintf( _x( '%1$s: ', 'Taxonomy singular name' ), $tax->labels->singular_name );
    16091610                }
    16101611        }
    16111612
    16121613        /**
    1613          * Filters the archive title.
     1614         * Filters the archive title prefix.
    16141615         *
     1616         * @since 5.5
     1617         *
     1618         * @param string $prefix Archive title prefix.
     1619        */
     1620        $prefix = apply_filters( 'get_the_archive_title_prefix', $prefix );
     1621        /* translators: archive title with prefix. 1: archive prefix, 2: archive name */
     1622        $title = sprintf( __( '%1$s%2$s' ), $prefix, $title );
     1623        /**
     1624         * Filters the archive title (with the archive title prefix).
     1625         *
    16151626         * @since 4.1.0
    16161627         *
    16171628         * @param string $title Archive title to be displayed.