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.
2708functionwp_defer_comment_counting($defer=null){2709static$_defer=false;27102711if(is_bool($defer)){2712$_defer=$defer;2713// Flush any deferred counts.2714if(!$defer){2715wp_update_comment_count(null,true);2716}2717}27182719return$_defer;2720}
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 6.8.8 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.