Changeset 52707 for trunk/src/wp-includes/comment.php
- Timestamp:
- 02/11/2022 06:50:08 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment.php
r52332 r52707 1884 1884 function _clear_modified_cache_on_transition_comment_status( $new_status, $old_status ) { 1885 1885 if ( 'approved' === $new_status || 'approved' === $old_status ) { 1886 $data = array(); 1886 1887 foreach ( array( 'server', 'gmt', 'blog' ) as $timezone ) { 1887 wp_cache_delete( "lastcommentmodified:$timezone", 'timeinfo' ); 1888 } 1888 $data[] = "lastcommentmodified:$timezone"; 1889 } 1890 wp_cache_delete_multiple( $data, 'timeinfo' ); 1889 1891 } 1890 1892 } … … 2046 2048 wp_update_comment_count( $comment_post_ID ); 2047 2049 2050 $data = array(); 2048 2051 foreach ( array( 'server', 'gmt', 'blog' ) as $timezone ) { 2049 wp_cache_delete( "lastcommentmodified:$timezone", 'timeinfo' ); 2050 } 2052 $data[] = "lastcommentmodified:$timezone"; 2053 } 2054 wp_cache_delete_multiple( $data, 'timeinfo' ); 2051 2055 } 2052 2056 … … 3221 3225 */ 3222 3226 function clean_comment_cache( $ids ) { 3223 foreach ( (array) $ids as $id ) {3224 wp_cache_delete( $id, 'comment' );3225 3227 $comment_ids = (array) $ids; 3228 wp_cache_delete_multiple( $comment_ids, 'comment' ); 3229 foreach ( $comment_ids as $id ) { 3226 3230 /** 3227 3231 * Fires immediately after a comment has been removed from the object cache. … … 3251 3255 */ 3252 3256 function update_comment_cache( $comments, $update_meta_cache = true ) { 3257 $data = array(); 3253 3258 foreach ( (array) $comments as $comment ) { 3254 wp_cache_add( $comment->comment_ID, $comment, 'comment' ); 3255 } 3259 $data[ $comment->comment_ID ] = $comment; 3260 } 3261 wp_cache_add_multiple( $data, 'comment' ); 3256 3262 3257 3263 if ( $update_meta_cache ) {
Note: See TracChangeset
for help on using the changeset viewer.