Plugin_Name_Loader class of the WordPress Plugin Boilerplate is very useful if you must hook into a WordPress action or filter from your plugin. The original author, Tom McFarlin, says the following about the loader:
The goal of this file is to encapsulate the registration of hooks and
then execute both actions and filters at the appropriate time when the
plugin is loaded.
It is often necessary to hook into the appropriate action or filter, so how does one take advantage of the plugin boilerplate’s loader class?