diff --git src/wp-includes/post.php src/wp-includes/post.php
index 4ce2ac1..f67e721 100644
|
|
|
function wp_delete_auto_drafts() { |
| 6029 | 6029 | */ |
| 6030 | 6030 | function wp_queue_posts_for_term_meta_lazyload( $posts ) { |
| 6031 | 6031 | $post_type_taxonomies = $term_ids = array(); |
| | 6032 | $cache_keys = array(); |
| 6032 | 6033 | foreach ( $posts as $post ) { |
| 6033 | 6034 | if ( ! ( $post instanceof WP_Post ) ) { |
| 6034 | 6035 | continue; |
| … |
… |
function wp_queue_posts_for_term_meta_lazyload( $posts ) { |
| 6039 | 6040 | } |
| 6040 | 6041 | |
| 6041 | 6042 | foreach ( $post_type_taxonomies[ $post->post_type ] as $taxonomy ) { |
| 6042 | | // Term cache should already be primed by `update_post_term_cache()`. |
| 6043 | | $terms = get_object_term_cache( $post->ID, $taxonomy ); |
| 6044 | | if ( false !== $terms ) { |
| 6045 | | foreach ( $terms as $term ) { |
| 6046 | | if ( ! isset( $term_ids[ $term->term_id ] ) ) { |
| 6047 | | $term_ids[] = $term->term_id; |
| 6048 | | } |
| 6049 | | } |
| | 6043 | if ( ! isset( $cache_keys[ "{$taxonomy}_relationships" ] ) ) { |
| | 6044 | $cache_keys[ "{$taxonomy}_relationships" ] = array(); |
| | 6045 | } |
| | 6046 | |
| | 6047 | // Force uniqueness by overwriting key. |
| | 6048 | $cache_keys[ "{$taxonomy}_relationships" ][ $post->ID ] = $post->ID; |
| | 6049 | } |
| | 6050 | } |
| | 6051 | |
| | 6052 | if ( ! $cache_keys ) { |
| | 6053 | return; |
| | 6054 | } |
| | 6055 | |
| | 6056 | $cached_values = wp_cache_get_multi( $cache_keys ); |
| | 6057 | foreach ( $cached_values as $tax_cache_group => $cached_posts ) { |
| | 6058 | foreach ( $cached_posts as $post_id => $cached_post_term_ids ) { |
| | 6059 | if ( false === $cached_post_term_ids ) { |
| | 6060 | continue; |
| | 6061 | } |
| | 6062 | |
| | 6063 | foreach ( $cached_post_term_ids as $term_id ) { |
| | 6064 | $term_ids[ $term_id ] = $term_id; |
| 6050 | 6065 | } |
| 6051 | 6066 | } |
| 6052 | 6067 | } |