Hidden field getting data from ACF
-
Hello,
https://www.ads-software.com/support/topic/hidden-field-getting-data-from-acf/
I see this thread and I want exactly the same thing. But the code is not working :
<?php add_filter( 'forminator_field_hidden_field_value', function( $value, $saved_value, $field ){ if( ! empty( $field['default_value'] ) && 'custom_value' === $field['default_value'] && strpos( $value, 'acf_' ) !== false ){ $field_keys = explode('acf_', $value ); $post_id = false;//default is current post/page $value = get_field( $field_keys[1], $post_id ); } return $value; }, 10, 3 );
I add this code in the plugin Snippet and select custom value in hidden field, with my acf value : acf_reference_du_circuit.
What am I missing ?
Thank you a lot for your help !
The page I need help with: [log in to see the link]
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Hidden field getting data from ACF’ is closed to new replies.