On this page
wp_defer_term_counting( bool $defer = null ): bool
Enables or disables term counting.
Parameters
$deferbool Optional-
Enable if true, disable if false.
Default:
null
Return
bool Whether term counting is enabled or disabled.
Source
File: wp-includes/taxonomy.php. View all references
function wp_defer_term_counting( $defer = null ) {
static $_defer = false;
if ( is_bool( $defer ) ) {
$_defer = $defer;
// Flush any deferred counts.
if ( ! $defer ) {
wp_update_term_count( null, null, true );
}
}
return $_defer;
}
Related
Uses
| Uses | Description |
|---|---|
| wp_update_term_count() wp-includes/taxonomy.php | Updates the amount of terms in taxonomy. |
Used By
| Used By | Description |
|---|---|
| wp_nav_menu_update_menu_items() wp-admin/includes/nav-menu.php | Saves nav menu items |
| wp_update_term_count() wp-includes/taxonomy.php | Updates the amount of terms in taxonomy. |
Changelog
| Version | Description |
|---|---|
| 2.5.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_defer_term_counting