Home › Forums › General Issues › call function update_field outside WordPress › Reply To: call function update_field outside WordPress
There are some reason that this may not be working.
1) This is not an acf field. Is this a field created by ACF? I’m only asking because it looks like a field for some type of eCommerce plugin.
2) Does this field exist and already have a value before you try to update it? update_field() will only work using the field name if the field already exists. If you are updating a post that does not already have this field then you need to use the field key rather than the field name. When using update_field() it is always better to use the field key and forget about using field names.
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.