WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/04/2014 04:12:52 AM (6 years ago)
Author:
wonderboymusic
Message:

Invalidate the post cache for posts associated with a user who has been removed from a blog in remove_user_from_blog(). Adds a unit test.

Props nprasath002 for the initial patch.
Fixes #25545.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ms-functions.php

    r26538 r27087  
    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        $post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_author = %d", $reassign ) );
     282        array_map( 'clean_post_cache', $post_ids );
    280283    }
    281284
Note: See TracChangeset for help on using the changeset viewer.