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.
Built from https://develop.svn.wordpress.org/trunk@46441


git-svn-id: http://core.svn.wordpress.org/trunk@46239 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
johnjamesjacoby 2019-10-08 17:46:02 +00:00
parent a0a037db4d
commit 477f0ffd71
2 changed files with 3 additions and 2 deletions

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];
}
}

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.3-beta2-46440';
$wp_version = '5.3-beta2-46441';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.