Make WordPress Core


Ignore:
Timestamp:
01/05/2026 05:39:38 AM (7 months ago)
Author:
westonruter
Message:

Code Modernization: Customize: 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 [61432], [61431], [61430], [61429], [61424], [61404], [61403].

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/customize/class-wp-customize-header-image-setting.php

    r56193 r61433  
    4141                        require_once ABSPATH . 'wp-admin/includes/class-custom-image-header.php';
    4242                        $args                   = get_theme_support( 'custom-header' );
    43                         $admin_head_callback    = isset( $args[0]['admin-head-callback'] ) ? $args[0]['admin-head-callback'] : null;
    44                         $admin_preview_callback = isset( $args[0]['admin-preview-callback'] ) ? $args[0]['admin-preview-callback'] : null;
     43                        $admin_head_callback    = $args[0]['admin-head-callback'] ?? null;
     44                        $admin_preview_callback = $args[0]['admin-preview-callback'] ?? null;
    4545                        $custom_image_header    = new Custom_Image_Header( $admin_head_callback, $admin_preview_callback );
    4646                }
Note: See TracChangeset for help on using the changeset viewer.