Make WordPress Core


Ignore:
Timestamp:
09/21/2012 06:52:15 PM (12 years ago)
Author:
nacin
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post.php

    r21942 r21943  
    27662766    $current_guid = get_post_field( 'guid', $post_ID );
    27672767
    2768     clean_post_cache( $post_ID );
    2769 
    27702768    // Set GUID
    27712769    if ( !$update && '' == $current_guid )
    27722770        $wpdb->update( $wpdb->posts, array( 'guid' => get_permalink( $post_ID ) ), $where );
     2771
     2772    clean_post_cache( $post_ID );
    27732773
    27742774    $post = get_post($post_ID);
     
    46864686
    46874687/**
    4688  * Hook used to prevent page/post cache from staying dirty when a post is saved.
    4689  *
    4690  * @since 2.3.0
    4691  * @access private
    4692  *
    4693  * @param int $post_id The ID in the database table for the $post
    4694  * @param object $post Object type containing the post information
    4695  */
    4696 function _save_post_hook( $post_id, $post ) {
    4697     clean_post_cache( $post );
    4698 }
    4699 
    4700 /**
    47014688 * Determines which fields of posts are to be saved in revisions.
    47024689 *
Note: See TracChangeset for help on using the changeset viewer.