BuddyDev

Search

[Resolved] BuddyPress Member Types Pro – Compatibility BP Profile Search

  • Participant
    Level: Enlightened
    Posts: 41
    Linklusion on #25407

    Hi Brajesh

    With BuddyPress Member Types Pro, we can exclude some member type from directory.
    Member type excluded from directory still display in field Member Type in Search Form (Search form with BP Profile Search)
    Screenshot https://prnt.sc/p9b6zb
    => Select box with all member type in sidebar
    => Member type choosed to be in directory as well as displayed in tab

    If a member type is excluded from directory , it should not be possible to make a search on this member type in search form (result will be always 0)
    Search form on directory can be different than search form on home page, I want to include member type on search form on home page but will not include it in search form from directory page.

    Can you fix this ?
    Or does it concern Andrea to make BP Profile Search compatible with Member Types Pro ?

    Thanks

    Johan

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #25414

    Hi Johan,
    Thank you for reporting.

    The integration is provided by us, so we will need to update and not Andrea.

    At the moment, I don’t see a proper solution. I will need to check and see if we can allow you excluding some member types.

    Please do note that directory availability of a member type has no bearing on the all list They are unrelated.

    Will putting a filter to allow you exclude some values work for now?

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 41
    Linklusion on #25431

    Hi Brajesh

    Yes a filtre to exclude value works

    Like this filter we have at field profile (screenshot https://prnt.sc/p9m76k) we could have it in profile search as an option of the field when added

    I have translated Member type pro in french (file https://drive.google.com/open?id=1ZztJKIbXfbaBr9FEO_bW-7uOf42sIY0M )
    I don’t see “Which member types to list in field option?” translated, can you please check if it is not missing string in .pot

    Thanks

    Johan

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #25445

    Hi Johan,
    Thank you.

    Thank you for sharing the translation, I have included it.

    I have release 1.3.8 which fixes the translation issue and also includes a filter for limiting search.

    Here is an example how to limit to certain member type

    
    /**
     * Filter allowed member types in BP Profile Search.
     */
    add_filter( 'bpmtp_profile_search_form_allowed_member_types', function ( $member_types ) {
    
    	return array(
    		'student',
    		'teacher',
    	);
    	// add more to the above list.
    } );
    
    

    That will limit search to student and teacher types(these are the unique names you use while creating member type).

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 41
    Linklusion on #25451

    Hi Brajesh

    Thanks for the update !
    Where can I find the filter to add more member types in the list ?
    Shoud I include this filter in bp-custom.php ?

    Thanks

    Johan

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #25464

    Hi Johan,

    Thank you.

    Yes, bp-custom.php is the right place to add it.

    You can just append to the above list for more member types.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 41
    Linklusion on #25465

    Hi Brajesh

    It works !

    Thanks

    Johan

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #25466

    You are welcome 🙂

The topic ‘ [Resolved] BuddyPress Member Types Pro – Compatibility BP Profile Search’ is closed to new replies.

This topic is: resolved