Make WordPress Core

Changeset 46441


Ignore:
Timestamp:
10/08/2019 05:44:42 PM (5 years ago)
Author:
johnjamesjacoby
Message:

Network Admin: Improve Site States in List Table rows.

This commit switches a comparison to a Yoda condition, performs a more strict intval() check on the value of the Site Status column, and prevents a specific Site State from appearing in List Table rows when filtering by that same Site State already (to match the behavior of other List Table State implementations.)

Fixes #37684. Props pbiron.

File:
1 edited

Legend:

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

    r46385 r46441  
    618618        reset( $this->status_list );
    619619
     620        $site_status = isset( $_REQUEST['status'] ) ? wp_unslash( trim( $_REQUEST['status'] ) ) : '';
    620621        foreach ( $this->status_list as $status => $col ) {
    621             if ( $_site->{$status} == 1 ) {
     622            if ( ( 1 === intval( $_site->{$status} ) ) && ( $site_status !== $status ) ) {
    622623                $site_states[ $col[0] ] = $col[1];
    623624            }
Note: See TracChangeset for help on using the changeset viewer.