Support

Account

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.