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.
2676functionwp_defer_comment_counting($defer=null){2677static$_defer=false;26782679if(is_bool($defer)){2680$_defer=$defer;2681// Flush any deferred counts.2682if(!$defer){2683wp_update_comment_count(null,true);2684}2685}26862687return$_defer;2688}
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.7.7 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.