Make WordPress Core


Ignore:
Timestamp:
01/11/2026 06:48:15 AM (7 months ago)
Author:
westonruter
Message:

Code Modernization: Replace if statements with null coalescing operator.

Developed in https://github.com/WordPress/wordpress-develop/pull/10703

Follow-up to [61464], [61463], [61457], [61456], [61455], [61454], [61453], [61445], [61444], [61443], [61442], [61436], [61435], [61434], [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403].

Props soean, westonruter, mukesh27.
See #58874.
Fixes #64488.

File:
1 edited

Legend:

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

    r61456 r61470  
    10981098         *  or this:
    10991099         */
    1100         $action = 'wp_handle_upload';
    1101         if ( isset( $overrides['action'] ) ) {
    1102                 $action = $overrides['action'];
    1103         }
    1104 
     1100        $action = $overrides['action'] ?? 'wp_handle_upload';
    11051101        return _wp_handle_upload( $file, $overrides, $time, $action );
    11061102}
     
    11291125         *  or this:
    11301126         */
    1131         $action = 'wp_handle_sideload';
    1132         if ( isset( $overrides['action'] ) ) {
    1133                 $action = $overrides['action'];
    1134         }
    1135 
     1127        $action = $overrides['action'] ?? 'wp_handle_sideload';
    11361128        return _wp_handle_upload( $file, $overrides, $time, $action );
    11371129}
Note: See TracChangeset for help on using the changeset viewer.