acf_add_filter_variations()ACF 5.7.11

acf_add_filter_variations

Registers variations for the given filter.

Хуков нет.

Возвращает

null. Ничего.

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

acf_add_filter_variations( $filter, $variations, $index );
$filter(строка)
The filter name.
По умолчанию: ''
$variations(массив)
An array variation keys.
По умолчанию: array()
$index(int)
The param index to find variation values.

Список изменений

С версии 5.7.11 Введена.

Код acf_add_filter_variations() ACF 5.10.2

function acf_add_filter_variations( $filter = '', $variations = array(), $index = 0 ) {

	// Store replacement data.
	acf_get_store( 'hook-variations' )->set(
		$filter,
		array(
			'type'       => 'filter',
			'variations' => $variations,
			'index'      => $index,
		)
	);

	// Add generic handler.
	// Use a priotiry of 10, and accepted args of 10 (ignored by WP).
	add_filter( $filter, '_acf_apply_hook_variations', 10, 10 );
}