Home › Forums › ACF PRO › Front end post update post meta › Reply To: Front end post update post meta
Have you actually tried to dump $_POST ? You then would have seen the contents and would have seen that $_POST[‘selected_model’] does not exist.
To retrieve a posted value, you need to look into $_POST[ ‘acf’ ]. In it you will find the field keys (not the names).
So you need to check what the field key is for your field.
Then do something like this:
if ( ! empty( $_POST[ 'acf' ][ 'field_5a0de683a21cf' ] ) {
update_post_meta($post_id, 'car_model', 'field_key' );
}
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.