Changeset 18932 for trunk/wp-includes/post.php
- Timestamp:
- 10/10/2011 08:52:44 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r18846 r18932 2732 2732 wp_transition_post_status('publish', $old_status, $post); 2733 2733 2734 // Update counts for the post's terms.2735 foreach ( (array) get_object_taxonomies('post') as $taxonomy ) {2736 $tt_ids = wp_get_object_terms($post_id, $taxonomy, array('fields' => 'tt_ids'));2737 wp_update_term_count($tt_ids, $taxonomy);2738 }2739 2740 2734 do_action('edit_post', $post_id, $post); 2741 2735 do_action('save_post', $post_id, $post); … … 5313 5307 add_filter( 'wp_get_object_terms', '_post_format_wp_get_object_terms' ); 5314 5308 5309 /** 5310 * Update the custom taxonomies' term counts when a post's status is changed. For example, default posts term counts (for custom taxonomies) don't include private / draft posts. 5311 * 5312 * @access private 5313 * @param string $new_status 5314 * @param string $old_status 5315 * @param object $post 5316 * @since 3.3.0 5317 */ 5318 function _update_term_count_on_transition_post_status( $new_status, $old_status, $post ) { 5319 // Update counts for the post's terms. 5320 foreach ( (array) get_object_taxonomies( $post->post_type ) as $taxonomy ) { 5321 $tt_ids = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'tt_ids' ) ); 5322 wp_update_term_count( $tt_ids, $taxonomy ); 5323 } 5324 } 5315 5325 ?>
Note: See TracChangeset
for help on using the changeset viewer.