Ticket #49446: 49446.2.diff
File 49446.2.diff, 1.0 KB (added by , 5 years ago) |
---|
-
src/wp-admin/includes/template.php
2200 2200 * 2201 2201 * @since 3.2.0 2202 2202 * 2203 * @staticvar int[] $header_images 2204 * 2203 2205 * @param WP_Post $post The attachment post to retrieve states for. 2204 2206 * @return string Media states string. 2205 2207 */ 2206 2208 function _media_states( $post ) { 2209 static $header_images; 2210 2207 2211 $media_states = array(); 2208 2212 $stylesheet = get_option( 'stylesheet' ); 2209 2213 … … 2211 2215 $meta_header = get_post_meta( $post->ID, '_wp_attachment_is_custom_header', true ); 2212 2216 2213 2217 if ( is_random_header_image() ) { 2214 $header_images = wp_list_pluck( get_uploaded_header_images(), 'attachment_id' ); 2218 if ( ! isset( $header_images ) ) { 2219 $header_images = wp_list_pluck( get_uploaded_header_images(), 'attachment_id' ); 2220 } 2215 2221 2216 2222 if ( $meta_header === $stylesheet && in_array( $post->ID, $header_images, true ) ) { 2217 2223 $media_states[] = __( 'Header Image' );