WordPress Hook

WordPress Hook
July 8, 2024
No Comments
2 min read

WordPress has hundreds of hooks, and it's hard to give an exact number. However, I can provide you with an overview of the different types of hooks and some examples of popular ones.

Types of Hooks:

  1. Action Hooks: These allow you to execute a function at a specific point in WordPress's execution. Examples: wp_footer, admin_init, wp_login.
  2. Filter Hooks: These allow you to modify data before it's used or displayed. Examples: the_content, wp_title, get_avatar.
  3. Shortcode Hooks: These allow you to create custom shortcodes. Examples: [gallery-pro], [contact-formetc].
  4. Widget Hooks: These allow you to create custom widgets. Examples: wp_widget_archives, wp_widget_categories.

Some Popular Hooks:

Action Hooks:

  1. wp_footer - executed in the footer of a WordPress page
  2. admin_init - executed in the WordPress admin dashboard
  3. wp_login - executed when a user logs in
  4. wp_logout - executed when a user logs out
  5. wp_enqueue_scripts - executed when enqueuing scripts and styles

Filter Hooks:

  1. the_content - filters the content of a post or page
  2. wp_title - filters the title of a post or page
  3. get_avatar - filters the avatar of a user
  4. the_excerpt - filters the excerpt of a post
  5. wp_nav_menu - filters the navigation menu

Other Hooks:

  1. plugins_loaded - executed when all plugins are loaded
  2. after_setup_theme - executed after the theme is set up
  3. init - executed during WordPress initialization
  4. wp_head - executed in the head of a WordPress page
  5. wp_footer - executed in the footer of a WordPress page

This is just a small sample of the many hooks available in WordPress. You can find more information about hooks in the WordPress Codex: Hook Reference.

See All Hook List >

©2025 Linux Bangla | Developed & Maintaind by Linux Bangla.