wp_defer_term_counting( bool $defer = null ): bool

Enables or disables term counting.

Parameters

$deferbooloptional
Enable if true, disable if false.

Default:null

Return

bool Whether term counting is enabled or disabled.

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

Changelog

VersionDescription
2.5.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.