Support

Account

Home Forums Add-ons Gallery Field Removing images from a repeater or gallery field

Helping

Removing images from a repeater or gallery field

  • To remove a value from the repeater or gallery field, how would you go about this from the front-end of wordpress? I assume the delete_field() API function is purely to remove the field completely!

  • Hi @vividentity

    Yes. Instead, please use the update_field function. This will override the old value with the new value.

    To update the gallery field, just provide the $value as an array of attachment ID’s.

    To update a repeater field, just provide the $value as a multi-dimensional array containing rows of data which contain the sub field values.

    You can read more on the docs page

    Thanks
    E

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

The topic ‘Removing images from a repeater or gallery field’ is closed to new replies.