WP_Object_Cache::delete_multiple() WordPress Method

The WP_Object_Cache::delete_multiple() method is used to delete multiple cached objects in a single operation. This is useful for deleting objects that are no longer needed or for clearing the entire cache.

WP_Object_Cache::delete_multiple( array $keys, string $group = '' ) #

Deletes multiple values from the cache in one call.


Parameters

$keys

(array)(Required)Array of keys to be deleted.

$group

(string)(Optional) Where the cache contents are grouped.

Default value: ''


Top ↑

Return

(bool[]) Array of return values, grouped by key. Each value is either true on success, or false if the contents were not deleted.


Top ↑

Source

File: wp-includes/class-wp-object-cache.php

	public function delete_multiple( array $keys, $group = '' ) {
		$values = array();

		foreach ( $keys as $key ) {
			$values[ $key ] = $this->delete( $key, $group );
		}

		return $values;
	}


Top ↑

Changelog

Changelog
VersionDescription
6.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.