Make WordPress Core

Ticket #39733: 39733.2021092000.patch

File 39733.2021092000.patch, 16.0 KB (added by rsiddharth, 2 years ago)

Version 2021092000

  • src/wp-admin/includes/class-wp-media-list-table.php

     
    633633                                                esc_html( sanitize_term_field( 'name', $t->name, $t->term_id, $taxonomy, 'display' ) )
    634634                                        );
    635635                                }
    636                                 /* translators: Used between list items, there is a space after the comma. */
    637                                 echo implode( __( ', ' ), $out );
     636                                echo implode( wp_get_list_item_separator(), $out );
    638637                        } else {
    639638                                echo '<span aria-hidden="true">&#8212;</span><span class="screen-reader-text">' . get_taxonomy( $taxonomy )->labels->no_terms . '</span>';
    640639                        }
  • src/wp-admin/includes/class-wp-posts-list-table.php

     
    12941294                                 */
    12951295                                $term_links = apply_filters( 'post_column_taxonomy_links', $term_links, $taxonomy, $terms );
    12961296
    1297                                 /* translators: Used between list items, there is a space after the comma. */
    1298                                 echo implode( __( ', ' ), $term_links );
     1297                                echo implode( wp_get_list_item_separator(), $term_links );
    12991298                        } else {
    13001299                                echo '<span aria-hidden="true">&#8212;</span><span class="screen-reader-text">' . $taxonomy_object->labels->no_terms . '</span>';
    13011300                        }
  • src/wp-content/themes/twentyeleven/content-featured.php

     
    3232
    3333        <footer class="entry-meta">
    3434                <?php
    35                 /* translators: Used between list items, there is a space after the comma. */
    36                 $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
     35                $tags_list = get_the_tag_list( '', wp_get_list_item_separator() );
    3736
    3837                if ( $tags_list && ! is_wp_error( $tags_list ) ) {
    3938                        /* translators: 1: Category list, 2: Tag list, 3: Post permalink, 4: Post title. */
     
    4544
    4645                printf(
    4746                        $utility_text,
    48                         /* translators: Used between list items, there is a space after the comma. */
    49                         get_the_category_list( __( ', ', 'twentyeleven' ) ),
     47                        get_the_category_list( wp_get_list_item_separator() ),
    5048                        $tags_list,
    5149                        esc_url( get_permalink() ),
    5250                        the_title_attribute( 'echo=0' )
  • src/wp-content/themes/twentyeleven/content-gallery.php

     
    7272                <?php $show_sep = false; ?>
    7373
    7474                <?php
    75                 /* translators: Used between list items, there is a space after the comma. */
    76                 $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
     75                $categories_list = get_the_category_list( wp_get_list_item_separator() );
    7776
    7877                if ( $categories_list ) :
    7978                        ?>
     
    8786                <?php endif; // End if categories. ?>
    8887
    8988                <?php
    90                 /* translators: Used between list items, there is a space after the comma. */
    91                 $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
     89                $tags_list = get_the_tag_list( '', wp_get_list_item_separator() );
    9290
    9391                if ( $tags_list && ! is_wp_error( $tags_list ) ) :
    9492                        if ( $show_sep ) :
  • src/wp-content/themes/twentyeleven/content-image.php

     
    5555                        </div><!-- .entry-meta -->
    5656                        <div class="entry-meta">
    5757                                <?php
    58                                 /* translators: Used between list items, there is a space after the comma. */
    59                                 $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
     58                                $categories_list = get_the_category_list( wp_get_list_item_separator() );
    6059
    6160                                if ( $categories_list ) :
    6261                                        ?>
     
    6968                                <?php endif; // End if categories. ?>
    7069
    7170                                <?php
    72                                 /* translators: Used between list items, there is a space after the comma. */
    73                                 $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
     71                                $tags_list = get_the_tag_list( '', wp_get_list_item_separator() );
    7472
    7573                                if ( $tags_list && ! is_wp_error( $tags_list ) ) :
    7674                                        ?>
  • src/wp-content/themes/twentyeleven/content-quote.php

     
    4848                        <?php $show_sep = false; ?>
    4949
    5050                        <?php
    51                         /* translators: Used between list items, there is a space after the comma. */
    52                         $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
     51                        $categories_list = get_the_category_list( wp_get_list_item_separator() );
    5352
    5453                        if ( $categories_list ) :
    5554                                ?>
     
    6463
    6564                        <?php
    6665                        /* translators: Used between list items, there is a space after the comma. */
    67                         $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
     66                        $tags_list = get_the_tag_list( '', wp_get_list_item_separator() );
    6867
    6968                        if ( $tags_list && ! is_wp_error( $tags_list ) ) :
    7069                                if ( $show_sep ) :
  • src/wp-content/themes/twentyeleven/content-single.php

     
    3333
    3434        <footer class="entry-meta">
    3535                <?php
    36                 /* translators: Used between list items, there is a space after the comma. */
    37                 $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
     36                $categories_list = get_the_category_list( wp_get_list_item_separator() );
    3837
    39                 /* translators: Used between list items, there is a space after the comma. */
    40                 $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
     38                $tags_list = get_the_tag_list( '', wp_get_list_item_separator() );
    4139
    4240                if ( $tags_list && ! is_wp_error( $tags_list ) ) {
    4341                        /* translators: 1: Categories list, 2: Tag list, 3: Permalink, 4: Post title, 5: Author name, 6: Author URL. */
  • src/wp-content/themes/twentyeleven/content.php

     
    5555
    5656                        <?php if ( is_object_in_taxonomy( get_post_type(), 'category' ) ) : // Hide category text when not supported. ?>
    5757                                <?php
    58                                 /* translators: Used between list items, there is a space after the comma. */
    59                                 $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
     58                                $categories_list = get_the_category_list( wp_get_list_item_separator() );
    6059
    6160                                if ( $categories_list ) :
    6261                                        ?>
     
    7271
    7372                        <?php if ( is_object_in_taxonomy( get_post_type(), 'post_tag' ) ) : // Hide tag text when not supported. ?>
    7473                                <?php
    75                                 /* translators: Used between list items, there is a space after the comma. */
    76                                 $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
     74                                $tags_list = get_the_tag_list( '', wp_get_list_item_separator() );
    7775
    7876                                if ( $tags_list && ! is_wp_error( $tags_list ) ) :
    7977                                        if ( $show_sep ) :
  • src/wp-content/themes/twentyeleven/functions.php

     
    929929        }
    930930}
    931931add_action( 'wp_body_open', 'twentyeleven_skip_link', 5 );
     932
     933if ( ! function_exists( 'wp_get_list_item_separator' ) ) :
     934        /**
     935         * Retrieve the list item separator based on the locale.
     936         *
     937         * Added for backward compatibility to support pre-5.9.0 WordPress versions.
     938         *
     939         * @since 5.9.0
     940         */
     941        function wp_get_list_item_separator() {
     942                return __( ', ', 'twentyeleven' );
     943        }
     944endif;
  • src/wp-content/themes/twentynineteen/inc/template-tags.php

     
    8282                        // Posted on.
    8383                        twentynineteen_posted_on();
    8484
    85                         /* translators: Used between list items, there is a space after the comma. */
    86                         $categories_list = get_the_category_list( __( ', ', 'twentynineteen' ) );
     85                        $categories_list = get_the_category_list( wp_get_list_item_separator() );
    8786                        if ( $categories_list ) {
    8887                                printf(
    8988                                        /* translators: 1: SVG icon. 2: Posted in label, only visible to screen readers. 3: List of categories. */
     
    9493                                ); // WPCS: XSS OK.
    9594                        }
    9695
    97                         /* translators: Used between list items, there is a space after the comma. */
    98                         $tags_list = get_the_tag_list( '', __( ', ', 'twentynineteen' ) );
     96                        $tags_list = get_the_tag_list( '', wp_get_list_item_separator() );
    9997                        if ( $tags_list && ! is_wp_error( $tags_list ) ) {
    10098                                printf(
    10199                                        /* translators: 1: SVG icon. 2: Posted in label, only visible to screen readers. 3: List of tags. */
  • src/wp-content/themes/twentyseventeen/inc/template-tags.php

     
    6262         */
    6363        function twentyseventeen_entry_footer() {
    6464
    65                 /* translators: Used between list items, there is a space after the comma. */
    66                 $separate_meta = __( ', ', 'twentyseventeen' );
     65                $separate_meta = wp_get_list_item_separator();
    6766
    6867                // Get Categories for posts.
    6968                $categories_list = get_the_category_list( $separate_meta );
  • src/wp-content/themes/twentythirteen/functions.php

     
    490490                        twentythirteen_entry_date();
    491491                }
    492492
    493                 /* translators: Used between list items, there is a space after the comma. */
    494                 $categories_list = get_the_category_list( __( ', ', 'twentythirteen' ) );
     493                $categories_list = get_the_category_list( wp_get_list_item_separator() );
    495494                if ( $categories_list ) {
    496495                        echo '<span class="categories-links">' . $categories_list . '</span>';
    497496                }
    498497
    499                 /* translators: Used between list items, there is a space after the comma. */
    500                 $tags_list = get_the_tag_list( '', __( ', ', 'twentythirteen' ) );
     498                $tags_list = get_the_tag_list( '', wp_get_list_item_separator() );
    501499                if ( $tags_list && ! is_wp_error( $tags_list ) ) {
    502500                        echo '<span class="tags-links">' . $tags_list . '</span>';
    503501                }
  • src/wp-content/themes/twentytwelve/functions.php

     
    502502         * @since Twenty Twelve 1.0
    503503         */
    504504        function twentytwelve_entry_meta() {
    505                 /* translators: Used between list items, there is a space after the comma. */
    506                 $categories_list = get_the_category_list( __( ', ', 'twentytwelve' ) );
     505                $categories_list = get_the_category_list( wp_get_list_item_separator() );
    507506
    508                 /* translators: Used between list items, there is a space after the comma. */
    509                 $tags_list = get_the_tag_list( '', __( ', ', 'twentytwelve' ) );
     507                $tags_list = get_the_tag_list( '', wp_get_list_item_separator() );
    510508
    511509                $date = sprintf(
    512510                        '<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>',
  • src/wp-content/themes/twentytwentyone/inc/template-tags.php

     
    100100
    101101                                echo '<div class="post-taxonomies">';
    102102
    103                                 /* translators: Used between list items, there is a space after the comma. */
    104                                 $categories_list = get_the_category_list( __( ', ', 'twentytwentyone' ) );
     103                                $categories_list = get_the_category_list( wp_get_list_item_separator() );
    105104                                if ( $categories_list ) {
    106105                                        printf(
    107106                                                /* translators: %s: List of categories. */
     
    110109                                        );
    111110                                }
    112111
    113                                 /* translators: Used between list items, there is a space after the comma. */
    114                                 $tags_list = get_the_tag_list( '', __( ', ', 'twentytwentyone' ) );
     112                                $tags_list = get_the_tag_list( '', wp_get_list_item_separator() );
    115113                                if ( $tags_list ) {
    116114                                        printf(
    117115                                                /* translators: %s: List of tags. */
     
    144142
    145143                                echo '<div class="post-taxonomies">';
    146144
    147                                 /* translators: Used between list items, there is a space after the comma. */
    148                                 $categories_list = get_the_category_list( __( ', ', 'twentytwentyone' ) );
     145                                $categories_list = get_the_category_list( wp_get_list_item_separator() );
    149146                                if ( $categories_list ) {
    150147                                        printf(
    151148                                                /* translators: %s: List of categories. */
     
    154151                                        );
    155152                                }
    156153
    157                                 /* translators: Used between list items, there is a space after the comma. */
    158                                 $tags_list = get_the_tag_list( '', __( ', ', 'twentytwentyone' ) );
     154                                $tags_list = get_the_tag_list( '', wp_get_list_item_separator() );
    159155                                if ( $tags_list ) {
    160156                                        printf(
    161157                                                /* translators: %s: List of tags. */
  • src/wp-includes/class-wp-locale.php

     
    9696        public $number_format;
    9797
    9898        /**
     99         * The separator string used for localizing list item separator.
     100         *
     101         * @since 5.9.0
     102         * @var string
     103         */
     104        public $list_item_separator;
     105
     106        /**
    99107         * Constructor which calls helper methods to set up object variables.
    100108         *
    101109         * @since 2.1.0
     
    209217
    210218                $this->number_format['decimal_point'] = ( 'number_format_decimal_point' === $decimal_point ) ? '.' : $decimal_point;
    211219
     220                /* translators: used between list items, there is a space after the comma */
     221                $this->list_item_separator = __( ', ' );
     222
    212223                // Set text direction.
    213224                if ( isset( $GLOBALS['text_direction'] ) ) {
    214225                        $this->text_direction = $GLOBALS['text_direction'];
     
    366377                /* translators: Localized date and time format, see https://www.php.net/manual/datetime.format.php */
    367378                __( 'F j, Y g:i a' );
    368379        }
     380
     381        /**
     382         * Retrieve the localized list item separator.
     383         *
     384         * @since 5.9.0
     385         *
     386         * @return string Localized list item separator.
     387         */
     388        public function get_list_item_separator() {
     389                return $this->list_item_separator;
     390        }
    369391}
  • src/wp-includes/class-wp-theme.php

     
    923923                        case 'Tags':
    924924                                static $comma = null;
    925925                                if ( ! isset( $comma ) ) {
    926                                         /* translators: Used between list items, there is a space after the comma. */
    927                                         $comma = __( ', ' );
     926                                        $comma = wp_get_list_item_separator();
    928927                                }
    929928                                $value = implode( $comma, $value );
    930929                                break;
  • src/wp-includes/functions.php

     
    82818281function wp_fuzzy_number_match( $expected, $actual, $precision = 1 ) {
    82828282        return abs( (float) $expected - (float) $actual ) <= $precision;
    82838283}
     8284
     8285/**
     8286 * Retrieve the list item separator based on the locale.
     8287 *
     8288 * @since 5.9.0
     8289 *
     8290 * @global WP_Locale $wp_locale WordPress date and time locale object.
     8291 *
     8292 * @return string Locale specific list item separator.
     8293 */
     8294function wp_get_list_item_separator() {
     8295        global $wp_locale;
     8296        return $wp_locale->get_list_item_separator();
     8297}