WordPress.org

Make WordPress Core

Changeset 21943


Ignore:
Timestamp:
09/21/12 18:52:15 (19 months 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.

Location:
trunk/wp-includes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/default-filters.php

    r21537 r21943  
    250250add_action( 'pre_post_update',            'wp_save_post_revision'                          ); 
    251251add_action( 'publish_post',               '_publish_post_hook',                       5, 1 ); 
    252 add_action( 'save_post',                  '_save_post_hook',                          5, 2 ); 
    253252add_action( 'transition_post_status',     '_transition_post_status',                  5, 3 ); 
    254253add_action( 'transition_post_status',     '_update_term_count_on_transition_post_status', 10, 3 ); 
  • trunk/wp-includes/deprecated.php

    r21911 r21943  
    32453245    return true; 
    32463246} 
     3247 
     3248/** 
     3249 * Callback formerly fired on the save_post hook. No longer needed. 
     3250 * 
     3251 * @since 2.3.0 
     3252 * @deprecated 3.5.0 
     3253 */ 
     3254function _save_post_hook() {} 
  • 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.