• Resolved Alex

    (@flyjam)


    Hi! Is it possible to store all fields data inside a certain metabox in one database row as a serialized arrray? The fields are not repeatable and not inside groups.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Closest way I can think of for this would be to intercept things during the save process, and concat/combine into one field, and then delete the other meta fields at the same time. However, I do have to wonder why you’re aiming for this method, as custom fields have been along this same level of thinking since before I can remember.

    Thread Starter Alex

    (@flyjam)

    I’ll have large number of parameters (15-20) per post. I don’t need them to be searchable at all as they are only to override global options and to setup the posts layout. In case of many thousands of posts, all these meta fields will generate significant amount of wp_postmeta records. I don’t think it’s good for performace and efficiency points of view. This is the reason I’m prone to store these post options serialized.

    • This reply was modified 8 years, 2 months ago by Alex.
    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    The closest I can think of, would be adding all the fields to a group, and setting the group to not be repeatable. I know the groups get saved as one row, but having individual fields will do individual rows.

    Thread Starter Alex

    (@flyjam)

    Yes, thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Strore all fields within a metabox as an array’ is closed to new replies.