askdesign
10/12/2015 - 12:01 AM

Newbie Guide to WordPress Hooks

Torquemag.io

/** The structure of the hook
add_action ( 'hook_name', 'your_function_name', [priority], [accepted_parameters] );

function your_function_name() {
 // code goes here
 }
 
 /** Example
 add_action('twentyfifteen_credits', 'nick_footer_greeting');

function nick_footer_greeting() {
     echo 'Hi, thanks for coming to my site!';
}
http://torquemag.io/complete-newbie-guide-wordpress-hooks/