Make WordPress Core


Ignore:
Timestamp:
01/05/2026 04:31:14 AM (9 months ago)
Author:
westonruter
Message:

Code Modernization: REST API: Use null coalescing operator in place of isset() in 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 [61424], [61404], [61403].

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php

    r59970 r61429  
    390390                                // get_metadata_raw is used to avoid retrieving the default value.
    391391                                $old_meta = get_metadata_raw( 'post', $post_id, $meta_key, true );
    392                                 $new_meta = isset( $meta[ $meta_key ] ) ? $meta[ $meta_key ] : '';
     392                                $new_meta = $meta[ $meta_key ] ?? '';
    393393
    394394                                if ( $new_meta !== $old_meta ) {
Note: See TracChangeset for help on using the changeset viewer.