Make WordPress Core

Changeset 61371


Ignore:
Timestamp:
12/12/2025 01:13:43 AM (2 days ago)
Author:
westonruter
Message:

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.

Location:
trunk/src/wp-admin/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-ms-sites-list-table.php

    r60358 r61371  
    675675        if ( ! empty( $site_states ) ) {
    676676            $state_count = count( $site_states );
     677            $separator   = wp_get_list_item_separator();
    677678
    678679            $i = 0;
     
    683684                ++$i;
    684685
    685                 $separator = ( $i < $state_count ) ? ', ' : '';
    686 
    687                 echo "<span class='post-state'>{$state}{$separator}</span>";
     686                $suffix = ( $i < $state_count ) ? $separator : '';
     687
     688                echo "<span class='post-state'>{$state}{$suffix}</span>";
    688689            }
    689690        }
  • trunk/src/wp-admin/includes/template.php

    r61261 r61371  
    22522252    if ( ! empty( $post_states ) ) {
    22532253        $state_count = count( $post_states );
     2254        $separator   = wp_get_list_item_separator();
    22542255
    22552256        $i = 0;
     
    22602261            ++$i;
    22612262
    2262             $separator = ( $i < $state_count ) ? ', ' : '';
    2263 
    2264             $post_states_html .= "<span class='post-state'>{$state}{$separator}</span>";
     2263            $suffix = ( $i < $state_count ) ? $separator : '';
     2264
     2265            $post_states_html .= "<span class='post-state'>{$state}{$suffix}</span>";
    22652266        }
    22662267    }
     
    23802381    if ( ! empty( $media_states ) ) {
    23812382        $state_count = count( $media_states );
     2383        $separator   = wp_get_list_item_separator();
    23822384
    23832385        $i = 0;
     
    23882390            ++$i;
    23892391
    2390             $separator = ( $i < $state_count ) ? ', ' : '';
    2391 
    2392             $media_states_string .= "<span class='post-state'>{$state}{$separator}</span>";
     2392            $suffix = ( $i < $state_count ) ? $separator : '';
     2393
     2394            $media_states_string .= "<span class='post-state'>{$state}{$suffix}</span>";
    23932395        }
    23942396    }
Note: See TracChangeset for help on using the changeset viewer.