WordPress-Plugin-Boilerplate
WordPress-Plugin-Boilerplate copied to clipboard
removed specialized loader class. load all hooks in run method instead
I finally had time to revisit the discussion of the loader class. I took as minimal an approach as possible in this refactor. I removed the loader class and load all hooks in the run method. No hooks are defined in the constructor. In fact, all the constructor does it add dependencies and set the name and version. Very streamlined approach.
This also makes it very easy for those who prefer to define their hooks in the child classes. Each define_[whatever]_hooks method can still create the child class but then call a define_hooks() or init() method on that class. Very easy for a developer to choose his or her preference. Thoughts?