Make WordPress Core


Ignore:
Timestamp:
09/27/2021 12:35:38 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Remove duplicate assignment from a ternary operator in WP_MS_Sites_List_Table::site_states().

Adjust similar code in _post_states() and _media_states() for consistency.

Follow-up to:

Props joelcj91, audrasjb, desrosj.
Fixes #38296.

File:
1 edited

Legend:

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

    r51737 r51873  
    644644                if ( ! empty( $site_states ) ) {
    645645                        $state_count = count( $site_states );
    646                         $i           = 0;
     646
     647                        $i = 0;
     648
    647649                        echo ' — ';
     650
    648651                        foreach ( $site_states as $state ) {
    649652                                ++$i;
    650                                 ( $i == $state_count ) ? $sep = '' : $sep = ', ';
     653
     654                                $sep = ( $i < $state_count ) ? ', ' : '';
     655
    651656                                echo "<span class='post-state'>{$state}{$sep}</span>";
    652657                        }
Note: See TracChangeset for help on using the changeset viewer.