acf_add_action_variations()ACF 5.7.11

acf_add_action_variations

Registers variations for the given action.

Хуков нет.

Возвращает

null. Ничего.

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

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

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

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

Код acf_add_action_variations() ACF 5.10.2

function acf_add_action_variations( $action = '', $variations = array(), $index = 0 ) {

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

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