Make WordPress Core


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

Cache: Add wp_cache_*_multiple functions.

Add new caching functions named wp_cache_add_multiple, wp_cache_set_multiple and wp_cache_delete_multiple. All of these functions allow for an array of data to be passed, so that multiple cache objects can be created / edited / deleted in a single function call. This follows on from [47938] where the wp_cache_get_multiple function was introduced and allowed for multiple cache objects to be received in one call.

Props: spacedmonkey, tillkruess, adamsilverstein, flixos90, mitogh, pbearne.
Fixes: #54574.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/pluggable.php

    r51404 r52700  
    296296                        'force' => false,
    297297                    ),
     298                    'wp_cache_set_multiple'              => array(
     299                        'data',
     300                        'group'  => '',
     301                        'expire' => 0,
     302                    ),
     303                    'wp_cache_add_multiple'              => array(
     304                        'data',
     305                        'group'  => '',
     306                        'expire' => 0,
     307                    ),
     308                    'wp_cache_delete_multiple'           => array(
     309                        'keys',
     310                        'group' => '',
     311                    ),
    298312                    'wp_cache_incr'                      => array(
    299313                        'key',
Note: See TracChangeset for help on using the changeset viewer.