Make WordPress Core

Ticket #56100: update_post_caches.diff

File update_post_caches.diff, 1.0 KB (added by desrosj, 22 months ago)
  • src/wp-includes/post.php

    diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php
    index 4ceb8dd3a6..d1ee514c34 100644
    a b function clean_post_cache( $post ) { 
    73837383 * @param bool      $update_term_cache Optional. Whether to update the term cache. Default true.
    73847384 * @param bool      $update_meta_cache Optional. Whether to update the meta cache. Default true.
    73857385 */
    7386 function update_post_caches( &$posts, $post_type = 'post', $update_term_cache = true, $update_meta_cache = true ) {
     7386function update_post_caches( &$posts, $post_type = 'post', $update_term_cache = true, $update_meta_cache = true, $update_author_cache = true ) {
    73877387        // No point in doing all this work if we didn't match any posts.
    73887388        if ( ! $posts ) {
    73897389                return;
    function update_post_caches( &$posts, $post_type = 'post', $update_term_cache = 
    74227422        if ( $update_meta_cache ) {
    74237423                update_postmeta_cache( $post_ids );
    74247424        }
     7425
     7426        if ( $update_author_cache ) {
     7427                update_post_author_caches( $posts );
     7428        }
    74257429}
    74267430
    74277431/**