black friday sale

Custom Fields
Re-Envisioned
Support MB Settings Page Save option as single value instead of an array?

  • Creator
    Topic
  • #21171
    Content Pilot
    Participant

    I am building a small settings page and want to have direct access to each option versus grabbing all options as an array and pulling out a single option from that array.

    I read the docs and it says the only method right now is to save as an array.

    https://docs.metabox.io/extensions/mb-settings-page/#data

    Is it possible to save the value of the setting to the database as a single value?

    Is there a plan to add this functionality?

    I think this is very similar to how you offer the option to save post meta as an array or single value with 'multiple' => true

    https://docs.metabox.io/database/#cloneable-fields

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #21178
    Long Nguyen
    Moderator

    Hi,

    We also create a notice in the data document section
    It’s the recommended way by WordPress that doesn’t make your options table bloat.
    The extension only supports to save all settings in an array (like the theme options theme_mods_theme-slug) to avoid bloating database.

    But it’s an exciting idea, and I will create a feature request for the developer team to research and support this case.

    #21200
    Content Pilot
    Participant

    I would really appreciate if we could have the option to save as array or string. When we release new versions of our plugin, sometimes we run database updates which are MUCH easier when values live inside single cells, not arrays. I understand WordPress is trying to set a standard to not overload the database. But if you know what you are doing, then there should be an option to have it another way.

    Thanks for adding it to the roadmap.

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