wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



wp_defer_comment_counting › WordPress Function

Da2.5.0
Deprecaton/a
wp_defer_comment_counting ( $defer = null )
Parametri:
  • (bool) $defer
    Richiesto: No
    Default: null
Ritorna:
  • (bool)
Definito a:
Codex:

Determines whether to defer comment counting.

When setting $defer to true, all post comment counts will not be updated until $defer is set to false. When $defer is set to false, then all previously deferred updated post comment counts will then be automatically updated without having to call wp_update_comment_count() after.


Sorgenti

function wp_defer_comment_counting( $defer = null ) {
	static $_defer = false;

	if ( is_bool( $defer ) ) {
		$_defer = $defer;
		// Flush any deferred counts.
		if ( ! $defer ) {
			wp_update_comment_count( null, true );
		}
	}

	return $_defer;
}