acf/conditional_logic/choices filter-hookACF 6.3.0

Filters the choices available for a conditional logic rule.

Usage

add_filter( 'acf/conditional_logic/choices', 'wp_kama_acf_conditional_logic_choices_filter', 10, 3 );

/**
 * Function for `acf/conditional_logic/choices` filter-hook.
 * 
 * @param array $choices           The available choices.
 * @param array $conditional_field The field object for the conditional field.
 * @param mixed $value             The value of the rule.
 *
 * @return array
 */
function wp_kama_acf_conditional_logic_choices_filter( $choices, $conditional_field, $value ){
	// filter...
	return $choices;
}
$choices(array)
The available choices.
$conditional_field(array)
The field object for the conditional field.
$value(mixed)
The value of the rule.

Changelog

Since 6.3.0 Introduced.

Where the hook is called

In file: /includes/admin/views/acf-field-group/conditional-logic.php
acf/conditional_logic/choices
acf/includes/admin/views/acf-field-group/conditional-logic.php 162
$choices = apply_filters( 'acf/conditional_logic/choices', array( $rule['value'] => $rule['value'] ), $conditional_field, $rule['value'] );

Where the hook is used in Advanced Custom Fields PRO

acf/includes/fields/class-acf-field-page_link.php 47
add_filter( 'acf/conditional_logic/choices', array( $this, 'render_field_page_link_conditional_choices' ), 10, 3 );
acf/includes/fields/class-acf-field-post_object.php 42
add_filter( 'acf/conditional_logic/choices', array( $this, 'render_field_post_object_conditional_choices' ), 10, 3 );
acf/includes/fields/class-acf-field-relationship.php 41
add_filter( 'acf/conditional_logic/choices', array( $this, 'render_field_relation_conditional_choices' ), 10, 3 );
acf/includes/fields/class-acf-field-taxonomy.php 54
add_filter( 'acf/conditional_logic/choices', array( $this, 'render_field_taxonomy_conditional_choices' ), 10, 3 );
acf/includes/fields/class-acf-field-user.php 41
add_filter( 'acf/conditional_logic/choices', array( $this, 'render_field_user_conditional_choices' ), 10, 3 );