Ticket #39733: 39733.2021091800.patch
| File 39733.2021091800.patch, 19.9 KB (added by , 4 years ago) |
|---|
-
src/wp-admin/includes/class-wp-media-list-table.php
600 600 * @since 4.3.0 601 601 * @since 5.9.0 Renamed `$post` to `$item` to match parent class for PHP 8 named parameter support. 602 602 * 603 * @global WP_Locale $wp_locale WordPress date and time locale object. 604 * 603 605 * @param WP_Post $item The current WP_Post object. 604 606 * @param string $column_name Current column name. 605 607 */ 606 608 public function column_default( $item, $column_name ) { 609 global $wp_locale; 610 607 611 // Restores the more descriptive, specific name for use within this method. 608 612 $post = $item; 609 613 … … 633 637 esc_html( sanitize_term_field( 'name', $t->name, $t->term_id, $taxonomy, 'display' ) ) 634 638 ); 635 639 } 636 /* translators: Used between list items, there is a space after the comma. */ 637 echo implode( __( ', ' ), $out ); 640 echo implode( $wp_locale->get_list_item_separator(), $out ); 638 641 } else { 639 642 echo '<span aria-hidden="true">—</span><span class="screen-reader-text">' . get_taxonomy( $taxonomy )->labels->no_terms . '</span>'; 640 643 } -
src/wp-admin/includes/class-wp-posts-list-table.php
1240 1240 * @since 4.3.0 1241 1241 * @since 5.9.0 Renamed `$post` to `$item` to match parent class for PHP 8 named parameter support. 1242 1242 * 1243 * @global WP_Locale $wp_locale WordPress date and time locale object. 1244 * 1243 1245 * @param WP_Post $item The current WP_Post object. 1244 1246 * @param string $column_name The current column name. 1245 1247 */ 1246 1248 public function column_default( $item, $column_name ) { 1249 global $wp_locale; 1250 1247 1251 // Restores the more descriptive, specific name for use within this method. 1248 1252 $post = $item; 1249 1253 … … 1294 1298 */ 1295 1299 $term_links = apply_filters( 'post_column_taxonomy_links', $term_links, $taxonomy, $terms ); 1296 1300 1297 /* translators: Used between list items, there is a space after the comma. */ 1298 echo implode( __( ', ' ), $term_links ); 1301 echo implode( $wp_locale->get_list_item_separator(), $term_links ); 1299 1302 } else { 1300 1303 echo '<span aria-hidden="true">—</span><span class="screen-reader-text">' . $taxonomy_object->labels->no_terms . '</span>'; 1301 1304 } -
src/wp-content/themes/twentyeleven/content-featured.php
5 5 * @package WordPress 6 6 * @subpackage Twenty_Eleven 7 7 * @since Twenty Eleven 1.0 8 * 9 * @global WP_Locale $wp_locale WordPress date and time locale object. 8 10 */ 9 11 10 global $feature_class ;12 global $feature_class, $wp_locale; 11 13 ?> 12 14 <article id="post-<?php the_ID(); ?>" <?php post_class( $feature_class ); ?>> 13 15 <header class="entry-header"> … … 32 34 33 35 <footer class="entry-meta"> 34 36 <?php 35 /* translators: Used between list items, there is a space after the comma. */ 36 $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) ); 37 $tags_list = get_the_tag_list( '', $wp_locale->get_list_item_separator() ); 37 38 38 39 if ( $tags_list && ! is_wp_error( $tags_list ) ) { 39 40 /* translators: 1: Category list, 2: Tag list, 3: Post permalink, 4: Post title. */ … … 45 46 46 47 printf( 47 48 $utility_text, 48 /* translators: Used between list items, there is a space after the comma. */ 49 get_the_category_list( __( ', ', 'twentyeleven' ) ), 49 get_the_category_list( $wp_locale->get_list_item_separator() ), 50 50 $tags_list, 51 51 esc_url( get_permalink() ), 52 52 the_title_attribute( 'echo=0' ) -
src/wp-content/themes/twentyeleven/content-gallery.php
9 9 * @package WordPress 10 10 * @subpackage Twenty_Eleven 11 11 * @since Twenty Eleven 1.0 12 * 13 * @global WP_Locale $wp_locale WordPress date and time locale object. 12 14 */ 15 16 global $wp_locale; 13 17 ?> 14 18 15 19 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> … … 72 76 <?php $show_sep = false; ?> 73 77 74 78 <?php 75 /* translators: Used between list items, there is a space after the comma. */ 76 $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) ); 79 $categories_list = get_the_category_list( $wp_locale->get_list_item_separator() ); 77 80 78 81 if ( $categories_list ) : 79 82 ?> … … 87 90 <?php endif; // End if categories. ?> 88 91 89 92 <?php 90 /* translators: Used between list items, there is a space after the comma. */ 91 $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) ); 93 $tags_list = get_the_tag_list( '', $wp_locale->get_list_item_separator() ); 92 94 93 95 if ( $tags_list && ! is_wp_error( $tags_list ) ) : 94 96 if ( $show_sep ) : -
src/wp-content/themes/twentyeleven/content-image.php
9 9 * @package WordPress 10 10 * @subpackage Twenty_Eleven 11 11 * @since Twenty Eleven 1.0 12 * 13 * @global WP_Locale $wp_locale WordPress date and time locale object. 12 14 */ 15 16 global $wp_locale; 13 17 ?> 14 18 <article id="post-<?php the_ID(); ?>" <?php post_class( 'indexed' ); ?>> 15 19 <header class="entry-header"> … … 55 59 </div><!-- .entry-meta --> 56 60 <div class="entry-meta"> 57 61 <?php 58 /* translators: Used between list items, there is a space after the comma. */ 59 $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) ); 62 $categories_list = get_the_category_list( $wp_locale->get_list_item_separator() ); 60 63 61 64 if ( $categories_list ) : 62 65 ?> … … 69 72 <?php endif; // End if categories. ?> 70 73 71 74 <?php 72 /* translators: Used between list items, there is a space after the comma. */ 73 $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) ); 75 $tags_list = get_the_tag_list( '', $wp_locale->get_list_item_separator() ); 74 76 75 77 if ( $tags_list && ! is_wp_error( $tags_list ) ) : 76 78 ?> -
src/wp-content/themes/twentyeleven/content-quote.php
5 5 * @package WordPress 6 6 * @subpackage Twenty_Eleven 7 7 * @since Twenty Eleven 1.0 8 * 9 * @global WP_Locale $wp_locale WordPress date and time locale object. 8 10 */ 11 12 global $wp_locale; 9 13 ?> 10 14 11 15 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> … … 48 52 <?php $show_sep = false; ?> 49 53 50 54 <?php 51 /* translators: Used between list items, there is a space after the comma. */ 52 $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) ); 55 $categories_list = get_the_category_list( $wp_locale->get_list_item_separator() ); 53 56 54 57 if ( $categories_list ) : 55 58 ?> … … 64 67 65 68 <?php 66 69 /* translators: Used between list items, there is a space after the comma. */ 67 $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven') );70 $tags_list = get_the_tag_list( '', $wp_locale->get_list_item_separator() ); 68 71 69 72 if ( $tags_list && ! is_wp_error( $tags_list ) ) : 70 73 if ( $show_sep ) : -
src/wp-content/themes/twentyeleven/content-single.php
5 5 * @package WordPress 6 6 * @subpackage Twenty_Eleven 7 7 * @since Twenty Eleven 1.0 8 * 9 * @global WP_Locale $wp_locale WordPress date and time locale object. 8 10 */ 11 12 global $wp_locale; 9 13 ?> 10 14 11 15 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> … … 33 37 34 38 <footer class="entry-meta"> 35 39 <?php 36 /* translators: Used between list items, there is a space after the comma. */ 37 $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) ); 40 $categories_list = get_the_category_list( $wp_locale->get_list_item_separator() ); 38 41 39 /* translators: Used between list items, there is a space after the comma. */ 40 $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) ); 42 $tags_list = get_the_tag_list( '', $wp_locale->get_list_item_separator() ); 41 43 42 44 if ( $tags_list && ! is_wp_error( $tags_list ) ) { 43 45 /* 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
5 5 * @package WordPress 6 6 * @subpackage Twenty_Eleven 7 7 * @since Twenty Eleven 1.0 8 * 9 * @global WP_Locale $wp_locale WordPress date and time locale object. 8 10 */ 11 12 global $wp_locale; 9 13 ?> 10 14 11 15 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> … … 55 59 56 60 <?php if ( is_object_in_taxonomy( get_post_type(), 'category' ) ) : // Hide category text when not supported. ?> 57 61 <?php 58 /* translators: Used between list items, there is a space after the comma. */ 59 $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) ); 62 $categories_list = get_the_category_list( $wp_locale->get_list_item_separator() ); 60 63 61 64 if ( $categories_list ) : 62 65 ?> … … 72 75 73 76 <?php if ( is_object_in_taxonomy( get_post_type(), 'post_tag' ) ) : // Hide tag text when not supported. ?> 74 77 <?php 75 /* translators: Used between list items, there is a space after the comma. */ 76 $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) ); 78 $tags_list = get_the_tag_list( '', $wp_locale->get_list_item_separator() ); 77 79 78 80 if ( $tags_list && ! is_wp_error( $tags_list ) ) : 79 81 if ( $show_sep ) : -
src/wp-content/themes/twentynineteen/inc/template-tags.php
70 70 if ( ! function_exists( 'twentynineteen_entry_footer' ) ) : 71 71 /** 72 72 * Prints HTML with meta information for the categories, tags and comments. 73 * 74 * @global WP_Locale $wp_locale WordPress date and time locale object. 73 75 */ 74 76 function twentynineteen_entry_footer() { 77 global $wp_locale; 75 78 76 79 // Hide author, post date, category and tag text for pages. 77 80 if ( 'post' === get_post_type() ) { … … 82 85 // Posted on. 83 86 twentynineteen_posted_on(); 84 87 85 /* translators: Used between list items, there is a space after the comma. */ 86 $categories_list = get_the_category_list( __( ', ', 'twentynineteen' ) ); 88 $categories_list = get_the_category_list( $wp_locale->get_list_item_separator() ); 87 89 if ( $categories_list ) { 88 90 printf( 89 91 /* translators: 1: SVG icon. 2: Posted in label, only visible to screen readers. 3: List of categories. */ … … 94 96 ); // WPCS: XSS OK. 95 97 } 96 98 97 /* translators: Used between list items, there is a space after the comma. */ 98 $tags_list = get_the_tag_list( '', __( ', ', 'twentynineteen' ) ); 99 $tags_list = get_the_tag_list( '', $wp_locale->get_list_item_separator() ); 99 100 if ( $tags_list && ! is_wp_error( $tags_list ) ) { 100 101 printf( 101 102 /* 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
59 59 if ( ! function_exists( 'twentyseventeen_entry_footer' ) ) : 60 60 /** 61 61 * Prints HTML with meta information for the categories, tags and comments. 62 * 63 * @global WP_Locale $wp_locale WordPress date and time locale object. 62 64 */ 63 65 function twentyseventeen_entry_footer() { 66 global $wp_locale; 64 67 65 /* translators: Used between list items, there is a space after the comma. */ 66 $separate_meta = __( ', ', 'twentyseventeen' ); 68 $separate_meta = $wp_locale->get_list_item_separator(); 67 69 68 70 // Get Categories for posts. 69 71 $categories_list = get_the_category_list( $separate_meta ); -
src/wp-content/themes/twentythirteen/functions.php
480 480 * Create your own twentythirteen_entry_meta() to override in a child theme. 481 481 * 482 482 * @since Twenty Thirteen 1.0 483 * 484 * @global WP_Locale $wp_locale WordPress date and time locale object. 483 485 */ 484 486 function twentythirteen_entry_meta() { 487 global $wp_locale; 488 485 489 if ( is_sticky() && is_home() && ! is_paged() ) { 486 490 echo '<span class="featured-post">' . esc_html__( 'Sticky', 'twentythirteen' ) . '</span>'; 487 491 } … … 490 494 twentythirteen_entry_date(); 491 495 } 492 496 493 /* translators: Used between list items, there is a space after the comma. */ 494 $categories_list = get_the_category_list( __( ', ', 'twentythirteen' ) ); 497 $categories_list = get_the_category_list( $wp_locale->get_list_item_separator() ); 495 498 if ( $categories_list ) { 496 499 echo '<span class="categories-links">' . $categories_list . '</span>'; 497 500 } 498 501 499 /* translators: Used between list items, there is a space after the comma. */ 500 $tags_list = get_the_tag_list( '', __( ', ', 'twentythirteen' ) ); 502 $tags_list = get_the_tag_list( '', $wp_locale->get_list_item_separator() ); 501 503 if ( $tags_list && ! is_wp_error( $tags_list ) ) { 502 504 echo '<span class="tags-links">' . $tags_list . '</span>'; 503 505 } -
src/wp-content/themes/twentytwelve/functions.php
500 500 * Create your own twentytwelve_entry_meta() to override in a child theme. 501 501 * 502 502 * @since Twenty Twelve 1.0 503 * 504 * @global WP_Locale $wp_locale WordPress date and time locale object. 503 505 */ 504 506 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' ) ); 507 global $wp_locale; 507 508 508 /* translators: Used between list items, there is a space after the comma. */ 509 $tags_list = get_the_tag_list( '', __( ', ', 'twentytwelve' ) ); 509 $categories_list = get_the_category_list( $wp_locale->get_list_item_separator() ); 510 510 511 $tags_list = get_the_tag_list( '', $wp_locale->get_list_item_separator() ); 512 511 513 $date = sprintf( 512 514 '<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>', 513 515 esc_url( get_permalink() ), -
src/wp-content/themes/twentytwentyone/inc/template-tags.php
61 61 * 62 62 * @since Twenty Twenty-One 1.0 63 63 * 64 * @global WP_Locale $wp_locale WordPress date and time locale object. 65 * 64 66 * @return void 65 67 */ 66 68 function twenty_twenty_one_entry_meta_footer() { 69 global $wp_locale; 67 70 68 71 // Early exit if not a post. 69 72 if ( 'post' !== get_post_type() ) { … … 100 103 101 104 echo '<div class="post-taxonomies">'; 102 105 103 /* translators: Used between list items, there is a space after the comma. */ 104 $categories_list = get_the_category_list( __( ', ', 'twentytwentyone' ) ); 106 $categories_list = get_the_category_list( $wp_locale->get_list_item_separator() ); 105 107 if ( $categories_list ) { 106 108 printf( 107 109 /* translators: %s: List of categories. */ … … 110 112 ); 111 113 } 112 114 113 /* translators: Used between list items, there is a space after the comma. */ 114 $tags_list = get_the_tag_list( '', __( ', ', 'twentytwentyone' ) ); 115 $tags_list = get_the_tag_list( '', $wp_locale->get_list_item_separator() ); 115 116 if ( $tags_list ) { 116 117 printf( 117 118 /* translators: %s: List of tags. */ … … 144 145 145 146 echo '<div class="post-taxonomies">'; 146 147 147 /* translators: Used between list items, there is a space after the comma. */ 148 $categories_list = get_the_category_list( __( ', ', 'twentytwentyone' ) ); 148 $categories_list = get_the_category_list( $wp_locale->get_list_item_separator() ); 149 149 if ( $categories_list ) { 150 150 printf( 151 151 /* translators: %s: List of categories. */ … … 154 154 ); 155 155 } 156 156 157 /* translators: Used between list items, there is a space after the comma. */ 158 $tags_list = get_the_tag_list( '', __( ', ', 'twentytwentyone' ) ); 157 $tags_list = get_the_tag_list( '', $wp_locale->get_list_item_separator() ); 159 158 if ( $tags_list ) { 160 159 printf( 161 160 /* translators: %s: List of tags. */ -
src/wp-includes/class-wp-locale.php
96 96 public $number_format; 97 97 98 98 /** 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 /** 99 107 * Constructor which calls helper methods to set up object variables. 100 108 * 101 109 * @since 2.1.0 … … 209 217 210 218 $this->number_format['decimal_point'] = ( 'number_format_decimal_point' === $decimal_point ) ? '.' : $decimal_point; 211 219 220 /* translators: used between list items, there is a space after the comma */ 221 $this->list_item_separator = __( ', ' ); 222 212 223 // Set text direction. 213 224 if ( isset( $GLOBALS['text_direction'] ) ) { 214 225 $this->text_direction = $GLOBALS['text_direction']; … … 366 377 /* translators: Localized date and time format, see https://www.php.net/manual/datetime.format.php */ 367 378 __( 'F j, Y g:i a' ); 368 379 } 380 381 /** 382 * Retrieve the localized list item separator. 383 * 384 * @since 5.9.0 385 * 386 * @return Translated list item separator. 387 */ 388 public function get_list_item_separator() { 389 return $this->list_item_separator; 390 } 369 391 } -
src/wp-includes/class-wp-theme.php
898 898 * 899 899 * @since 3.4.0 900 900 * 901 * @global WP_Locale $wp_locale WordPress date and time locale object. 902 * 901 903 * @param string $header Theme header. Name, Description, Author, Version, ThemeURI, AuthorURI, Status, Tags. 902 904 * @param string|array $value Value to mark up. An array for Tags header, string otherwise. 903 905 * @param string $translate Whether the header has been translated. … … 904 906 * @return string Value, marked up. 905 907 */ 906 908 private function markup_header( $header, $value, $translate ) { 909 global $wp_locale; 910 907 911 switch ( $header ) { 908 912 case 'Name': 909 913 if ( empty( $value ) ) { … … 923 927 case 'Tags': 924 928 static $comma = null; 925 929 if ( ! isset( $comma ) ) { 926 /* translators: Used between list items, there is a space after the comma. */ 927 $comma = __( ', ' ); 930 $comma = $wp_locale->get_list_item_separator(); 928 931 } 929 932 $value = implode( $comma, $value ); 930 933 break;