How to use the save action hooks
What I am trying to do is use these hooks to call to one class function inside my PHP class file. This function deletes some transients I have created.
redux/options/{opt_name}/import redux/options/{opt_name}/reset redux/options/{opt_name}/section/reset redux/options/{opt_name}/saved
I had a look at the Action Hooks page and I don't understand 2 things
- Where can I use the Redux hooks, is there a way to use them outside the options-init/config file?
- How to write my hook. Is there just one 'single' action fired when saving/resetting options, or do I need to write a for loop to handle creating all the various hooks for all the Redux options?
Does there need to be a hook created for each and every option? redux/options/OPTION 1/import , redux/options/OPTION 2/import redux/options/OPTION 1/reset, redux/options/OPTION 2/reset redux/options/OPTION 1/section/reset, redux/options/OPTION 2/section/reset redux/options/OPTION 1/saved, redux/options/OPTION 2/saved
Appreciate your time, thanks.
If you don't understand the concept of action hooks or filters, you'll need to consult the WordPress Codex first. We support Redux only, and don't have the resources to be PHP or WP tutors.
You would set your hooks typically in a php function file. It can be anywhere. The opt_name section of the hook needs to be filled with the opt_name you set in your config file, and not any single option.
We also have numerous examples in the sample-config.php file. ;)
I got it now, got confused on the $opt_name being the instance of Redux and not each and every option.
Thanks