Last active
September 2, 2017 16:27
-
-
Save gicolek/212d1b49cc7fdb684807 to your computer and use it in GitHub Desktop.
Do Action explained
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // this can be placed anywhere in the plugin (before storing the form values in the database) | |
| // $form_data could be an array of data which was created by the user | |
| do_action('my_action_after_save', $form_data); | |
| // we're telling wordpress to execute the code added in the second parameter method right where do_action has been specified | |
| add_action('my_action_after_save', 'my_action_after_save_hook', 10); | |
| /** | |
| * Use the form data and send it over to mailchimp | |
| * @hook my_action_after_save | |
| */ | |
| function my_action_after_save_hook($form_data){ | |
| // write a code to collect the user submitted values and send it over to mailchimp | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment