How can i pre fill an ACF Text field with the page title in admin?
Hi @tabzam
You can hook into the acf/load_value
filter and modify the value to your liking. Please read the docs here:
http://www.advancedcustomfields.com/resources/filters/acfload_value/
You can find the title of the post via get_the_title()
Thanks
E
Was just about to ask the same question 🙂
I managed to do it using the following code:
function my_acf_load_value( $value, $post_id, $field ) {
$value = get_the_title();
return $value;
}
add_filter('acf/load_value/name=FIELD_NAME', 'my_acf_load_value', 10, 3);
is this valid for acf_form() too?
i want to prefill some acf with code generated information at the moment of creation but it seems not working.