Hooks in
WordPress allow developers to easily tie their own code in with the WordPress
core code base, themes, and plugins. In this article, we’ll discover what
hooks are, go over the different types of hooks
A Hook is
a generic term in WordPress that refers to places where you can add your own
code or change what WordPress is doing or outputting by default. Two types of
hooks exist in WordPress: actions and filters.
Action
Hook
An Action in
WordPress is a hook that is triggered at specific time when WordPress is
running and lets you take an action. This can include things like creating a
widget when WordPress is initializing or sending a Tweet when someone publishes
a post.
Action
Hook Reference page has available actions listed by the following categories:
· Actions Run
During a Typical Request
· Actions Run
During an Admin Page Request
· Post, Page,
Attachment, and Category Actions (Admin)
· Comment,
Ping, and Trackback Actions
· Blogroll
Actions
· Feed
Actions
· Template
Actions
·
Administrative Actions
· Dashboard
“Right Now” Widget Actions
Filter Hook
A Filter in
WordPress allows you get and modify WordPress data before it is sent to the
database or the browser. Some examples of filters would include customizing how
excerpts are displayed or adding some custom code to the end of a blog
post.
Filter
Hook Reference page, which it lists by the following
categories:
· Actions Run
During an Admin Page Request
· Post, Page,
Attachment, and Category Actions (Admin)
· Comment,
Ping, and Trackback Actions
· Blogroll
Actions
· Feed
Actions
· Template
Actions
·
Administrative Actions
· Dashboard
“Right Now” Widget Actions
· Post, Page,
and Attachment (Upload) Filters
· Comment,
Trackback, and Ping Filters
· Category
and Term Filters
· Link
Filters
· Date and
Time Filters
· Author and
User Filters
· Blogroll
Filters
· Blog
Information and Option Filters
· General
Text Filters
·
Administrative Filters
· Rich Text
Editor Filters
· Template
Filters
·
Registration & Login Filters
·
Redirect/Rewrite Filters
· WP_Query
Filters
· Media
Filters
· Advanced
WordPress Filters
· Widgets
· Admin Bar
No comments:
Post a Comment