WordPress.org

Make WordPress Core

Ticket #31786: 31786.diff

File 31786.diff, 1.3 KB (added by sirbrillig, 6 years ago)
  • wp-admin/custom-header.php

     
    944944         * @param mixed $choice Which header image to select. Allows for values of 'random-default-image',
    945945         *      for randomly cycling among the default images; 'random-uploaded-image', for randomly cycling
    946946         *      among the uploaded images; the key of a default image registered for that theme; and
    947          *      the key of an image uploaded for that theme (the basename of the URL).
     947         *      the key of an image uploaded for that theme (the attachment ID of the image).
    948948         *  Or an array of arguments: attachment_id, url, width, height. All are required.
    949949         *
    950950         * @since 3.4.0
  • wp-includes/theme.php

     
    11781178        foreach ( (array) $headers as $header ) {
    11791179                $url = esc_url_raw( wp_get_attachment_url( $header->ID ) );
    11801180                $header_data = wp_get_attachment_metadata( $header->ID );
    1181                 $header_index = basename($url);
     1181                $header_index = $header->ID;
    11821182                $header_images[$header_index] = array();
    11831183                $header_images[$header_index]['attachment_id'] =  $header->ID;
    11841184                $header_images[$header_index]['url'] =  $url;