Make WordPress Core


Ignore:
Timestamp:
01/05/2026 05:39:38 AM (3 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/class-wp-customize-widgets.php

    r60909 r61433  
    925925                        <?php
    926926                        $panel       = $this->manager->get_panel( 'widgets' );
    927                         $panel_title = isset( $panel->title ) ? $panel->title : __( 'Widgets' );
     927                        $panel_title = $panel->title ?? __( 'Widgets' );
    928928                        /* translators: &#9656; is the unicode right-pointing triangle. %s: Section title in the Customizer. */
    929929                        printf( __( 'Customizing &#9656; %s' ), esc_html( $panel_title ) );
     
    11241124                $available_widget,
    11251125                array(
    1126                     'temp_id'      => isset( $args['_temp_id'] ) ? $args['_temp_id'] : null,
     1126                    'temp_id'      => $args['_temp_id'] ?? null,
    11271127                    'is_multi'     => $is_multi_widget,
    11281128                    'control_tpl'  => $control_tpl,
Note: See TracChangeset for help on using the changeset viewer.