Hook if somebody saves plugin options?
I wrote a plugin that has various options and in case the user saves this options a CSS file will be generated. My intention is that the CSS is only created when the options are saved and not when somebody visits the page and the CSS will be created every single time.
So I need a hook that fires when somebody saves the options. I tried it like this:
public function __construct( $file ) {
$this-options = get_option('clb_plugin_options');
add_filter( 'pre_update_option_clb_plugin_options', array( $this, 'generate_options_css' ) );
}
public function generate_options_css() {
[doing all css related stuff)
return $this-options;
}
But in this case it does not take any changes which I made in the form into consideration, as I just save the options in $this->options which are already there. So how can I do it to hook in after someone saves the plugin options...?
Topic settings-api plugins Wordpress
Category Web