BuddyDev

Search

Hide a member type in Profile Search Forms


  • Keymaster
    (BuddyDev Team)
    Posts: 15862
    Brajesh Singh on #31493

    Hi Ramon,
    I am referring to the code for hiding activity.

    Hiding from the form should be simple.


  • Participant
    Level: Initiated
    Posts: 9
    Ramagu on #31497

    If you can help me great.

    And on the form, I followed the instructions you gave me and it did not work.

    Thank you


  • Keymaster
    (BuddyDev Team)
    Posts: 15862
    Brajesh Singh on #31498

    Hi Ramon,
    Sure. I will share the activity code in next 1-2 days.

    The code for form was shared by @ravisharma and I am going to ask him to support you with that.

    Regards
    Brajesh


  • Participant
    Level: Initiated
    Posts: 9
    Ramagu on #31499

    Perfect, I followed his instructions on the form but he doesn’t hide it.

    Thank you


  • Participant
    Level: Initiated
    Posts: 9
    Ramagu on #31974

    Hello,

    Have you been able to see how to hide the activity of some users and hide the type of members in the form?

    Thank you


  • Keymaster
    (BuddyDev Team)
    Posts: 15862
    Brajesh Singh on #31996

    Hi Ramon,
    My apology for missing this topic.

    1. Please remove the code suggested by Ravi above.

    2. Please find out the name(not the label, It is the unique name) for each allowed member types. Let us say, they are ‘student’, ‘teacher’.

    We can put the following code in bp-custom.php

    
    
    /**
     * Restrict allowed member types in search.
     */
    add_filter( 'bpmtp_profile_search_form_allowed_member_types', function ( $types ) {
    
    	return array(
    		'student',
    		'teacher', //add your own.
    	);
    } );
    
    

    Please feel free to add/remove the member types as you please.

    Regards
    Brajesh


  • Participant
    Level: Initiated
    Posts: 9
    Ramagu on #32028

    Now it works!!

    How could I do what you told me to hide activity from some kind of user?

    Thank you very much!


  • Keymaster
    (BuddyDev Team)
    Posts: 15862
    Brajesh Singh on #32037

    Thank you for confirming that it worked.

    To hide activities for certain users, Please see
    https://buddydev.com/support/forums/topic/hide-activities-of-admins-editors-in-activitiy-stream/#post-24982

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved
Subscribe