Changeset 18809 for trunk/wp-includes/post.php
- Timestamp:
- 09/29/2011 05:29:20 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r18783 r18809 2728 2728 wp_transition_post_status('publish', $old_status, $post); 2729 2729 2730 // Update counts for the post's terms. 2731 foreach ( (array) get_object_taxonomies('post') as $taxonomy ) { 2732 $tt_ids = wp_get_object_terms($post_id, $taxonomy, array('fields' => 'tt_ids')); 2733 wp_update_term_count($tt_ids, $taxonomy); 2734 } 2735 2730 2736 do_action('edit_post', $post_id, $post); 2731 2737 do_action('save_post', $post_id, $post); … … 5306 5312 add_filter( 'wp_get_object_terms', '_post_format_wp_get_object_terms' ); 5307 5313 5308 /**5309 * 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.5310 *5311 * @access private5312 * @param string $new_status5313 * @param string $old_status5314 * @param object $post5315 * @since 3.3.05316 */5317 function _update_term_count_on_transition_post_status( $new_status, $old_status, $post ) {5318 // Update counts for the post's terms.5319 foreach ( (array) get_object_taxonomies( $post->post_type ) as $taxonomy ) {5320 $tt_ids = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'tt_ids' ) );5321 wp_update_term_count( $tt_ids, $taxonomy );5322 }5323 }5324 5314 ?>
Note: See TracChangeset
for help on using the changeset viewer.