Action Hooks versus Filter hooks – I’m confused
-
Hi there,
I’m currently starting WP plugin development. I’m a reasonable programmer although I’ve never worked with PHP before. Only .NET related technology.But there just seems to be something I don’t get in WP. What’s the difference between Action hooks and filter hooks?
When I look at the source for apply_action in plugin.php, I’m really confused as add_action just calls add_filter. So why the difference?
function add_action($tag, $function_to_add, $priority = 10, $accepted_args = 1) { return add_filter($tag, $function_to_add, $priority, $accepted_args); }
I figured it might be used for backwards compatibility due to legacy code? If that is the case, what should be used today i.e. what is the recommended way to hook functions?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Action Hooks versus Filter hooks – I’m confused’ is closed to new replies.