Ticket #38545: 38545.14.diff
File 38545.14.diff, 3.5 KB (added by , 5 years ago) |
---|
-
src/wp-includes/general-template.php
1558 1558 */ 1559 1559 function get_the_archive_title() { 1560 1560 $title = __( 'Archives' ); 1561 1561 $prefix = ''; 1562 1562 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: ' ); 1565 1565 } 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: ' ); 1568 1568 } 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: ' ); 1571 1571 } 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: ' ); 1574 1574 } 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: ' ); 1577 1577 } 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: ' ); 1580 1580 } elseif ( is_tax( 'post_format' ) ) { 1581 1581 if ( is_tax( 'post_format', 'post-format-aside' ) ) { 1582 1582 $title = _x( 'Asides', 'post format archive title' ); … … 1598 1598 $title = _x( 'Chats', 'post format archive title' ); 1599 1599 } 1600 1600 } 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: ' ); 1603 1603 } elseif ( is_tax() ) { 1604 1604 $queried_object = get_queried_object(); 1605 1605 if ( $queried_object ) { 1606 1606 $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 ); 1609 1610 } 1610 1611 } 1611 1612 1612 1613 /** 1613 * Filters the archive title .1614 * Filters the archive title prefix. 1614 1615 * 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 * 1615 1626 * @since 4.1.0 1616 1627 * 1617 1628 * @param string $title Archive title to be displayed.