Hi, I've been getting into plugin development. I was reading about filters and actions in the wordpress documentation and to me it seemed like they were basically the same. I got curious and looked into wordpress core code, and surprisingly I was right:
function add_action( $tag, $function_to_add, $priority = 10, $accepted_args = 1 ) {
return add_filter( $tag, $function_to_add, $priority, $accepted_args );
}
So, the add_action fuction basically just calls the add_filter function with the same arguments!
So my question is, is the difference between them merely a matter of semantics? Because to me it seems any thing that can be done with one can be done with the other one. Where should I use actions and where should I use filters, is there some guidline?
