Ticket #34977: 34977-in-function.diff
File 34977-in-function.diff, 1.1 KB (added by , 8 years ago) |
---|
-
src/wp-includes/comment.php
2010 2010 * @param bool $do_deferred Whether to process previously deferred post comment counts 2011 2011 * @return bool|void True on success, false on failure 2012 2012 */ 2013 function wp_update_comment_count( $post_id, $do_deferred=false) {2013 function wp_update_comment_count( $post_id, $do_deferred = false ) { 2014 2014 static $_deferred = array(); 2015 2015 2016 $post_id = (int) $post_id; 2017 if ( ! $post_id ) { 2018 return false; 2019 } 2020 2016 2021 if ( $do_deferred ) { 2017 $_deferred = array_unique( $_deferred);2022 $_deferred = array_unique( $_deferred ); 2018 2023 foreach ( $_deferred as $i => $_post_id ) { 2019 wp_update_comment_count_now( $_post_id);2024 wp_update_comment_count_now( $_post_id ); 2020 2025 unset( $_deferred[$i] ); /** @todo Move this outside of the foreach and reset $_deferred to an array instead */ 2021 2026 } 2022 2027 } … … 2026 2031 return true; 2027 2032 } 2028 2033 elseif ( $post_id ) { 2029 return wp_update_comment_count_now( $post_id);2034 return wp_update_comment_count_now( $post_id ); 2030 2035 } 2031 2036 2032 2037 }