In a previous section, we explore how plugins interact with WordPress by using the plugin API. Here, we show you how functions are defined in a plugin. In PHP, a function is a predefined set of commands carried out when the function is called. It's the same in WordPress; some functions are common PHP functions, and some functions are specific to WordPress. We discuss how to hook into these functions through the plugin API so that you can call existing commands instead of having to write them over again in your plugin. However, you can also write your own functions and call them in your plugin.
So how do you identify functions within a plugin? Here's an example from the Hello Dolly plugin; this code function is found at the bottom, as the last line of the plugin file: hello.php:
The WordPress Codex documentation describes the add_action function as having the following arguments, or parameters:
add_action( $tag, $function_to_add, $priority, $accepted_args );
In PHP code, the dollar sign, $