@@ -69,8 +68,7 @@
diff --git a/src/wp-content/themes/twentyeleven/content-quote.php b/src/wp-content/themes/twentyeleven/content-quote.php
index 5e91ad25ff..3dc531b8ad 100644
--- a/src/wp-content/themes/twentyeleven/content-quote.php
+++ b/src/wp-content/themes/twentyeleven/content-quote.php
@@ -48,8 +48,7 @@
@@ -63,8 +62,7 @@
@@ -72,8 +71,7 @@
' . $categories_list . '';
}
- /* translators: Used between list items, there is a space after the comma. */
- $tags_list = get_the_tag_list( '', __( ', ', 'twentythirteen' ) );
+ $tags_list = get_the_tag_list( '', wp_get_list_item_separator() );
if ( $tags_list && ! is_wp_error( $tags_list ) ) {
echo '
' . $tags_list . '';
}
diff --git a/src/wp-content/themes/twentytwelve/functions.php b/src/wp-content/themes/twentytwelve/functions.php
index d5d9137471..a86de032a5 100644
--- a/src/wp-content/themes/twentytwelve/functions.php
+++ b/src/wp-content/themes/twentytwelve/functions.php
@@ -384,6 +384,20 @@ function twentytwelve_widgets_init() {
}
add_action( 'widgets_init', 'twentytwelve_widgets_init' );
+if ( ! function_exists( 'wp_get_list_item_separator' ) ) :
+ /**
+ * Retrieves the list item separator based on the locale.
+ *
+ * Added for backward compatibility to support pre-6.0.0 WordPress versions.
+ *
+ * @since 6.0.0
+ */
+ function wp_get_list_item_separator() {
+ /* translators: Used between list items, there is a space after the comma. */
+ return __( ', ', 'twentytwelve' );
+ }
+endif;
+
if ( ! function_exists( 'twentytwelve_content_nav' ) ) :
/**
* Displays navigation to next/previous pages when applicable.
@@ -502,11 +516,9 @@ if ( ! function_exists( 'twentytwelve_entry_meta' ) ) :
* @since Twenty Twelve 1.0
*/
function twentytwelve_entry_meta() {
- /* translators: Used between list items, there is a space after the comma. */
- $categories_list = get_the_category_list( __( ', ', 'twentytwelve' ) );
+ $categories_list = get_the_category_list( wp_get_list_item_separator() );
- /* translators: Used between list items, there is a space after the comma. */
- $tags_list = get_the_tag_list( '', __( ', ', 'twentytwelve' ) );
+ $tags_list = get_the_tag_list( '', wp_get_list_item_separator() );
$date = sprintf(
'
',
diff --git a/src/wp-content/themes/twentytwentyone/functions.php b/src/wp-content/themes/twentytwentyone/functions.php
index 452b5b3d22..73eefb9518 100644
--- a/src/wp-content/themes/twentytwentyone/functions.php
+++ b/src/wp-content/themes/twentytwentyone/functions.php
@@ -640,3 +640,17 @@ function twentytwentyone_add_ie_class() {
';
- /* translators: Used between list items, there is a space after the comma. */
- $categories_list = get_the_category_list( __( ', ', 'twentytwentyone' ) );
+ $categories_list = get_the_category_list( wp_get_list_item_separator() );
if ( $categories_list ) {
printf(
/* translators: %s: List of categories. */
@@ -110,8 +109,7 @@ if ( ! function_exists( 'twenty_twenty_one_entry_meta_footer' ) ) {
);
}
- /* translators: Used between list items, there is a space after the comma. */
- $tags_list = get_the_tag_list( '', __( ', ', 'twentytwentyone' ) );
+ $tags_list = get_the_tag_list( '', wp_get_list_item_separator() );
if ( $tags_list ) {
printf(
/* translators: %s: List of tags. */
@@ -144,8 +142,7 @@ if ( ! function_exists( 'twenty_twenty_one_entry_meta_footer' ) ) {
echo '
';
- /* translators: Used between list items, there is a space after the comma. */
- $categories_list = get_the_category_list( __( ', ', 'twentytwentyone' ) );
+ $categories_list = get_the_category_list( wp_get_list_item_separator() );
if ( $categories_list ) {
printf(
/* translators: %s: List of categories. */
@@ -154,8 +151,7 @@ if ( ! function_exists( 'twenty_twenty_one_entry_meta_footer' ) ) {
);
}
- /* translators: Used between list items, there is a space after the comma. */
- $tags_list = get_the_tag_list( '', __( ', ', 'twentytwentyone' ) );
+ $tags_list = get_the_tag_list( '', wp_get_list_item_separator() );
if ( $tags_list ) {
printf(
/* translators: %s: List of tags. */
diff --git a/src/wp-includes/class-wp-locale.php b/src/wp-includes/class-wp-locale.php
index 291848e974..587fea9e5d 100644
--- a/src/wp-includes/class-wp-locale.php
+++ b/src/wp-includes/class-wp-locale.php
@@ -95,6 +95,14 @@ class WP_Locale {
*/
public $number_format;
+ /**
+ * The separator string used for localizing list item separator.
+ *
+ * @since 6.0.0
+ * @var string
+ */
+ public $list_item_separator;
+
/**
* Constructor which calls helper methods to set up object variables.
*
@@ -209,6 +217,9 @@ class WP_Locale {
$this->number_format['decimal_point'] = ( 'number_format_decimal_point' === $decimal_point ) ? '.' : $decimal_point;
+ /* translators: used between list items, there is a space after the comma */
+ $this->list_item_separator = __( ', ' );
+
// Set text direction.
if ( isset( $GLOBALS['text_direction'] ) ) {
$this->text_direction = $GLOBALS['text_direction'];
@@ -366,4 +377,15 @@ class WP_Locale {
/* translators: Localized date and time format, see https://www.php.net/manual/datetime.format.php */
__( 'F j, Y g:i a' );
}
+
+ /**
+ * Retrieve the localized list item separator.
+ *
+ * @since 6.0.0
+ *
+ * @return string Localized list item separator.
+ */
+ public function get_list_item_separator() {
+ return $this->list_item_separator;
+ }
}
diff --git a/src/wp-includes/class-wp-theme.php b/src/wp-includes/class-wp-theme.php
index 2c4dcd7fc8..5d24da07b4 100644
--- a/src/wp-includes/class-wp-theme.php
+++ b/src/wp-includes/class-wp-theme.php
@@ -924,8 +924,7 @@ final class WP_Theme implements ArrayAccess {
case 'Tags':
static $comma = null;
if ( ! isset( $comma ) ) {
- /* translators: Used between list items, there is a space after the comma. */
- $comma = __( ', ' );
+ $comma = wp_get_list_item_separator();
}
$value = implode( $comma, $value );
break;
diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php
index 82b19ec8f1..a2c1650c49 100644
--- a/src/wp-includes/functions.php
+++ b/src/wp-includes/functions.php
@@ -8371,3 +8371,17 @@ function is_php_version_compatible( $required ) {
function wp_fuzzy_number_match( $expected, $actual, $precision = 1 ) {
return abs( (float) $expected - (float) $actual ) <= $precision;
}
+
+/**
+ * Retrieves the list item separator based on the locale.
+ *
+ * @since 6.0.0
+ *
+ * @global WP_Locale $wp_locale WordPress date and time locale object.
+ *
+ * @return string Locale specific list item separator.
+ */
+function wp_get_list_item_separator() {
+ global $wp_locale;
+ return $wp_locale->get_list_item_separator();
+}