Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress WordPress Hooks - Actions and Filters An Overview of Hooks in WordPress Searching WordPress Core

Cristian-Adrian Frasineanu
Cristian-Adrian Frasineanu
5,101 Points

Can we make this assumption?

I believe this is stunningly similar to the event/listener model. Basically when we use do_action(), let's say, we trigger all the listeners that were tied in to that event when the function is called so the hook is fired? The listeners would be all the functions tied to a certain hook.

3 Answers

Sue Dough
Sue Dough
35,800 Points

Yes thats correct. A simple example:

You email the admin of the site when a pending post comes into WordPress. That function to email the admin gets called right when the (event) post goes pending.

Zhenlin Jin
PLUS
Zhenlin Jin
Courses Plus Student 167 Points

Zac apparently doesn't know what he's talking about. He focuses too much on the use of editor, drop-down manual and all that non-sense gimmicky stuff, without mentioning what's really important to learn about WordPress core. As a Computer Science student, I don't want to waste time listening to all that nonsense

Cristina Rosales
Cristina Rosales
10,929 Points

Sassy. Let's all bow down to your elitism.