Home › Forums › Front-end Issues › Field values not displaying in front-end form › Reply To: Field values not displaying in front-end form
It should default to the current post ID, if ACF can figure out what the current post ID is.
First is tries get_the_ID()
, then it tries get_queried_object()
. It it can’t figure out the post ID then it defaults to “options”
You can test what ACF is getting by calling the function.
$post_id = acf_get_valid_post_id();
echo $post_id;
It really depends on where you’re trying to put the form.
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.