DevinVinson / WordPress-Plugin-Boilerplate

[WordPress] A foundation for WordPress Plugin Development that aims to provide a clear and consistent guide for building your plugins.
http://wppb.io
7.67k stars 2.25k forks source link

Example of adding hook to plugin loader class? #230

Closed mandiwise closed 9 years ago

mandiwise commented 9 years ago

Please forgive my ignorance (or perhaps, oversight) but is there an example available of how you would add a basic action/filter within the loader class? The readme mentions "The example code provided shows how to register your hooks with the Loader class" but I'm not completely clear on what/where the example is. I'm assuming there's going to be giant array of hook-related arrays in there somewhere? And there's also a note in public and admin classes about calling instances of them inside the run() function...? Thanks for the clarification.

nathanmarks commented 9 years ago

Checkout line 151 in this file: https://github.com/tommcfarlin/WordPress-Plugin-Boilerplate/blob/master/plugin-name/trunk/includes/class-plugin-name.php#L151

mandiwise commented 9 years ago

Wow, facepalm moment. I completely missed that, thanks!

nathanmarks commented 9 years ago

No problem!