Skip to content

Commit 1967f10

Browse files
Code Quality: Simplify boolean assignments.
This makes minor code simplifications by removing unnecessary ternary operations and directly assigning boolean expressions. These changes make the code easier to read and maintain, but do not alter the underlying logic. Props Soean. See #64898. git-svn-id: https://develop.svn.wordpress.org/trunk@62173 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 19d4be9 commit 1967f10

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/wp-admin/includes/class-wp-ms-themes-list-table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function __construct( $args = array() ) {
5959

6060
$page = $this->get_pagenum();
6161

62-
$this->is_site_themes = ( 'site-themes-network' === $this->screen->id ) ? true : false;
62+
$this->is_site_themes = 'site-themes-network' === $this->screen->id;
6363

6464
if ( $this->is_site_themes ) {
6565
$this->site_id = isset( $_REQUEST['id'] ) ? (int) $_REQUEST['id'] : 0;

src/wp-admin/includes/upgrade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3282,7 +3282,7 @@ function dbDelta( $queries = '', $execute = true ) { // phpcs:ignore WordPress.N
32823282
'fieldname' => $tableindex->Column_name,
32833283
'subpart' => $tableindex->Sub_part,
32843284
);
3285-
$index_ary[ $keyname ]['unique'] = ( '0' === (string) $tableindex->Non_unique ) ? true : false;
3285+
$index_ary[ $keyname ]['unique'] = '0' === (string) $tableindex->Non_unique;
32863286
$index_ary[ $keyname ]['index_type'] = $tableindex->Index_type;
32873287
}
32883288

src/wp-admin/nav-menus.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,9 +549,9 @@
549549
$menu_count = count( $nav_menus );
550550

551551
// Are we on the add new screen?
552-
$add_new_screen = ( isset( $_GET['menu'] ) && 0 === (int) $_GET['menu'] ) ? true : false;
552+
$add_new_screen = isset( $_GET['menu'] ) && 0 === (int) $_GET['menu'];
553553

554-
$locations_screen = ( isset( $_GET['action'] ) && 'locations' === $_GET['action'] ) ? true : false;
554+
$locations_screen = isset( $_GET['action'] ) && 'locations' === $_GET['action'];
555555

556556
$page_count = wp_count_posts( 'page' );
557557

0 commit comments

Comments
 (0)