acf/validate_(hook_name) хук-фильтрACF 5.0.0

Filters the ACF post array to validate settings.

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

add_filter( 'acf/validate_(hook_name)', 'wp_kama_acf_validate_hook_name_filter' );

/**
 * Function for `acf/validate_(hook_name)` filter-hook.
 * 
 * @param array $post The post array.
 *
 * @return array
 */
function wp_kama_acf_validate_hook_name_filter( $post ){
	// filter...
	return $post;
}
$post(массив)
The post array.

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

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

Где вызывается хук

ACF_Internal_Post_Type::validate_post()
acf/validate_(hook_name)
ACF_Post_Type::validate_post()
acf/validate_(hook_name)
acf/includes/class-acf-internal-post-type.php 291
return apply_filters( "acf/validate_{$this->hook_name}", $post );
acf/includes/post-types/class-acf-post-type.php 317
return apply_filters( "acf/validate_{$this->hook_name}", $post );

Где используется хук в Advanced Custom Fields PRO

acf/includes/acf-field-functions.php 346
add_action( 'acf/validate_field', 'acf_translate_field' );
acf/includes/class-acf-internal-post-type.php 82
add_action( "acf/validate_{$this->hook_name}", array( $this, 'translate_post' ) );
acf/includes/compatibility.php 34
add_filter( 'acf/validate_field', array( $this, 'validate_field' ), 20, 1 );
acf/includes/compatibility.php 35
add_filter( 'acf/validate_field/type=textarea', array( $this, 'validate_textarea_field' ), 20, 1 );
acf/includes/compatibility.php 36
add_filter( 'acf/validate_field/type=relationship', array( $this, 'validate_relationship_field' ), 20, 1 );
acf/includes/compatibility.php 37
add_filter( 'acf/validate_field/type=post_object', array( $this, 'validate_relationship_field' ), 20, 1 );
acf/includes/compatibility.php 38
add_filter( 'acf/validate_field/type=page_link', array( $this, 'validate_relationship_field' ), 20, 1 );
acf/includes/compatibility.php 39
add_filter( 'acf/validate_field/type=image', array( $this, 'validate_image_field' ), 20, 1 );
acf/includes/compatibility.php 40
add_filter( 'acf/validate_field/type=file', array( $this, 'validate_image_field' ), 20, 1 );
acf/includes/compatibility.php 41
add_filter( 'acf/validate_field/type=wysiwyg', array( $this, 'validate_wysiwyg_field' ), 20, 1 );
acf/includes/compatibility.php 42
add_filter( 'acf/validate_field/type=date_picker', array( $this, 'validate_date_picker_field' ), 20, 1 );
acf/includes/compatibility.php 43
add_filter( 'acf/validate_field/type=taxonomy', array( $this, 'validate_taxonomy_field' ), 20, 1 );
acf/includes/compatibility.php 44
add_filter( 'acf/validate_field/type=date_time_picker', array( $this, 'validate_date_time_picker_field' ), 20, 1 );
acf/includes/compatibility.php 45
add_filter( 'acf/validate_field/type=user', array( $this, 'validate_user_field' ), 20, 1 );
acf/includes/compatibility.php 46
add_filter( 'acf/validate_field_group', array( $this, 'validate_field_group' ), 20, 1 );
acf/includes/fields/class-acf-field-image.php 51
add_filter( 'acf/validate_attachment/type=image', 'acf_validate_is_image_attachment', 10, 5 );
acf/includes/forms/form-front.php 44
add_action( 'acf/validate_save_post', array( $this, 'validate_save_post' ), 1 );
acf/includes/forms/form-gutenberg.php 37
add_action( 'acf/validate_save_post', array( $this, 'acf_validate_save_post' ), 999 );
acf/includes/forms/form-nav-menu.php 35
add_action( 'acf/validate_save_post', array( $this, 'acf_validate_save_post' ), 5 );
acf/includes/forms/form-widget.php 48
add_action( 'acf/validate_save_post', array( $this, 'acf_validate_save_post' ), 5 );
acf/includes/revisions.php 32
add_filter( 'acf/validate_post_id', array( $this, 'acf_validate_post_id' ), 10, 2 );
acf/includes/validation.php 40
add_action( 'acf/validate_save_post', array( $this, 'acf_validate_save_post' ), 5 );
acf/pro/fields/class-acf-field-gallery.php 65
add_filter( 'acf/validate_attachment/type=gallery', 'acf_validate_is_image_attachment', 10, 5 );