wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
wp_update_term_count_now › WordPress Function
Seit2.5.0
Veraltetn/v
› wp_update_term_count_now ( $terms, $taxonomy )
Parameter: (2) |
|
Gibt zurück: |
|
Definiert in: |
|
Codex: |
Performs term count update immediately.
Ähnliche Funktionen: wp_update_term_count, wp_update_comment_count_now, wp_update_user_counts, _update_post_term_count, wp_update_network_counts
Quellcode
function wp_update_term_count_now( $terms, $taxonomy ) { $terms = array_map( 'intval', $terms ); $taxonomy = get_taxonomy( $taxonomy ); if ( ! empty( $taxonomy->update_count_callback ) ) { call_user_func( $taxonomy->update_count_callback, $terms, $taxonomy ); } else { $object_types = (array) $taxonomy->object_type; foreach ( $object_types as &$object_type ) { if ( str_starts_with( $object_type, 'attachment:' ) ) { list( $object_type ) = explode( ':', $object_type ); } } if ( array_filter( $object_types, 'post_type_exists' ) == $object_types ) { // Only post types are attached to this taxonomy. _update_post_term_count( $terms, $taxonomy ); } else { // Default count updater. _update_generic_term_count( $terms, $taxonomy ); } } clean_term_cache( $terms, '', false ); return true; }