Auto save "Switch" field

Support MB Settings Page Auto save "Switch" field

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #38545
    WillWill
    Participant

    Hi, any possibility to auto save when someone trigger on the Switch field instead of click on "save settings"? Thank you.

    #38548
    Long NguyenLong Nguyen
    Moderator

    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/

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