A WordPress-centric search engine for devs and theme authors



wp_defer_term_counting ›

Since2.5.0
Deprecatedn/a
wp_defer_term_counting ( $defer = null )
Parameters:
  • (bool) $defer Optional. Enable if true, disable if false.
    Required: No
    Default: null
Returns:
  • (bool) Whether term counting is enabled or disabled.
Defined at:
Codex:

Enable or disable term counting.



Source

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;
}