samedi 20 février 2016

Add a button to reset WordPress theme options

I have created a theme options page for a WordPress theme, and I need to add a Reset button to clear all the user defined settings for theme options.

I'm told that this function will do the job,

function reset_mytheme_options() { 
    remove_theme_mods();
}
add_action( 'after_switch_theme', 'reset_mytheme_options' );

But, don't know how to run this function on a button click.

So, will this function do what I needed ? If so, how to run it on a button click ?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire