add_action() and add_filter()

[ad_1]

I understand they have their purposes, but why do they work interchangeably?

Shouldn't actions like 'wp_login' be excluded from being used in add_filter()?

Are these two functions essentially an alias of one function?

[ad_2]
2 Comments
  1. function add_action( $hook_name, $callback, $priority = 10, $accepted_args = 1 ) {
    return add_filter( $hook_name, $callback, $priority, $accepted_args );
    }

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer