For anyone that goes looking for this in the future here is something I threw together – it should be a good starting point.
If you put what’s below in your functions file, your activity wall will only show _oembed_ activity.
add_filter( 'bp_activity_get_user_join_filter', 'videos_filter_sql', 10, 6 );
add_filter( 'bp_activity_total_activities_sql', 'videos_filter_sql_count', 10, 3 );
function videos_filter_sql_count( $sql, $where_sql, $sort ) {
global $bp, $wpdb;
if ( !empty( $bp->loggedin_user->is_super_admin ) && $bp->loggedin_user->is_super_admin )
return $sql;
$sql = $wpdb->prepare( "SELECT count(a.id) FROM {$bp->activity->table_name} a
LEFT JOIN {$bp->activity->table_name_meta} m ON m.activity_id = a.id {$where_sql} AND (m.meta_key REGEXP '^_oembed_') ORDER BY a.date_recorded {$sort}" );
return $sql;
}
function videos_filter_sql( $sql, $select_sql, $from_sql, $where_sql, $sort, $pag_sql='' ) {
global $bp, $wpdb;
if ( !empty( $bp->loggedin_user->is_super_admin ) && $bp->loggedin_user->is_super_admin )
return $sql;
$from_sql .= " LEFT JOIN {$bp->activity->table_name_meta} m ON m.activity_id = a.id";
$where_sql .= $wpdb->prepare( " AND (m.meta_key REGEXP '^_oembed_')" );
if ( !empty( $pag_sql ) )
$sql = $wpdb->prepare( "{$select_sql} {$from_sql} {$where_sql} ORDER BY a.date_recorded {$sort} {$pag_sql}" );
else
$sql = $wpdb->prepare( "{$select_sql} {$from_sql} {$where_sql} ORDER BY a.date_recorded {$sort}" );
return $sql;
}