Hello,
I’ve added the search filters for the members in the group directory. I added this already But looks like it’s not working.
please take a look at that.
https://drive.google.com/file/d/12ENySmU_6SIYwL2cSAoRYc9gnhQc4Yyo/view?usp=share_link
Thank you
Hi Bilal,
Are you using community Builder theme?Regards
BrajeshHi Bilal,
I am sorry, I lack the experience with Avada.
I will suggest using Bp profile search pluginhttps://wordpress.org/plugins/bp-profile-search/
Regards
BrajeshHi Bilal,
Here is the code I can provide you.
It won’t work unless you reach out to Andrea again for the help.// filter result and scope to current group members. add_filter( 'bps_search_results', function ( $users ) { if ( ! bp_is_group() ) { return $users; } // find current group member ids $member_ids = BP_Groups_Member::get_group_member_ids( groups_get_current_group()->id ); // we only show the results for the members who match the result and are a member. return array_intersect( $member_ids, $users ); } ); // filter form action and make it use current page if we are on group. add_action( 'bps_before_search_form', function ( $form ) { if ( bp_is_group() ) { $form->action = ""; } return $form; } );
Here is the plan:-
1. You put the BP Profile search form in group sidebar widget. We use the filter to scope results to group members
2. To show result, you use [bps_directory] shortcode in the sidebar too. I have filtered the form action to submit it on the same page.
The above code is not fully functional. It seems the directory shortcode is not working in group sidebar.
Please reach out to Andrea and let me know her insights on this.
Regards
Brajesh
You must be logged in to reply to this topic.