add_filter : Passing an array instead of the callback function?Posted: asked May 19 at 7:17 - Source : stackoverflow
I was just reading through BuddyPress code because I want to develop a custom plugin on top of it. I encountered was something very peculiar that I haven't seen before and cannot seem to find any material on.
The following code is from a protected function under a class named as BP_Legacy
// Filter BuddyPress template hierarchy and look for page templates. add_filter( 'bp_get_buddypress_template', array( $this, 'theme_compat_page_templates' ), 10, 1 );
As far as I know, the syntax for add_filter is something like
add_hilter ('hook_name', 'callback_function', $priority, $number_of_arguments)
How is it that an array has been passed instead of the callback function? How exactly would this line of code run?