Hello ACF community!
I’m looking for a correct way to use a variable that the user can set on an option on that same option page.
Say the theme user can type in a username in an option-field and when they save their new option I would like to give them a link that is based on their username directly on the option page. In effect I need to be able to grab that variable directly on the option page and display it.
Is there a way to create that?
Thanks in advance!
add a message field “my_message_field”
Add an acf/prepare_field filter for the message
add_filter('acf/prepare_field/name=my_message_field', 'prepare_my_message_field');
function prepare_my_message_field($field) {
//set message based on another field
$field['message'] = get_field('my_other_field', 'options');
return $field;
}