Changeset 56763 for trunk/src/wp-includes/post.php
- Timestamp:
- 10/03/2023 02:59:22 PM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post.php
r56711 r56763 7263 7263 wp_cache_delete( $post->ID, 'posts' ); 7264 7264 wp_cache_delete( $post->ID, 'post_meta' ); 7265 wp_cache_delete( $post->ID, 'post_parent' ); 7265 7266 7266 7267 clean_object_term_cache( $post->ID, $post->post_type ); … … 7797 7798 7798 7799 /** 7800 * Prime post parent caches. 7801 * 7802 * @global wpdb $wpdb WordPress database abstraction object. 7803 * 7804 * @param int[] $ids ID list. 7805 */ 7806 function _prime_post_parents_caches( array $ids ) { 7807 global $wpdb; 7808 7809 $non_cached_ids = _get_non_cached_ids( $ids, 'post_parent' ); 7810 if ( ! empty( $non_cached_ids ) ) { 7811 $fresh_posts = $wpdb->get_results( sprintf( "SELECT $wpdb->posts.ID, $wpdb->posts.post_parent FROM $wpdb->posts WHERE ID IN (%s)", implode( ',', $non_cached_ids ) ) ); 7812 7813 if ( $fresh_posts ) { 7814 $post_parent_data = array(); 7815 foreach ( $fresh_posts as $fresh_post ) { 7816 $post_parent_data[ (int) $fresh_post->ID ] = (int) $fresh_post->post_parent; 7817 } 7818 7819 wp_cache_add_multiple( $post_parent_data, 'post_parent' ); 7820 } 7821 } 7822 } 7823 7824 /** 7799 7825 * Adds a suffix if any trashed posts have a given slug. 7800 7826 *
Note: See TracChangeset
for help on using the changeset viewer.