WP_Object_Cache::get_multiple() public WP 5.5.0
Retrieves multiple values from the cache in one call.
{} Это метод класса: WP_Object_Cache{}
Хуков нет.
Возвращает
Массив
. Array of values organized into groups.
Использование
$WP_Object_Cache = new WP_Object_Cache(); $WP_Object_Cache->get_multiple( $keys, $group, $force );
- $keys(массив) (обязательный)
- Array of keys under which the cache contents are stored.
- $group(строка)
- Where the cache contents are grouped.
По умолчанию: 'default' - $force(true|false)
- Whether to force an update of the local cache from the persistent cache.
По умолчанию: false
Список изменений
С версии 5.5.0 | Введена. |
Код WP_Object_Cache::get_multiple() WP Object Cache::get multiple WP 5.7.1
public function get_multiple( $keys, $group = 'default', $force = false ) {
$values = array();
foreach ( $keys as $key ) {
$values[ $key ] = $this->get( $key, $group, $force );
}
return $values;
}