Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Stop posts and updates from a single blog showing up in the mainpage activity stream

think i’m going to update my block activity type plugin to allow more granular control over the item_id and types

but here is a code snippet i quickly modified from that plugin (untested – so double check). in theory, just replace INSERT_THE_BLOG_ID_HERE with the blog_id you want to block. (note this blocks new updates to the db, you would need to remove previous ones)

`
//if php is older then change $a to &$a
function my_block_activity_type_blog_id_before_save( $type, $a ) {
global $bp;

//if there is an id – we don’t care… updating
if ( $a->id )
return $type;

//Come and see the violence inherent in the system. Help! Help! I’m being repressed!
if ( $a->type == ‘new_blog_post’ || $a->type == ‘new_blog_comment’ ) {

//item_id is the blog_id in this context
if ( $a->item_id == INSERT_THE_BLOG_ID_HERE ) {
$a->type = null;
return null;
}
}

//otherwise continue if nothing happened
return $type;
}
add_filter(‘bp_activity_type_before_save’, ‘my_block_activity_type_blog_id_before_save’, 9999, 2);
`

Skip to toolbar