Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Trying to alter layout of bp_activity_action()

I was having the same issue and saw this thread while researching it.
Not sure if this is the “best way” to solve this but it worked for me with minimal core change and that’s what I was looking for.

In bp-activity-templateargs.php goto the function named bp_insert_activity_meta copy this entire function to your functions.php file….rename this function to “fb_insert_activity_meta” or whatever you prefer.
Below and outside of this function add the line add_action ( ‘override_insert_activity_meta’, ‘fb_insert_activity_meta’);
Now back to the bp-activity-templateargs.php….goto the function named bp_get_activity_action() and change this:
if ( !empty( $action ) )
$action = bp_insert_activity_meta( $action );

to this:
if ( !empty( $action ) )
{
if(has_action(‘override_insert_activity_meta’))
{
do_action(‘override_insert_activity_meta’, $action);
}else
{
$action = bp_insert_activity_meta( $action );
}

}

This will basically override the function and allow u to change the content there with minimal change to the core as far as I can see.

Skip to toolbar