Make WordPress Core

Changeset 62173


Ignore:
Timestamp:
03/28/2026 11:49:49 PM (less than one hour ago)
Author:
SergeyBiryukov
Message:

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.

Location:
trunk/src/wp-admin
Files:
3 edited

Legend:

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

    r61717 r62173  
    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 ) {
  • trunk/src/wp-admin/includes/upgrade.php

    r61644 r62173  
    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            }
  • trunk/src/wp-admin/nav-menus.php

    r61658 r62173  
    550550
    551551// Are we on the add new screen?
    552 $add_new_screen = ( isset( $_GET['menu'] ) && 0 === (int) $_GET['menu'] ) ? true : false;
    553 
    554 $locations_screen = ( isset( $_GET['action'] ) && 'locations' === $_GET['action'] ) ? true : false;
     552$add_new_screen = isset( $_GET['menu'] ) && 0 === (int) $_GET['menu'];
     553
     554$locations_screen = isset( $_GET['action'] ) && 'locations' === $_GET['action'];
    555555
    556556$page_count = wp_count_posts( 'page' );
Note: See TracChangeset for help on using the changeset viewer.