Search Results for 'bp_after_has_activities_parse_args'
-
AuthorSearch Results
-
March 12, 2015 at 10:53 pm #235911
danbp
ParticipantTry this to remove ALL activity feeds
function bpfr_hide_rss_feeds() { remove_action( 'bp_actions', 'bp_activity_action_sitewide_feed' ); remove_action( 'bp_actions', 'bp_activity_action_personal_feed' ); remove_action( 'bp_actions', 'bp_activity_action_friends_feed' ); remove_action( 'bp_actions', 'bp_activity_action_my_groups_feed' ); remove_action( 'bp_actions', 'bp_activity_action_mentions_feed' ); remove_action( 'bp_actions', 'bp_activity_action_favorites_feed' ); remove_action( 'groups_action_group_feed', 'groups_action_group_feed' ); } add_action('init', 'bpfr_hide_rss_feeds');This snippet will only show logged in users friends activities (on all activity pages of the site)
function bpfr_filtering_activity( $retval ) { $retval['scope'] = 'friends'; return $retval; } add_filter( 'bp_after_has_activities_parse_args', 'bpfr_filtering_activity' );Add to bp-custom.php or child-theme functions.php
More details about this on Codex
February 18, 2015 at 3:15 pm #234680In reply to: Remove public group updates from SWA
deshmukh
Participant@danbp thanks! For the first time, I could read the Codex, understand it and do something meaningful!
In my functions.php, I added the following code:
function myown_bp_activity( $retval ) { $retval['scope'] = 'friends'; return $retval; } add_filter('bp_after_has_activities_parse_args', 'myown_bp_activity' );This makes no difference at all. I guess, default for scope is friends. If I change ‘friends’ to ‘groups’, ALL activities show only group updates.
The area where I am groping in the dark still is:
- How do I modify ONLY the SWA? What should be the conditional? if (bp_is_SWA)?
- Secondly, I can get ONLY groups. But I can not still get ONLY status updates. How do I get that? What should be the scope?
August 21, 2014 at 8:02 pm #187765Christian Freeman (codelion)
ParticipantAlright, I have an update.
It turns out that BuddyPress Activity Plus was not to blame after all. For some reason, when I use
$retval['object'] = 'status';it only shows activity updates that I’ve just submitted. Once I refresh the page, the stream is empty again.So I changed the function you provided to try to get around this, and to be conditional to the home page of my eX-Stream site only:
function bpfr_filtering_activity( $retval ) { global $blog_id; // activities to filter on, comma separated if ( $blog_id == 13 && is_front_page() ) { $retval['action'] = 'activity_update'; } return $retval; } add_filter( 'bp_after_has_activities_parse_args', 'bpfr_filtering_activity' );August 8, 2014 at 2:27 pm #186302rainerkormann
ParticipantHi @danbp
I used your Code and it works like a charm – thanks a million 🙂
One thing: using your nice Filter-Function, it’s only possible to make a comment, after one click on one, no matter which, of the Activity-Tabs (“All Members|Friends|Groups”)…
Without that click, the “Comment”-Button of someones entry just doesn’t work 🙁
PS: when I change the If-Statement to use your Code also for Groups, so only Updates are shown (which works), there is no way I can make the Comment-Button work…:
function make_swa_show_notice_only( $retval ) { if ( bp_is_page( 'activity' ) || bp_is_page( 'groups' ) ) { $retval['action'] = 'activity_update'; } return $retval; } add_filter( 'bp_after_has_activities_parse_args', 'make_swa_show_notice_only' );Do you have an idea, what i can do?
Thanks in advance,
Rainer.May 19, 2014 at 4:14 pm #183116danbp
ParticipantPlease don’t post BP files, it’s really unnecessary. We’re all BP user ! 👿
Sorry, i didn’t correctly understand your request. I thought you wanted to change the order of the selectbox filters. If you also interested, see this old tread.SWA shows by default all site activities and they can be filtered. It is well documented on the Codex.
If for some reason you don’t want to modify a theme file, you can use a custom function and put it into bp-custom.php
Example ( BP 2.0+ only)
function make_swa_show_notice_only( $retval ) { if ( bp_is_page( 'activity' ) ) { $retval['action'] = 'activity_update'; } return $retval; } add_filter( 'bp_after_has_activities_parse_args', 'make_swa_show_notice_only' );Now the swa shows only notices (if exist). If you need to see a member activity, you have to go on his profile. Same for groups, the activity is only on the group page.
-
AuthorSearch Results