Make WordPress Core


Ignore:
Timestamp:
02/11/2022 06:50:08 PM (3 years ago)
Author:
spacedmonkey
Message:

Cache: Use wp_cache_*_multiple() in core functions.

Implement the wp_cache_add_multiplewp_cache_set_multiple and wp_cache_delete_multiple in a number of core functions after they were introduced in [52700]

Props: spacedmonkey, adamsilverstein, flixos90, mitogh.
Fixes: #55029.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-comment-query.php

    r52332 r52707  
    10591059                }
    10601060
     1061                $data = array();
    10611062                foreach ( $parent_map as $parent_id => $children ) {
    1062                     $cache_key = "get_comment_child_ids:$parent_id:$key:$last_changed";
    1063                     wp_cache_set( $cache_key, $children, 'comment' );
    1064                 }
     1063                    $cache_key          = "get_comment_child_ids:$parent_id:$key:$last_changed";
     1064                    $data[ $cache_key ] = $children;
     1065                }
     1066                wp_cache_set_multiple( $data, 'comment' );
    10651067            }
    10661068
Note: See TracChangeset for help on using the changeset viewer.