WP_AI_Client_Cache::setMultiple
Persists a set of key => value pairs in the cache, with an optional TTL.
Метод класса: WP_AI_Client_Cache{}
Хуков нет.
Возвращает
bool. True on success and false on failure.
Использование
$WP_AI_Client_Cache = new WP_AI_Client_Cache(); $WP_AI_Client_Cache->setMultiple( $values, $ttl ): bool;
- $values(обязательный)
- .
- $ttl(null|int|DateInterval)
- The TTL value of this item.
По умолчанию:null
Список изменений
| С версии 7.0.0 | Введена. |
Код WP_AI_Client_Cache::setMultiple() WP AI Client Cache::setMultiple WP 7.1.4
public function setMultiple( $values, $ttl = null ): bool {
$values_array = $this->iterable_to_array( $values );
$expire = $this->ttl_to_seconds( $ttl );
$results = wp_cache_set_multiple( $values_array, $this->get_cache_group(), $expire );
// Return true only if all operations succeeded.
return ! in_array( false, $results, true );
}