I am working on a WordPress plugin and I want to fire a different action based on each option value change. so how can I do that ?
Example:
$options = get_option('ACP_settings'); if $options['acp-select'] has changed from previous value than I want to fire different action based on selection
Please note that $option['acp-select']
is retrieved from select/option html form
and has following values for selection:'book','air','SW','HW'
and etc….
I hope I have posted my question clearly.
thanks for help
You can use wordpress hooks in the update_option() function.
In your case you can use
updated_option
orupdate_option_{$option}
hooks.The code for
ACP_settings
option would look like: