Skip to content

Commit b6f02b8

Browse files
committed
I18N: Use wp_get_list_item_separator() as list separator for the states of sites, posts, and media.
Developed in WordPress#10577 Follow-up to [52929]. Props geminorum. See #39733. Fixes #64330. git-svn-id: https://develop.svn.wordpress.org/trunk@61371 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 9aac91b commit b6f02b8

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/wp-admin/includes/class-wp-ms-sites-list-table.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,7 @@ protected function site_states( $site ) {
674674

675675
if ( ! empty( $site_states ) ) {
676676
$state_count = count( $site_states );
677+
$separator = wp_get_list_item_separator();
677678

678679
$i = 0;
679680

@@ -682,9 +683,9 @@ protected function site_states( $site ) {
682683
foreach ( $site_states as $state ) {
683684
++$i;
684685

685-
$separator = ( $i < $state_count ) ? ', ' : '';
686+
$suffix = ( $i < $state_count ) ? $separator : '';
686687

687-
echo "<span class='post-state'>{$state}{$separator}</span>";
688+
echo "<span class='post-state'>{$state}{$suffix}</span>";
688689
}
689690
}
690691
}

src/wp-admin/includes/template.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2251,6 +2251,7 @@ function _post_states( $post, $display = true ) {
22512251

22522252
if ( ! empty( $post_states ) ) {
22532253
$state_count = count( $post_states );
2254+
$separator = wp_get_list_item_separator();
22542255

22552256
$i = 0;
22562257

@@ -2259,9 +2260,9 @@ function _post_states( $post, $display = true ) {
22592260
foreach ( $post_states as $state ) {
22602261
++$i;
22612262

2262-
$separator = ( $i < $state_count ) ? ', ' : '';
2263+
$suffix = ( $i < $state_count ) ? $separator : '';
22632264

2264-
$post_states_html .= "<span class='post-state'>{$state}{$separator}</span>";
2265+
$post_states_html .= "<span class='post-state'>{$state}{$suffix}</span>";
22652266
}
22662267
}
22672268

@@ -2379,6 +2380,7 @@ function _media_states( $post, $display = true ) {
23792380

23802381
if ( ! empty( $media_states ) ) {
23812382
$state_count = count( $media_states );
2383+
$separator = wp_get_list_item_separator();
23822384

23832385
$i = 0;
23842386

@@ -2387,9 +2389,9 @@ function _media_states( $post, $display = true ) {
23872389
foreach ( $media_states as $state ) {
23882390
++$i;
23892391

2390-
$separator = ( $i < $state_count ) ? ', ' : '';
2392+
$suffix = ( $i < $state_count ) ? $separator : '';
23912393

2392-
$media_states_string .= "<span class='post-state'>{$state}{$separator}</span>";
2394+
$media_states_string .= "<span class='post-state'>{$state}{$suffix}</span>";
23932395
}
23942396
}
23952397

0 commit comments

Comments
 (0)