Make WordPress Core


Ignore:
Timestamp:
01/05/2026 05:22:14 AM (3 months ago)
Author:
westonruter
Message:

Code Modernization: Editor: Use null coalescing operator instead of isset() ternaries.

Developed as a subset of https://github.com/WordPress/wordpress-develop/pull/10654
Initially developed in https://github.com/WordPress/wordpress-develop/pull/4886

Follow-up to [61430], [61429], [61424], [61404], [61403].

Props costdev, westonruter.
See #58874, #63430.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-template.php

    r61178 r61431  
    374374
    375375    // Pages.
    376     $page_id = isset( $wp_query->query['page_id'] ) ? $wp_query->query['page_id'] : null;
     376    $page_id = $wp_query->query['page_id'] ?? null;
    377377
    378378    // Posts, including custom post types.
    379     $p = isset( $wp_query->query['p'] ) ? $wp_query->query['p'] : null;
     379    $p = $wp_query->query['p'] ?? null;
    380380
    381381    $post_id = $page_id ? $page_id : $p;
Note: See TracChangeset for help on using the changeset viewer.