Call clean_post_cache() in wp_insert_post() after the manual query to change GUID. Remove the second call to clean_post_cache() previously done on the save_post hook. see #11399.

git-svn-id: https://develop.svn.wordpress.org/trunk@21943 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2012-09-21 18:52:15 +00:00
parent 35688ccb89
commit 2e6cb465b2
3 changed files with 10 additions and 16 deletions
+2 -15
View File
@@ -2765,12 +2765,12 @@ function wp_insert_post($postarr, $wp_error = false) {
$current_guid = get_post_field( 'guid', $post_ID );
clean_post_cache( $post_ID );
// Set GUID
if ( !$update && '' == $current_guid )
$wpdb->update( $wpdb->posts, array( 'guid' => get_permalink( $post_ID ) ), $where );
clean_post_cache( $post_ID );
$post = get_post($post_ID);
if ( !empty($page_template) && 'page' == $data['post_type'] ) {
@@ -4684,19 +4684,6 @@ function _publish_post_hook($post_id) {
wp_schedule_single_event(time(), 'do_pings');
}
/**
* Hook used to prevent page/post cache from staying dirty when a post is saved.
*
* @since 2.3.0
* @access private
*
* @param int $post_id The ID in the database table for the $post
* @param object $post Object type containing the post information
*/
function _save_post_hook( $post_id, $post ) {
clean_post_cache( $post );
}
/**
* Determines which fields of posts are to be saved in revisions.
*