_update_term_count_on_transition_post_status [ WordPress Function ]
_update_term_count_on_transition_post_status ( $new_status, $old_status, $post )
| Access: |
|
| Parameters: |
|
| Defined at: |
|
Benzer Fonksiyonlar: wp_transition_post_status, _transition_post_status, wp_update_term_count_now, wp_transition_comment_status, wp_update_term_count
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.
Source
<?php
function _update_term_count_on_transition_post_status( $new_status, $old_status, $post ) {
// Update counts for the post's terms.
foreach ( (array) get_object_taxonomies( $post->post_type ) as $taxonomy ) {
$tt_ids = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'tt_ids' ) );
wp_update_term_count( $tt_ids, $taxonomy );
}
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- _update_term_count_on_transition_post_status() WordPress ...
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 ...
queryposts.com - _update_term_count_on_transition_post_status (WordPress ...
WordPress lookup for _update_term_count_on_transition_post_status, a WordPress Function. wpseek.com is a WordPress-centric search tool for developers ...
wpseek.com - WordPress › Support » WP Admin - plugin.php problem
... a valid callback, '_update_term_count_on_transition_post_status' was given in /home/www/lordhell.cz/subdomeny/www/wp-includes/plugin.php on line 405 ...
wordpress.org - PHPXRef 0.7 : WordPress : Detail view of post.php
_post_format_link() _post_format_get_term() _post_format_get_terms() _post_format_wp_get_object_terms() _update_term_count_on_transition_post_status() ...
phpxref.ftwr.co.uk