Custom Fields
Re-Envisioned
Support MB REST API Is it possible to create a Metabox Group type metabox through API?

This topic contains 1 reply, has 2 voices, and was last updated by  Anh Tran 5 months, 2 weeks ago.

  • Creator
    Topic
  • #11240

    Keen Limited
    Participant

    Hello,

    I searched a bit around but did not find a mention or a solution to this. If this is currently not possible, what options do we have to create grouped metaboxes programmatically so end user can then easily edit from backend?

    Thanks!

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #11254

    Anh Tran
    Keymaster

    Hello,

    It’s relatively simple. You just need to:

    • Send a POST request to the endpoint to update a post .
    • In the array of parameter sent to the server, add a field meta_box to store all custom fields’ values, including groups.
    • Put array of group’s value into the meta_box field. Remember to format the group value properly, e.g. an array of sub-field’s value. In short, send the data in the format when you click the Publish button in the frontend.

    Then the plugin will handle the rest and update the post with correct value.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.