What are Hooks in WordPress? Meaning of Hooks

//What are Hooks in WordPress? Meaning of Hooks

As a WordPress developer or a blogger, you might want some additional functions or modified functionality in your WordPress blog. In such cases, WordPress provides hooks to customize functionality on the WordPress blog.

Hooks are code pieces can be added to modify core functions, themes or plugins of WordPress. What are Hooks in WordPress? Meaning of Hooks

  • Actions are functions that get triggered on certain events.
  • Filters can be used to modify core functions.
  • Hooks can be applied to actions and filters.

How to Use Action hooks – Create a function in the PHP file. Hook this function to the particular event that should trigger this function using add_action() API. Create a folder in the plugins directory and add the hook file there. Activate the plugin from the WordPress administration section.

How to Use Filter Hooks – Create a function in the PHP file that filters data from the database. Hook it to WordPress with add_filter(). Create a folder in the plugins directory and add the hook file there. Activate the plugin from the WordPress administration section.

You can refer to hooks examples.

WordPress Glossary – A to Z WordPress Terms and Meanings

List of “A to Z” WordPress Related Terms

2018-02-13T19:00:39+00:00

About the Author:

I love-to-code, passionate-to-write, an upcoming author, and WordPress enthusiast. Here at BlashO, I mostly share WordPress tips. Connect with me @Twitter.