I would like to have this option too. As my menu is complex and very dynamic. I don’t use Location for getting menu items, rather wp_get_nav_menu_items(). An item title would be retrieved as an object property $item->title, and so I would like to be able to retrieve ACFs.
Hi, Can you post an example of the full code. I’m really struggling..
$field = jQuery(
What should I write here - Field type, name, id ? with quotes or without ?
);
And should I change the field here or location of acf/validate_field:
jQuery(document).on('acf/validate_field', function( e, field ){
I want to get a simple dummy false validation to check if it is working:
jQuery(document).on('acf/validate_field', function( e, field ){
$field = jQuery(field);
$field.data('validation', false);
});
Notes:
I have hooked the .js file like this:
add_action( 'wp_enqueue_scripts', 'my_enqueue_styles_scripts' );
function my_enqueue_styles_scripts() {
wp_enqueue_script( 'acf-custom-validation', get_template_directory_uri() .'/js/acf-validation.js', array( 'acf-input' ) );
}