Make WordPress Core

Changeset 61464


Ignore:
Timestamp:
01/10/2026 05:27:32 AM (3 months ago)
Author:
westonruter
Message:

Code Modernization: Use null coalescing operator in additional isset() ternaries.

These had been missed previously due to additional parentheses around the isset() expressions.

Developed in https://github.com/WordPress/wordpress-develop/pull/10704

Follow-up to [61463], [61457], [61456], [61455], [61454], [61453], [61445], [61444], [61443], [61442], [61436], [61435], [61434], [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403].

Props soean.
See #58874, #63430.

Location:
trunk/src
Files:
5 edited

Legend:

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

    r61434 r61464  
    106106        }
    107107
    108         $search = ( isset( $_REQUEST['s'] ) ) ? $_REQUEST['s'] : '';
     108        $search = $_REQUEST['s'] ?? '';
    109109
    110110        $post_type = ( isset( $_REQUEST['post_type'] ) ) ? sanitize_key( $_REQUEST['post_type'] ) : '';
    111111
    112         $user_id = ( isset( $_REQUEST['user_id'] ) ) ? $_REQUEST['user_id'] : '';
    113 
    114         $orderby = ( isset( $_REQUEST['orderby'] ) ) ? $_REQUEST['orderby'] : '';
    115         $order   = ( isset( $_REQUEST['order'] ) ) ? $_REQUEST['order'] : '';
     112        $user_id = $_REQUEST['user_id'] ?? '';
     113
     114        $orderby = $_REQUEST['orderby'] ?? '';
     115        $order   = $_REQUEST['order'] ?? '';
    116116
    117117        $comments_per_page = $this->get_per_page( $comment_status );
  • trunk/src/wp-admin/network/edit.php

    r47855 r61464  
    1111require_once __DIR__ . '/admin.php';
    1212
    13 $action = ( isset( $_GET['action'] ) ) ? $_GET['action'] : '';
     13$action = $_GET['action'] ?? '';
    1414
    1515if ( empty( $action ) ) {
  • trunk/src/wp-includes/class-wp-xmlrpc-server.php

    r61463 r61464  
    44504450
    44514451        $parent_id = ( isset( $struct['parent_id'] ) ) ? absint( $struct['parent_id'] ) : '';
    4452         $mime_type = ( isset( $struct['mime_type'] ) ) ? $struct['mime_type'] : '';
     4452        $mime_type = $struct['mime_type'] ?? '';
    44534453        $offset    = ( isset( $struct['offset'] ) ) ? absint( $struct['offset'] ) : 0;
    44544454        $number    = ( isset( $struct['number'] ) ) ? absint( $struct['number'] ) : -1;
  • trunk/src/wp-includes/functions.php

    r61445 r61464  
    33523352            }
    33533353
    3354             $mime = ( isset( $imagesize['mime'] ) ) ? $imagesize['mime'] : false;
     3354            $mime = $imagesize['mime'] ?? false;
    33553355        } else {
    33563356            $mime = false;
  • trunk/src/wp-includes/post-formats.php

    r58212 r61464  
    135135        return $strings['standard'];
    136136    } else {
    137         return ( isset( $strings[ $slug ] ) ) ? $strings[ $slug ] : '';
     137        return $strings[ $slug ] ?? '';
    138138    }
    139139}
Note: See TracChangeset for help on using the changeset viewer.