how to save image field vaues in serilazed format in the database

Support General how to save image field vaues in serilazed format in the database

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #39267
    brkardbrkard
    Participant

    Hi.
    metabox image upload fields save image ids in seperate values in the database.
    Like this:
    image_upload_mb: 937
    image_upload_mb: 938
    etc...

    But if we try to upload 200 images this makes big data in the database. 200 Lines in the database seems too much for every post.

    Is there a way to save image fields values in serilazed format like this:
    image_upload: 4:{i:0;s:3:"937";i:1;s:3:"938";i:2;s:3:"939";i:3;s:3:"940";}

    Or is there a plan to change this behavior for the image upload fields like ACF ?

    Thanks

    #39273
    PeterPeter
    Moderator

    Hello,

    It is the design of the image fields when saving each value in one row to the database. If you want to save values in serialized format, please consider using the custom table or registering it as a subfield in a group field. Please read more on the documentation
    https://docs.metabox.io/extensions/mb-custom-table/
    https://docs.metabox.io/extensions/meta-box-group/

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.