Commit 3161c53650 for wordpress.org
commit 3161c536501859db6f89aba1499d7996cdef40ea
Author: Weston Ruter <weston@xwp.co>
Date: Fri Dec 12 01:15:31 2025 +0000
I18N: Use `wp_get_list_item_separator()` as list separator for the states of sites, posts, and media.
Developed in https://github.com/WordPress/wordpress-develop/pull/10577
Follow-up to [52929].
Props geminorum.
See #39733.
Fixes #64330.
Built from https://develop.svn.wordpress.org/trunk@61371
git-svn-id: http://core.svn.wordpress.org/trunk@60683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
diff --git a/wp-admin/includes/class-wp-ms-sites-list-table.php b/wp-admin/includes/class-wp-ms-sites-list-table.php
index 6097f5e13e..f2df9b43fe 100644
--- a/wp-admin/includes/class-wp-ms-sites-list-table.php
+++ b/wp-admin/includes/class-wp-ms-sites-list-table.php
@@ -674,6 +674,7 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
if ( ! empty( $site_states ) ) {
$state_count = count( $site_states );
+ $separator = wp_get_list_item_separator();
$i = 0;
@@ -682,9 +683,9 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
foreach ( $site_states as $state ) {
++$i;
- $separator = ( $i < $state_count ) ? ', ' : '';
+ $suffix = ( $i < $state_count ) ? $separator : '';
- echo "<span class='post-state'>{$state}{$separator}</span>";
+ echo "<span class='post-state'>{$state}{$suffix}</span>";
}
}
}
diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php
index 1c86a2a9d0..b607e71d75 100644
--- a/wp-admin/includes/template.php
+++ b/wp-admin/includes/template.php
@@ -2251,6 +2251,7 @@ function _post_states( $post, $display = true ) {
if ( ! empty( $post_states ) ) {
$state_count = count( $post_states );
+ $separator = wp_get_list_item_separator();
$i = 0;
@@ -2259,9 +2260,9 @@ function _post_states( $post, $display = true ) {
foreach ( $post_states as $state ) {
++$i;
- $separator = ( $i < $state_count ) ? ', ' : '';
+ $suffix = ( $i < $state_count ) ? $separator : '';
- $post_states_html .= "<span class='post-state'>{$state}{$separator}</span>";
+ $post_states_html .= "<span class='post-state'>{$state}{$suffix}</span>";
}
}
@@ -2379,6 +2380,7 @@ function _media_states( $post, $display = true ) {
if ( ! empty( $media_states ) ) {
$state_count = count( $media_states );
+ $separator = wp_get_list_item_separator();
$i = 0;
@@ -2387,9 +2389,9 @@ function _media_states( $post, $display = true ) {
foreach ( $media_states as $state ) {
++$i;
- $separator = ( $i < $state_count ) ? ', ' : '';
+ $suffix = ( $i < $state_count ) ? $separator : '';
- $media_states_string .= "<span class='post-state'>{$state}{$separator}</span>";
+ $media_states_string .= "<span class='post-state'>{$state}{$suffix}</span>";
}
}
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 9a564a49fe..08baf3dad9 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '7.0-alpha-61370';
+$wp_version = '7.0-alpha-61371';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.