Hooks Filters and Actions

You've seen several add_filter() and add_action() functions by now. These two functions allow you to take advantage of the hooks scattered throughout WordPress. For a complete list of available actions and filters, visit codex.wordpress.org/Plugin_API/Action_Reference and codex.wordpress.org/Plugin_API/Filter_Reference.

Filters allow you to modify or replace the output existing functions. For example, you could append ads or a copyright notice to content in feeds, or search and replace a word or phrase in your post/page content.

Actions allow you to add your own functions in predetermined locations. For example, you can add a lightbox effect to your photo galleries by adding the appropriate JavaScript file to your theme's <head> tag, or you could send an e-mail notification to all users when a new post is published.

Was this article helpful?

0 0

Post a comment