Make WordPress Core


Ignore:
Timestamp:
02/13/2026 05:51:41 PM (4 months ago)
Author:
westonruter
Message:

Code Modernization: Use null coalescing operator instead of ternaries where possible.

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

Follow-up to [61621], [61464].

Props soean, westonruter.
See #63430.

File:
1 edited

Legend:

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

    r61464 r61637  
    952952            $headers = wp_get_http_headers( $url );
    953953            if ( $headers ) {
    954                 $len           = isset( $headers['Content-Length'] ) ? (int) $headers['Content-Length'] : 0;
     954                $len           = (int) ( $headers['Content-Length'] ?? 0 );
    955955                $type          = $headers['Content-Type'] ?? '';
    956956                $allowed_types = array( 'video', 'audio' );
Note: See TracChangeset for help on using the changeset viewer.