WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any specific hook that fires when admin setting is saved. I have cached some data from admin back-end setting menu. Now i want to the delete the caching when setting saved in admin menu. Thanks in advance for help.

share|improve this question
up vote 9 down vote accepted

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.

share|improve this answer
Thanks toscho for the help, I looked into the update_option source code and tracked it down. – rabin shrestha Jul 23 '12 at 17:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.