Home › Forums › Front-end Issues › Dynamically Set A Front-End Form Field › Reply To: Dynamically Set A Front-End Form Field
Done and it works! 🙂
You are my hero! The error was coz of a typo on filter (typed it as fitler).
Here is the tweaked code snippet just in case anyone else ever wants to achieve the same thing.
function populate_vacancy_applied_for($field) {
// only on front end
if (is_admin()) {
return $field;
}
if (isset($_GET['vacancy'])) {
$field['value'] = $_GET['vacancy'];
}
return $field;
}
add_filter('acf/prepare_field/key=field_5dba152669aaf', 'populate_vacancy_applied_for');
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.