diff --git a/src/wp-admin/custom-header.php b/src/wp-admin/custom-header.php
index aad5472..11713c9 100644
|
a
|
b
|
wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?> |
| 1280 | 1280 | |
| 1281 | 1281 | public function get_uploaded_header_images() { |
| 1282 | 1282 | $key = '_wp_attachment_custom_header_last_used_' . get_stylesheet(); |
| 1283 | | $header_images = array(); |
| 1284 | 1283 | |
| 1285 | | $headers_not_dated = get_posts( array( |
| | 1284 | $headers_all = get_posts( array( |
| 1286 | 1285 | 'post_type' => 'attachment', |
| 1287 | 1286 | 'meta_key' => '_wp_attachment_is_custom_header', |
| 1288 | 1287 | 'meta_value' => get_option('stylesheet'), |
| 1289 | 1288 | 'orderby' => 'none', |
| 1290 | 1289 | 'nopaging' => true, |
| 1291 | | 'meta_query' => array( |
| 1292 | | array( |
| 1293 | | 'key' => '_wp_attachment_is_custom_header', |
| 1294 | | 'value' => get_option( 'stylesheet' ), |
| 1295 | | 'compare' => 'LIKE' |
| 1296 | | ), |
| 1297 | | array( |
| 1298 | | 'key' => $key, |
| 1299 | | 'value' => 'this string must not be empty', |
| 1300 | | 'compare' => 'NOT EXISTS' |
| 1301 | | ), |
| 1302 | | ) |
| 1303 | 1290 | ) ); |
| 1304 | 1291 | |
| 1305 | | $headers_dated = get_posts( array( |
| 1306 | | 'post_type' => 'attachment', |
| 1307 | | 'meta_key' => $key, |
| 1308 | | 'orderby' => 'meta_value_num', |
| 1309 | | 'order' => 'DESC', |
| 1310 | | 'nopaging' => true, |
| 1311 | | 'meta_query' => array( |
| 1312 | | array( |
| 1313 | | 'key' => '_wp_attachment_is_custom_header', |
| 1314 | | 'value' => get_option( 'stylesheet' ), |
| 1315 | | 'compare' => 'LIKE' |
| 1316 | | ), |
| 1317 | | ), |
| 1318 | | ) ); |
| 1319 | | |
| 1320 | | $limit = apply_filters( 'custom_header_uploaded_limit', 15 ); |
| 1321 | | $headers = array_merge( $headers_dated, $headers_not_dated ); |
| 1322 | | $headers = array_slice( $headers, 0, $limit ); |
| 1323 | | |
| 1324 | | foreach ( (array) $headers as $header ) { |
| | 1292 | $header_images = array(); |
| | 1293 | foreach ( (array) $headers_all as $header ) { |
| 1325 | 1294 | $url = esc_url_raw( $header->guid ); |
| 1326 | 1295 | $header_data = wp_get_attachment_metadata( $header->ID ); |
| 1327 | | $timestamp = get_post_meta( $header->ID, |
| 1328 | | '_wp_attachment_custom_header_last_used_' . get_stylesheet(), |
| 1329 | | true ); |
| | 1296 | $timestamp = get_post_meta( $header->ID, $key, true ); |
| 1330 | 1297 | |
| 1331 | 1298 | $h = array( |
| 1332 | 1299 | 'attachment_id' => $header->ID, |