Blog

Hooks: Actions and Filters
Posted on June 24, 2018 in WordPress by Matt Jennings

Hooks

Hooks are functions in WordPress that allow me to call others functions I create at specific times. There are two types of hooks in WordPress:

  1. Actions
  2. Filters

Why are Hooks Needed

  1. So I don’t mess with the WordPress core.
  2. So I modify/add functionality to the WordPress core.

Action

A WordPress function that is executed at specific points throughout the WordPress core.

Generic Action add_actions();

More Info on add_action();

See more info on add_action();.

Example Actions

Filters

Filters are WordPress functions that allow us to get and modify WordPress data before sending it to the database/browser using custom functions.

Generic add_filter();

More Info on add_filter();

See more info on add_filter();.

Example Filter

Leave a Reply

To Top ↑