Make WordPress Core


Ignore:
Timestamp:
01/09/2026 02:46:30 AM (7 months ago)
Author:
westonruter
Message:

Code Modernization: Upgrade/Install: 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 [61454], [61453], [61445], [61444], [61443], [61442], [61436], [61435], [61434], [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403].

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/update.php

    r59861 r61455  
    471471
    472472        $plugin_name = wp_kses( $plugin_data['Name'], $plugins_allowedtags );
    473         $plugin_slug = isset( $response->slug ) ? $response->slug : $response->id;
     473        $plugin_slug = $response->slug ?? $response->id;
    474474
    475475        if ( isset( $response->slug ) ) {
     
    505505                }
    506506
    507                 $requires_php   = isset( $response->requires_php ) ? $response->requires_php : null;
     507                $requires_php   = $response->requires_php ?? null;
    508508                $compatible_php = is_php_version_compatible( $requires_php );
    509509                $notice_type    = $compatible_php ? 'notice-warning' : 'notice-error';
     
    697697        $active = $theme->is_allowed( 'network' ) ? ' active' : '';
    698698
    699         $requires_wp  = isset( $response['requires'] ) ? $response['requires'] : null;
    700         $requires_php = isset( $response['requires_php'] ) ? $response['requires_php'] : null;
     699        $requires_wp  = $response['requires'] ?? null;
     700        $requires_php = $response['requires_php'] ?? null;
    701701
    702702        $compatible_wp  = is_wp_version_compatible( $requires_wp );
Note: See TracChangeset for help on using the changeset viewer.