Changeset 52700 for trunk/src/wp-includes/class-wp-object-cache.php
- Timestamp:
- 02/11/2022 12:50:54 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-object-cache.php
r49692 r52700 325 325 326 326 /** 327 * Delete multiple values from the cache in one call. 328 * 329 * @since 6.0.0 330 * 331 * @param array $keys Array of keys to be deleted. 332 * @param string $group Optional. Where the cache contents are grouped. Default empty. 333 * @return array Array of return values. 334 */ 335 public function delete_multiple( array $keys, $group = '' ) { 336 $values = array(); 337 338 foreach ( $keys as $key ) { 339 $values[ $key ] = $this->delete( $key, $group ); 340 } 341 342 return $values; 343 } 344 345 /** 346 * Add multiple values to the cache in one call. 347 * 348 * @since 6.0.0 349 * 350 * @param array $data Array of key and value to be added. 351 * @param string $group Optional. Where the cache contents are grouped. Default empty. 352 * @param int $expire Optional. When to expire the cache contents, in seconds. Default 0 (no expiration). 353 * @return array Array of return values. 354 */ 355 public function add_multiple( array $data, $group = '', $expire = 0 ) { 356 $values = array(); 357 358 foreach ( $data as $key => $value ) { 359 $values[ $key ] = $this->add( $key, $value, $group, $expire ); 360 } 361 362 return $values; 363 } 364 365 /** 366 * Set multiple values to the cache in one call. 367 * 368 * @since 6.0.0 369 * 370 * @param array $data Array of key and value to be set. 371 * @param string $group Optional. Where the cache contents are grouped. Default empty. 372 * @param int $expire Optional. When to expire the cache contents, in seconds. Default 0 (no expiration). 373 * @return array Array of return values. 374 */ 375 public function set_multiple( array $data, $group = '', $expire = 0 ) { 376 $values = array(); 377 378 foreach ( $data as $key => $value ) { 379 $values[ $key ] = $this->set( $key, $value, $group, $expire ); 380 } 381 382 return $values; 383 } 384 385 /** 327 386 * Increments numeric cache item's value. 328 387 *
Note: See TracChangeset
for help on using the changeset viewer.