O'Reilly logo

WordPress Complete by Hasin Hayder

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hooks

Hooks are the main means through which plug-ins work. Hooks are a kind of event in the WordPress execution process that you can intercept to inject a function to work in that event. There are two types of hooks, namely action hooks and filter hooks. Action hooks take place when some action occurs, for example when someone makes a post, an action hook will be triggered. Action hooks won't ask for any information to be returned to WordPress. They only specify that an action has occurred. Filter hooks are similar, but they return information back to WordPress. For example, WordPress will pass the content of a post to your plug-in and you may change it, modify it, and then return the content to WordPress.

Understanding Hooks

The preceding RSS ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required