Hook that fires when admin setting is saved

There is the filter 'pre_update_option_' . $option. You have to know the option name. Options can be updated from front-end too, so WordPress doesn’t make a difference here.

Then there is an action: 'update_option', you get the arguments $option, $oldvalue and $_newvalue.

Finally, if the update went successful, you get two further actions:

do_action( "update_option_{$option}", $oldvalue, $_newvalue );
do_action( 'updated_option', $option, $oldvalue, $_newvalue );

See the source code of update_option() for details.

Leave a Comment