Make WordPress Core


Ignore:
Timestamp:
11/25/2021 08:34:01 AM (3 years ago)
Author:
audrasjb
Message:

Media: Replace some array keys with their numeric equivalent.

This change replaces ['0'] with [0] which brings better consistency, readability and performance.

Props chintan1896, adamsilverstein, costdev.
Fixes #53540.

File:
1 edited

Legend:

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

    r52190 r52245  
    11301130function wp_get_attachment_image_url( $attachment_id, $size = 'thumbnail', $icon = false ) {
    11311131    $image = wp_get_attachment_image_src( $attachment_id, $size, $icon );
    1132     return isset( $image['0'] ) ? $image['0'] : false;
     1132    return isset( $image[0] ) ? $image[0] : false;
    11331133}
    11341134
Note: See TracChangeset for help on using the changeset viewer.