The do_action function finds out about the functions it should include by a sibling function named add_action, which creates a list of all functions. You can thing of add_action as the boss and do_action as the worker. This function, like its sibling, is a predefined function in WordPress, so you only need to call it. This function call is often included next to the function definition its mentioning. The following is an example of defining my_new_code and asks WordPress to hook it on:
<?php
function my_new_code($name) {
echo “Hello ” . $name;
}
add_action(’the_location’, ‘my_new_code’);
?>