Home › Forums › Backend Issues (wp-admin) › Conditionally registering field on acf/update_value › Reply To: Conditionally registering field on acf/update_value
Thanks for your suggestion John, but that would require me to know all possible field names in advance (so I could hide/show the correct one conditionally). There are infinite possibilities in my case.
What about using acf_update_field to write the field to the database? From includes/api-field.php:
/*
* acf_update_field
*
* This function will update a field into the DB.
* The returned field will always contain an ID
*
* @type function
* @date 1/10/13
* @since 5.0.0
*
* @param $field (array)
* @return $field (array)
*/
function acf_update_field( $field = false, $specific = false )
I could construct a field object and call this function perhaps?
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.