Ticket #17548: 17548.diff
File 17548.diff, 1.4 KB (added by , 13 years ago) |
---|
-
wp-includes/post.php
2726 2726 $post->post_status = 'publish'; 2727 2727 wp_transition_post_status('publish', $old_status, $post); 2728 2728 2729 // Update counts for the post's terms.2730 foreach ( (array) get_object_taxonomies('post') as $taxonomy ) {2731 $tt_ids = wp_get_object_terms($post_id, $taxonomy, array('fields' => 'tt_ids'));2732 wp_update_term_count($tt_ids, $taxonomy);2733 }2734 2735 2729 do_action('edit_post', $post_id, $post); 2736 2730 do_action('save_post', $post_id, $post); 2737 2731 do_action('wp_insert_post', $post_id, $post); … … 2969 2963 * @param object $post Post data. 2970 2964 */ 2971 2965 function wp_transition_post_status($new_status, $old_status, $post) { 2966 2967 // Update counts for the post's terms. 2968 foreach ( (array) get_object_taxonomies( $post->post_type ) as $taxonomy ) { 2969 if( empty( get_taxonomy( $taxonomy )->update_count_callback ) ) 2970 continue; 2971 2972 $tt_ids = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'tt_ids ') ); 2973 wp_update_term_count( $tt_ids, $taxonomy ); 2974 } 2975 2972 2976 do_action('transition_post_status', $new_status, $old_status, $post); 2973 2977 do_action("{$old_status}_to_{$new_status}", $post); 2974 2978 do_action("{$new_status}_{$post->post_type}", $post->ID, $post);