Home Forums General Issues ubable to Update sub field by smio api plugin


ubable to Update sub field by smio api plugin

  • I want to post a new post in my blog via smio WordPress api solutions plugin and want to update custom field and sub field. i can update custom field but unable to sub post field.


    this is the way i want to post. but the problem is adding sub field by metakey.

    please view the section

    and tell me to json string by which i can add custom sub field also.


    but it does not work. please help me.

  • In order to use this other plugin you need to understand how all of the various fields in ACF are stored. Updating a field in ACF requires 2 entries in the database. One for the meta_key, which is the same as the field name and the second for the ACF field key reference.

                   meta key = $field_name      = the value of your field
    acf field key reference = "_{$field_name}" = the acf field key

    Updating a value without the field key reference will work for basic fields that only store basic text values. This includes Text, Text Area, Number, Email, URL, Password, WISIWYG

    All other fields will not work correctly if the field key reference is not in the database.

    Repeater fields are a special case. A repeater field stores many values.

    meta_key | value
    "{$repeater_field_name}"                            | number of rows in repeater
    "{$repeater_field_name}_{$index}_{$sub_field_name}" | value of one sub field

    And each has an ACF reference field

    meta_key | value
    "_{$repeater_field_name}"                            | field key of repeater
    "_{$repeater_field_name}_{$index}_{$sub_field_name}" | field key of sub field

    On top of this, depending on the type of sub field, if it is not a basic text field type then your values will also need to conform to how ACF stores the values for each of these fields.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.