HardeepAsrani / my-awesome-plugin

This is an example plugin to create options page in WordPress using components from Gutenberg.
26 stars 13 forks source link

Saving the settings as serialized array in wp_options #7

Open zamanq opened 4 years ago

zamanq commented 4 years ago

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!

HardeepAsrani commented 3 years ago

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.