-
-
Save imath/8708a5137cf3cc94189144c0f578c654 to your computer and use it in GitHub Desktop.
Latest Activities BP Block filter: use this filter to disable the Post activity about the Post being displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Use this filter to disable the Post activity about the Post being displayed. | |
*/ | |
function test_bp_activity_block_latest_updates_args( $widget_args, $block_args ) { | |
$actions = explode( ',', $widget_args['action'] ); | |
if ( isset( $block_args['postId'] ) && $block_args['postId'] && in_array( 'new_blog_post', $actions, true ) ) { | |
$widget_args['scope'] = false; | |
$widget_args['filter_query'] = array( | |
'relation' => 'AND', | |
array( | |
'column' => 'secondary_item_id', | |
'value' => (int) $block_args['postId'], | |
'compare' => '!=', | |
) | |
); | |
} | |
return $widget_args; | |
} | |
add_filter( 'bp_activity_block_latest_updates_args', 'test_bp_activity_block_latest_updates_args', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment