Changeset 6532 for trunk/wp-includes/comment.php
- Timestamp:
- 01/01/2008 05:03:52 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/comment.php
r6364 r6532 492 492 } 493 493 494 495 function wp_update_comment_count($post_id) { 494 function wp_defer_comment_counting($defer=NULL) { 495 static $_defer = false; 496 497 if ( is_bool($defer) ) { 498 $_defer = $defer; 499 // flush any deferred counts 500 if ( !$defer ) 501 wp_update_comment_count( NULL, true ); 502 } 503 504 return $_defer; 505 } 506 507 function wp_update_comment_count($post_id, $do_deferred=false) { 508 static $_deferred = array(); 509 510 if ( $do_deferred ) { 511 $_deferred = array_unique($_deferred); 512 foreach ( $_deferred as $i => $_post_id ) { 513 wp_update_comment_count_now($_post_id); 514 unset( $_deferred[$i] ); 515 } 516 } 517 518 if ( wp_defer_comment_counting() ) { 519 $_deferred[] = $post_id; 520 return true; 521 } 522 elseif ( $post_id ) { 523 return wp_update_comment_count_now($post_id); 524 } 525 526 } 527 528 function wp_update_comment_count_now($post_id) { 496 529 global $wpdb; 497 530 $post_id = (int) $post_id;
Note: See TracChangeset
for help on using the changeset viewer.