Make WordPress Core

Ticket #38545: 38545.15.diff

File 38545.15.diff, 3.4 KB (added by audrasjb, 5 years ago)

Patch refresh for WP 5.5

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

    diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php
    index 46e585df12..6ec6825306 100644
    a b function the_archive_title( $before = '', $after = '' ) { 
    15971597 */
    15981598function get_the_archive_title() {
    15991599        $title = __( 'Archives' );
     1600        $prefix = '';
    16001601
    16011602        if ( is_category() ) {
    1602                 /* translators: Category archive title. %s: Category name. */
    1603                 $title = sprintf( __( 'Category: %s' ), single_cat_title( '', false ) );
     1603                $title  = single_cat_title( '', false );
     1604                $prefix = __( 'Category:' );
    16041605        } elseif ( is_tag() ) {
    1605                 /* translators: Tag archive title. %s: Tag name. */
    1606                 $title = sprintf( __( 'Tag: %s' ), single_tag_title( '', false ) );
     1606                $title  = single_tag_title( '', false );
     1607                $prefix = __( 'Tag:' );
    16071608        } elseif ( is_author() ) {
    1608                 /* translators: Author archive title. %s: Author name. */
    1609                 $title = sprintf( __( 'Author: %s' ), '<span class="vcard">' . get_the_author() . '</span>' );
     1609                $title  = '<span class="vcard">' . get_the_author() . '</span>';
     1610                $prefix = __( 'Author:' );
    16101611        } elseif ( is_year() ) {
    1611                 /* translators: Yearly archive title. %s: Year. */
    1612                 $title = sprintf( __( 'Year: %s' ), get_the_date( _x( 'Y', 'yearly archives date format' ) ) );
     1612                $title  = get_the_date( _x( 'Y', 'Yearly archives date format' ) );
     1613                $prefix = __( 'Year:' );
    16131614        } elseif ( is_month() ) {
    1614                 /* translators: Monthly archive title. %s: Month name and year. */
    1615                 $title = sprintf( __( 'Month: %s' ), get_the_date( _x( 'F Y', 'monthly archives date format' ) ) );
     1615                $title  = get_the_date( _x( 'F Y', 'Monthly archives date format' ) );
     1616                $prefix = __( 'Month:' );
    16161617        } elseif ( is_day() ) {
    1617                 /* translators: Daily archive title. %s: Date. */
    1618                 $title = sprintf( __( 'Day: %s' ), get_the_date( _x( 'F j, Y', 'daily archives date format' ) ) );
     1618                $title = get_the_date( _x( 'F j, Y', 'Daily archives date format' ) );
     1619                $prefix = __( 'Day:' );
    16191620        } elseif ( is_tax( 'post_format' ) ) {
    16201621                if ( is_tax( 'post_format', 'post-format-aside' ) ) {
    16211622                        $title = _x( 'Asides', 'post format archive title' );
    function get_the_archive_title() { 
    16371638                        $title = _x( 'Chats', 'post format archive title' );
    16381639                }
    16391640        } elseif ( is_post_type_archive() ) {
    1640                 /* translators: Post type archive title. %s: Post type name. */
    1641                 $title = sprintf( __( 'Archives: %s' ), post_type_archive_title( '', false ) );
     1641                $title = post_type_archive_title( '', false );
     1642                $prefix = __( 'Archives:' );
    16421643        } elseif ( is_tax() ) {
    16431644                $queried_object = get_queried_object();
    16441645                if ( $queried_object ) {
    16451646                        $tax = get_taxonomy( $queried_object->taxonomy );
    1646                         /* translators: Taxonomy term archive title. 1: Taxonomy singular name, 2: Current taxonomy term. */
    1647                         $title = sprintf( __( '%1$s: %2$s' ), $tax->labels->singular_name, single_term_title( '', false ) );
     1647                        $title = single_term_title( '', false );
     1648                        /* translators: Taxonomy singular name. */
     1649                        $prefix = sprintf( __( '%s:' ), $tax->labels->singular_name );
    16481650                }
    16491651        }
    16501652
     1653        /**
     1654         * Filters the archive title prefix.
     1655         *
     1656         * @since 5.5.0
     1657         *
     1658         * @param string $prefix Archive title prefix.
     1659         */
     1660        $prefix = apply_filters( 'get_the_archive_title_prefix', $prefix );
     1661        /* translators: 1: Archive prefix. 2: Archive name. */
     1662        $title = sprintf( __( '%1$s %2$s' ), $prefix, $title );
     1663
    16511664        /**
    16521665         * Filters the archive title.
    16531666         *