A WordPress-centric search engine for devs and theme authors



_wp_prevent_term_counting ›

Since5.6.0
Deprecatedn/a
_wp_prevent_term_counting ( $new_setting = null )
Parameters:
  • (bool) $new_setting The new setting for preventing term counts.
    Required: No
    Default: null
Returns:
  • (bool) Whether term count prevention is enabled or disabled.
Defined at:
Codex:

Prevents add/removing a term from modifying a term count.

This is used by functions calling wp_transition_post_status() to indicate the term count will be handled during the post's transition.


Source

function _wp_prevent_term_counting( $new_setting = null ) {
	static $prevent = false;

	if ( is_bool( $new_setting ) ) {
		$prevent = $new_setting;
	}

	return $prevent;
}