Created
January 19, 2017 08:44
-
-
Save hsleonis/10494f39b0fc82236dc9a61cd2c60cdd to your computer and use it in GitHub Desktop.
WP pass arguments to action function
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 | |
| // Hook function with action | |
| // add_action( hook_id, func_name, priority, number_of_arguments ) | |
| add_action('thesis_hook_before_post','recent_post_by_author',10,2); | |
| function function_name ( $arg1, $arg2 ) { | |
| /* do stuff here */ | |
| } | |
| // At the place of action | |
| do_action( 'name-of-action', $arg1, $arg2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment