my-awesome-plugin icon indicating copy to clipboard operation
my-awesome-plugin copied to clipboard

Saving the settings as serialized array in wp_options

Open zamanq opened this issue 4 years ago • 1 comments

Hello Hardeep Asrani, Nice simple way to integrate React in Theme/Plugin Options page.

Instead of saving each setting as a separate row in the database, I'd like to register a single setting for example 'my_custom_settings' as an array and save all the fields inside it. How can I achieve that in both PHP and React side of things?

Thanks in Advance for your help!

zamanq avatar Oct 06 '20 05:10 zamanq

Hey @zamanq,

Sorry I never got a notification for this. It's similar to how you do it with single option. You just save a JSON string inside the option.

HardeepAsrani avatar Jun 23 '21 13:06 HardeepAsrani