Search Results for 'bp_after_has_activities_parse_args'
-
Search Results
-
Hello,
The ultimate goal is to mask the content and selector when a member arrives on the page of a public group to which it has not acceded. In fact he will see just the top of the page, and description button to join group
screenshot:
https://framapic.org/j4FYWFvZmHVI/sOyIzEz0Gl7F.pngThe idea is to reach over activities and other menu group visited oblige to register if he sees that description, avatar and the button to join
I found bp_group_is_member to test ()
http://buddypress.wp-a2z.org/oik_api/bp_group_is_member/
If I do not put any argument, I understand that it will test whether the member is party group (and I add the condition to be displayed in a group?I have an error message:
« Fatal error: Call to undefined function bp_group_is_member() in /var/www/../wp-content/plugins/bp-custom.php on line 3 »What I found to achieve the goal:
if ( !bp_group_is_member() || bp_is_active('groups') ) {add_filter( 'bp_after_has_activities_parse_args', 'my_bp_activity_types_non-membre' );} function my_bp_activity_types_non-membre( $retval ) { $retval['action'] = array( //'activity_comment', //'activity_update', //'created_group', //'friendship_created', nouv relation entre membre //'joined_group', //'last_activity', //'new_avatar', //'new_blog_comment', //'new_blog_post', //'new_member', //'updated_profile', //'rtmedia_update' ); return $retval;
Regards
Hi there,
For a while back I got lots of help in this forum on how to filter the activity stream for specific pages using parse_args. It has been great so far, but I have come across a small issue with some of the terms I want filtered.
Basically, this is what I want and what am doing so far:
If a user writes about a specific species of animal, whatever the user wrote will come up on the activity stream for that particular species, as long as the name of the species is mentioned. Now, this I can do (thanks to help in here), but a few animals have a species name with an apostrophe in it, and that’s where my problem arises.Here’s an example of what I want done:
function my_bp_activities_search_term_on_page_3431( $retval ) { // Add search term for correct page if ( is_page(3431) ) { $filter_query[] = array( 'relation' => 'OR', array( 'column' => 'content', 'value' => 'keast's tube-nosed fruit bat', 'compare' => 'LIKE' ), array( 'column' => 'content', 'value' => 'keast's tube-nosed bat', 'compare' => 'LIKE' ), array( 'column' => 'content', 'value' => 'nyctimene keasti', 'compare' => 'LIKE' ), ); $retval['filter_query'] = $filter_query; } return $retval; } add_filter( 'bp_after_has_activities_parse_args', 'my_bp_activities_search_term_on_page_3431' );
Of couse, this gives me an errer. I looked the issue up on google, and it seemed that the problem would be fixed by writing it like this:
'value' => 'keast\'s tube-nosed fruit bat',
Now, when doing this I no longer get the fatal error, but if I write “keast’s tube-nosed fruit bat” in the activity stream, it won’t show where it should.
So, how can I solve this and have “keast’s tube-nosed fruit bat” show?
Thanks!
Hi all,
I’m looking to have the option within the
#activity-filter-by
drop down in the activity stream where I can filter updates for a search term (e.g. MYWORD).I’ve added:
<option value="-2"><?php _e( 'MYWORD', 'buddypress' ); ?></option>
into members\single\activity.php in child theme.I’ve also got the working code below in my bp-custom.php:
function bptest( $retval ) { if ( bp_is_user_activity() ) { $retval['search_terms'] = 'MYWORD'; } return $retval; } add_filter( 'bp_after_has_activities_parse_args', 'bptest' );
How can i link the two, so that ONLY WHEN the option is selected in the drop down, the code in bp-custom takes effect and at all other times, there is no filter active?
Many thanks.
WP 4.2.2
BP 2.5.1
Hi,
I am using WP 4.6.1 in a network site, directory install using a Divi child theme. I have BuddyPress 2.6.2 with BuddyBlock, BuddyPress Cover Photo, BuddyPress Group Email Subscription and BuddyPress Group Tags. No bbPress.
I would like to make all posts and comments in a group visible to anyone who joins the group. At the moment group members can only see the posts and comments of their friends.
This implies that if a new member wants to see all the activity in a group, they have to send friend requests to everyone in the group.
I believe this should be done in bp-custom.php with code something like the following. I don’t know if I should be using the ‘has_groups’ or ‘has_activites’ loop or some other loop. I confirmed that bp_is_group_single does target the page in question because I could change the per_page entries successfully.
Thanks for any suggestions,
David Tuttle