Notes from Introduction to Functions and Hooks (Actions & Filters)

Thank you to everyone who made it out to our November General Meetup. We gave a basic introduction to how you can customize WordPress beyond Themes and Plugins using the WordPress Plugin API (Application Programming Interface)

These hooks allow you to include your own custom code within WordPress to do a myriad of things. You can use Actions to inject code, or compare variables and filters to run your own routine within WordPress (like say to pull data from an external source and format it for WordPress to ingest.

This modularity is what makes WordPress so functional for so many diverse user cases. Any plugin is really just a complicated set of functions that leverage the Plugin API to create Actions or Filters.

We gave a little demo, which I won’t repeat here as it was a little inaccurate. Instead I’d like to point you to a few resources that are far more elegant in presenting the basic concepts.

WebDev Studios has a great article on getting started with hooks with a few inline examples.

Pippin Williamson also has a good introduction to using filters, the more complicated of the two hooks (in my humble opinion).

Of course, there’s always the Codex entry on Hooks and the well-organized Code Reference library.

While a little more technical that our past General Meetup topics, we hope you enjoyed the meetup and look forward to seeing you at a future event!

Photo by Thomas Hawk – Licensed under Creative Commons

Leave a Reply