WordPress plugins use an Application Programming Interface (API) provided within WordPress to make plugin development easier. The API provides hooks, which are means of calling pieces of functionality built into the WordPress core application. For example, in the core of WordPress is functionality for publishing a post. If a plugin wants to execute that functionality, it uses an action hook to call and execute the publish post functionality.
The two types of hooks in the API are
A complete list of action hooks available for plugin development can be found in the WordPress documentation at http://codex.wordpress.org/Plugin_API/Action_Reference. A complete list of filter hooks can be found at http://codex.wordpress.org/Plugin_API/Filter_Reference.
To explore a simple action hook within the API, we analyze the Hello Dolly plugin by Matt Mullenweg. When activated, the Hello Dolly plugin randomly displays a lyric from the song “Hello Dolly!” by Louis Armstrong in the upper right of every page in the WordPress Dashboard.
The following code in the Hello Dolly plugin calls ...