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

  1. if ( !function_exists( 'wp_defer_term_counting' ) ) { 
  2. require_once ABSPATH . WPINC . '/taxonomy.php'; 
  3.  
  4. // Optional. Enable if true, disable if false. 
  5. $defer = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wp_defer_term_counting($defer); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/taxonomy.php  
  1. function wp_defer_term_counting($defer=null) { 
  2. static $_defer = false; 
  3.  
  4. if ( is_bool($defer) ) { 
  5. $_defer = $defer; 
  6. // flush any deferred counts 
  7. if ( !$defer ) 
  8. wp_update_term_count( null, null, true ); 
  9.  
  10. return $_defer;