Home › Forums › General Issues › Dynamic value for message field › Reply To: Dynamic value for message field
I came to a similar conclusion and ended up with this:
if ( is_page( 'edit-ad' ) ) {
if ( isset( $_GET['id'] ) ) {
$ad_id = $_GET['id'];
$location_values = get_field( 'sd_city_selector', $ad_id );
$field['instructions'] = '<strong>Your location is: ' . $location_values['cityNameAscii'] . ' (' . $location_values['countryCode'] . ')</strong>';
}
}
I wanted to populate a message field, but for space I decided to use the instructions field instead.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.