Meta Box
Support Forum
Support › MB Settings Page › Auto save "Switch" field
Hi, any possibility to auto save when someone trigger on the Switch field instead of click on "save settings"? Thank you.
Hi Will,
There is no option to save settings after triggering the switch field like that. You might need to create some custom JS code to trigger an ajax action and update the field value via the WordPress function update_option(). Read more on the documentation https://codex.wordpress.org/AJAX_in_Plugins https://developer.wordpress.org/reference/functions/update_option/
update_option()