-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hook for modifying options before they are saved #1897
Comments
Usage add_action('fw_settings_options_update', '_theme_action_settings_options_update');
function _theme_action_settings_options_update($data) {
$option_id = 'my_magic_option';
if ($data['option_id'] !== $option_id) {
return;
}
// prevent recursion
remove_action('fw_settings_options_update', '_theme_action_settings_options_update');
$value = fw_get_db_settings_option($option_id);
$value = mega_extra_magic_function($value);
fw_set_db_settings_option($option_id, $value);
add_action('fw_settings_options_update', '_theme_action_settings_options_update');
} |
@moldcraft Shortcodes options are not covered here, right? |
@andreiglingeanu Shortcodes don't have their database store location (post and term options have a separate post meta |
ghost
mentioned this issue
Aug 26, 2016
This issue was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've looked to in the documentation on your site, but I can't find what I'm looking for.
I need an hook when the options are saved on the post/page / settings page / customizer but before they are saved to the database.
So basically what I need is when the user hits the save button, I need a way to get fresh options before they are saved to the database, so I can to one final manipulation of the data.
Why I need this.
I want to manipulate some options data when the data is saved, so I don't need to manipulate that data in the front end, I can just get the data from the options.
The text was updated successfully, but these errors were encountered: