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.
2777functionwp_defer_comment_counting($defer=null){2778static$_defer=false;27792780if(is_bool($defer)){2781$_defer=$defer;2782// Flush any deferred counts.2783if(!$defer){2784wp_update_comment_count(null,true);2785}2786}27872788return$_defer;2789}
History
Introduced in 2.5.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
Parsed data
Generated from the wordpress-develop 7.0.4 tag, from src/wp-includes/comment.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.