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.

git-svn-id: https://develop.svn.wordpress.org/trunk@46441 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John James Jacoby 2019-10-08 17:44:42 +00:00
parent 3207d9a47e
commit 0a818ec0fc

View File

@ -617,8 +617,9 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
reset( $this->status_list );
$site_status = isset( $_REQUEST['status'] ) ? wp_unslash( trim( $_REQUEST['status'] ) ) : '';
foreach ( $this->status_list as $status => $col ) {
if ( $_site->{$status} == 1 ) {
if ( ( 1 === intval( $_site->{$status} ) ) && ( $site_status !== $status ) ) {
$site_states[ $col[0] ] = $col[1];
}
}