Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Exclude Category from Activity Stream


Boone Gorges
Keymaster

@boonebgorges

@stef78 If the activity items already exist, you can try something like the following: http://pastebin.com/baERuzVQ

Obviously there are some holes to be filled in, but the comments should lead you in the right direction.

This is not, by the way, a very efficient way to handle it, as switch_to_blog() is a bit of a resource hog. It’d be better to keep those activity items from being written in the first place. Look in bp-blogs.php to see how the bp_blogs_record_post() function works. I suggest that you hook to save_post (like bp_blogs_record_post() is) witha lower priority, do your category check, and then unhook bp_blogs_record_post from save_post if the post is in the returned category.

Skip to toolbar