Make WordPress Core

Changeset 36539


Ignore:
Timestamp:
02/16/2016 10:11:14 PM (11 years ago)
Author:
ocean90
Message:

Themes: Use the attachment ID as the key in get_uploaded_header_images().

Prevents missing header images when an image has the same name as another header image.

Props sirbrillig.
Fixes #31786.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/custom-header.php

    r36250 r36539  
    978978         *      for randomly cycling among the default images; 'random-uploaded-image', for randomly cycling
    979979         *      among the uploaded images; the key of a default image registered for that theme; and
    980          *      the key of an image uploaded for that theme (the basename of the URL).
     980         *      the key of an image uploaded for that theme (the attachment ID of the image).
    981981         *  Or an array of arguments: attachment_id, url, width, height. All are required.
    982982         */
  • trunk/src/wp-includes/theme.php

    r36502 r36539  
    12081208                $url = esc_url_raw( wp_get_attachment_url( $header->ID ) );
    12091209                $header_data = wp_get_attachment_metadata( $header->ID );
    1210                 $header_index = basename($url);
     1210                $header_index = $header->ID;
    12111211
    12121212                $header_images[$header_index] = array();
Note: See TracChangeset for help on using the changeset viewer.