Skip to content

Commit 1444cf4

Browse files
swissspidyclaude
andcommitted
Defer comment counting, not term counting, in comment delete --all
wp_defer_term_counting() was called by mistake, so comment counts were still recalculated after every deletion and the term counting flag was restored to the comment counting state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UWTd5pwpi2xQfDA6mUYkkx
1 parent 4656949 commit 1444cf4

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎src/Comment_Command.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -684,9 +684,9 @@ public function delete( $args, $assoc_args ) {
684684

685685
$status = 0;
686686

687-
$defer_term_counting = wp_defer_comment_counting();
687+
$defer_comment_counting = wp_defer_comment_counting();
688688
if ( $all ) {
689-
wp_defer_term_counting( true );
689+
wp_defer_comment_counting( true );
690690
}
691691

692692
$total = count( $args );
@@ -712,7 +712,7 @@ public function delete( $args, $assoc_args ) {
712712
}
713713

714714
if ( $all ) {
715-
wp_defer_term_counting( $defer_term_counting );
715+
wp_defer_comment_counting( $defer_comment_counting );
716716
}
717717

718718
if ( 0 === $status ) {

0 commit comments

Comments
 (0)