wc_cache_get_multiple()WC 1.0

Polyfill for wp_cache_get_multiple for WP versions before 5.5.

Хуков нет.

Возвращает

Массив|true|false. Array of values.

Использование

wc_cache_get_multiple( $keys, $group, $force );
$keys(массив) (обязательный)
Array of keys to get from group.
$group(строка)
Where the cache contents are grouped.
По умолчанию: ''
$force(true|false)
Whether to force an update of the local cache from the persistent cache.
По умолчанию: false

Код wc_cache_get_multiple() WC 8.7.0

function wc_cache_get_multiple( $keys, $group = '', $force = false ) {
	if ( function_exists( 'wp_cache_get_multiple' ) ) {
		return wp_cache_get_multiple( $keys, $group, $force );
	}
	$values = array();
	foreach ( $keys as $key ) {
		$values[ $key ] = wp_cache_get( $key, $group, $force );
	}
	return $values;
}