WordPress.org

Make WordPress Core

Ticket #25545: 25545.diff

File 25545.diff, 752 bytes (added by wonderboymusic, 5 years ago)
  • src/wp-includes/ms-functions.php

     
    277277                $reassign = (int) $reassign;
    278278                $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_author = %d WHERE post_author = %d", $reassign, $user_id) );
    279279                $wpdb->query( $wpdb->prepare("UPDATE $wpdb->links SET link_owner = %d WHERE link_owner = %d", $reassign, $user_id) );
     280
     281                // clean post cache for reassigned posts
     282                $post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_author = %d", $reassign ) );
     283                array_map( 'clean_post_cache', $post_ids );
    280284        }
    281285
    282286        restore_current_blog();