Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/helper/class-ee-site.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ public function _list( $args, $assoc_args ) {
$sites = Site::all();

if ( $enabled && ! $disabled ) {
$sites = Site::where( 'site_enabled', true );
$sites = Site::where( 'site_enabled', 1 );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think here true/false is makes more sense. So you can maybe update it in where function. Like if you know that we are not storing the value in sqlite with true/false and it's 1/0 then you can do this in where function.

if ( is_bool( $value ) ) {
   $value =  (int) $value;
} 

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that will be better.

} elseif ( $disabled && ! $enabled ) {
$sites = Site::where( 'site_enabled', false );
$sites = Site::where( 'site_enabled', 0 );
}

if ( empty( $sites ) ) {
Expand Down