diff --git a/wp-includes/default-filters.php b/wp-includes/default-filters.php index 1aa3e48dc0..f83964947c 100644 --- a/wp-includes/default-filters.php +++ b/wp-includes/default-filters.php @@ -249,7 +249,6 @@ add_action( 'plugins_loaded', 'wp_maybe_load_embeds', add_action( 'shutdown', 'wp_ob_end_flush_all', 1 ); add_action( 'pre_post_update', 'wp_save_post_revision' ); 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', '_update_term_count_on_transition_post_status', 10, 3 ); add_action( 'comment_form', 'wp_comment_form_unfiltered_html_nonce' ); diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php index 77c26b0325..f492553ea0 100644 --- a/wp-includes/deprecated.php +++ b/wp-includes/deprecated.php @@ -3244,3 +3244,11 @@ function user_pass_ok($user_login, $user_pass) { 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() {} \ No newline at end of file diff --git a/wp-includes/post.php b/wp-includes/post.php index cdfe21cbd3..d7dbe1833d 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -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. *