01) Hello Dolly

Plugins can modify the behavior and/or appearance of a website by connecting to “hooks”.

At various times while running, WordPress checks to see whether any plugins have registered functions to run at that time. Then these functions are called.

For instance, if your Plugin needs to add information to the text title, it can register a special function which is called when the the_title filter is called.

Another example is the action hook wp_footer which is checked just before the end of the generated page. Code can be inserted at that place.

Hello Dolly is an example of a plugin adding actions at two different hooks, admin_head and admin_notices.

shortened version of the Hello Dolly plugin, in two different color formatsThe above shows different color formats from two text editors: WP (since v4.9) & BBEdit.

php tag: gray/teal
comment: gold/gray
php: purple/blue
declared function: royalblue/black
called function: black/black
variable: cadetblue/black
string: red/pink