Trying to understand WordPress Plugin Boilerplate

Solution:

First: Do not use this WordPress Plugin Boilerplate until you learn how to make a WordPress plugin the ordinary WordPress way. The boilerplate you found is complicating things for a beginner.

Google for any beginner document on how to write a wordpress plugin. And read the WordPress official documentation on Actions, Hooks, and Filters. These are sort of the staple for how WordPress works.

Here’s a very glossy overview: When you want WordPress to run your plugin, you create an entrypoint function for your plugin. Then you call add_action() to register your function with WordPress. Then WordPress will run your function. Just google for some beginner documentation to learn how to make a plugin and it should show you examples of all this.

Secondly: It looks like the plugin boilerplate is just giving you a pattern for defining a bunch of actions that will be added to the wordpress actions via the foreach loop in the run() function.

There is no overriding going on here. WordPress uses a functional programming paradigm. You don’t normally work with objects when you interact with WordPress. Instead, WordPress simply offers a bunch of globally available functions that you call to do things with it. Two of these functions are add_filter() and add_action().

Resource: Here is a link I found that contains a bunch of tutorials and references for creating wordpress plugins: https://www.wpbeginner.com/wp-tutorials/how-to-create-a-wordpress-plugin/