Home › Forums › General Issues › CPT ACF Fields not working with ID parameter › Reply To: CPT ACF Fields not working with ID parameter
After some digging through the ACF API files, I tested the acf_get_valid_post_id
function. When no ID is passed into the function, the ID that gets returned looks something like block_[RANDOM STRING]
. When an ID is passed into the function, the ID that was passed in just gets returned.
When I use that block string as the ID parameter, everything actually works as expected. My current predicament now is retrieving those block string keys dynamically through the wordpress post ID because currently, I can only get those keys when no post ID is provided (So it only works on the specific post page itself).
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.