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:
parent
35688ccb89
commit
2e6cb465b2
|
@ -249,7 +249,6 @@ add_action( 'plugins_loaded', 'wp_maybe_load_embeds',
|
||||||
add_action( 'shutdown', 'wp_ob_end_flush_all', 1 );
|
add_action( 'shutdown', 'wp_ob_end_flush_all', 1 );
|
||||||
add_action( 'pre_post_update', 'wp_save_post_revision' );
|
add_action( 'pre_post_update', 'wp_save_post_revision' );
|
||||||
add_action( 'publish_post', '_publish_post_hook', 5, 1 );
|
add_action( 'publish_post', '_publish_post_hook', 5, 1 );
|
||||||
add_action( 'save_post', '_save_post_hook', 5, 2 );
|
|
||||||
add_action( 'transition_post_status', '_transition_post_status', 5, 3 );
|
add_action( 'transition_post_status', '_transition_post_status', 5, 3 );
|
||||||
add_action( 'transition_post_status', '_update_term_count_on_transition_post_status', 10, 3 );
|
add_action( 'transition_post_status', '_update_term_count_on_transition_post_status', 10, 3 );
|
||||||
add_action( 'comment_form', 'wp_comment_form_unfiltered_html_nonce' );
|
add_action( 'comment_form', 'wp_comment_form_unfiltered_html_nonce' );
|
||||||
|
|
|
@ -3244,3 +3244,11 @@ function user_pass_ok($user_login, $user_pass) {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback formerly fired on the save_post hook. No longer needed.
|
||||||
|
*
|
||||||
|
* @since 2.3.0
|
||||||
|
* @deprecated 3.5.0
|
||||||
|
*/
|
||||||
|
function _save_post_hook() {}
|
|
@ -2765,12 +2765,12 @@ function wp_insert_post($postarr, $wp_error = false) {
|
||||||
|
|
||||||
$current_guid = get_post_field( 'guid', $post_ID );
|
$current_guid = get_post_field( 'guid', $post_ID );
|
||||||
|
|
||||||
clean_post_cache( $post_ID );
|
|
||||||
|
|
||||||
// Set GUID
|
// Set GUID
|
||||||
if ( !$update && '' == $current_guid )
|
if ( !$update && '' == $current_guid )
|
||||||
$wpdb->update( $wpdb->posts, array( 'guid' => get_permalink( $post_ID ) ), $where );
|
$wpdb->update( $wpdb->posts, array( 'guid' => get_permalink( $post_ID ) ), $where );
|
||||||
|
|
||||||
|
clean_post_cache( $post_ID );
|
||||||
|
|
||||||
$post = get_post($post_ID);
|
$post = get_post($post_ID);
|
||||||
|
|
||||||
if ( !empty($page_template) && 'page' == $data['post_type'] ) {
|
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');
|
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.
|
* Determines which fields of posts are to be saved in revisions.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue