Skip to:

New Plugin: Blocking activity stream types (ie new member registered, friendship created, joined gro

  • finally up on the repo…

    Simple but a glorified hack which blocks the update into the database when saving a new activity_record. Translation: don’t use if you ever want the data in the future but if you don’t care about new memberships, joining groups, friendships, or whatever else – then great.

    The admin page will generate a list of previously used activity types – there are few you can not use (activity_update, activity_comment – that will cause buddypress some headaches)

    Please read the FAQ – may have to edit a theme file or a plugin if they hook on the select option drop down. (unfortunately not a filter but an action :( – so no way to catch it if a plugin adds something to the filter list )

Viewing 15 replies - 1 through 15 (of 15 total)
  • Avatar of pollycoke :)
    pollycoke :)


    Much needed, thanks!
    Right now I’m using some hacks suggested by apeatling, but it’s good to know there’s something more like a proper way to do this… I want it into BP :)


    Avatar of Xevo


    Great, gonna test this one out tonight.
    Thanks etiviti. :)

    Edit: Might be interesting to block activity of one user as well, like the admin.

    yeah. i’d like to add in a few more options – ie: wp_cap, days registered (no update status until registered for so long)

    @nuprn1; We’d used this on an existing BP setup and it was fine. However, using it on a new installation where no activity had been recorded yet gave the following error;

    Warning: Parameter 2 to bp_activity_block_type_before_save() expected to be a reference, value given in C:xampplitehtdocswp-includesplugin.php on line 166

    Disabling it, posting a message, then re-enabling it did the trick. I guess it just can’t find anything on first try.

    First I would like to say that I like that the plugin just does what it is supposed to do right out of the box.

    Few Questions:

    1. If I decided that I no longer want to block something and remove it from the list will it then allow things to be written to my database?

    2. I have blocked forums on my main MU site and it works. I however want to block new posts from my sub sites. Is it possible to just place the plugin at that particular site level to stop that site from allowing activity posts while still letting the mainsite keep the activity post as normal?

    I guess it was only two questions. Any help that you can give would be great… Thanks


    1) correct – (going forward)

    2) no – requires to be in the buddypress site as it just looks for overall activity types. though i’m sure it is possible to block on a given item_id (which is the blog_id) – I’m not much of a MU/MS guru so I don’t know exactly how that would be done.

    @nuprn1; Hey Rich. I’ve had a few nasties happen with this plugin, but nothing so bad I recorded it. I know; meh.

    My questions is, can you populate the ‘types to block’ list somehow so the user doesn’t have to try and figure it out if an activity type isn’t listed?

    probably the big drawback – it just pulls a distinct list from the database. a plugin could use whatever they wanted (or a new core) but no way of knowing until it is there.

    Avatar of Pisanojm


    Hi Rich got this error when trying to post a 2nd nested reply today… ie. post—>reply–>reply to a reply—>error is as follows:
    Warning: Parameter 2 to bp_activity_block_type_before_save() expected to be a reference, value given in /home/musicpln/public_html/wp-includes/plugin.php on line 166

    Warning: Parameter 2 to bp_activity_block_type_before_save() expected to be a reference, value given in /home/musicpln/public_html/wp-includes/plugin.php on line 166

    De-activated the plugin and could post. Similar to @lincme above…


    Avatar of Pisanojm


    Sorry… WP 3.0 Current version of block plugin… add to above.

    @pisanojm what version of php?

    you can make a quick edit – open up bp-activity-block.php, edit line 7
    function bp_activity_block_type_before_save( $type, &$a ) {
    function bp_activity_block_type_before_save( $type, $a ) {

    Avatar of Pisanojm


    Hi Rich.

    5.3.2 version of PHP. Also using FCGI as Handler. This fix looks liked it worked… If something crops up I will let you know. Thank you.


    Avatar of ilokano


    how do i block joining one particular group?

    this plugin is not that granular and only targeted at types stored in the activity table

    added a filter hook on the blocking – data about the activity is passed in. so you could block base on group_id, user_id, blog_id, or whatever combo you need.

    see this thread about getting started

    ie, check $type for joined_group, then check $item_id (group_id) for the particular group you want to block. (just return true)

Viewing 15 replies - 1 through 15 (of 15 total)

You must be logged in to reply to this topic.