wp_defer_term_counting
Enable or disable term counting.
Description
wp_defer_term_counting( (constant) $defer = null );
Parameters (1)
- 0. $defer — Optional. (constant) =>
null
- Enable if true, disable if false.
Usage
if ( !function_exists( 'wp_defer_term_counting' ) ) { require_once ABSPATH . WPINC . '/taxonomy.php'; } // Optional. Enable if true, disable if false. $defer = null; // NOTICE! Understand what this does before running. $result = wp_defer_term_counting($defer);
Defined (1)
The function is defined in the following location(s).
- /wp-includes/taxonomy.php
- 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;
- }