BuddyDev

Search

[Resolved] Make user testimonials only available to specific profile types in BuddyBoss

  • Participant
    Level: Initiated
    Posts: 13
    Maarten Korpershoek on #34111

    Hi,

    The user testimonials are available to all profile types in BuddyBoss. Is it possible to limit this to specific profile types?

    Kind regards,

    Maarten

  • Keymaster
    (BuddyDev Team)
    Posts: 24149
    Brajesh Singh on #34112

    Hi Maarten,
    Thank you for using the plugin.
    At the moment, the plugin does not support restrictions based on member type. Our offices will open on Tuesday(currently closed due to festive holidays here in India), I will ask one of our team members to update and add support for the member type based restrictions. Should be available by the end of the week.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 13
    Maarten Korpershoek on #34119

    Hi Brajesh,

    Wow, that sounds great! Great service! Would it be possible to add this to the User Circles plugin too?

    Enjoy the holidays!

    Maarten

  • Keymaster
    (BuddyDev Team)
    Posts: 24149
    Brajesh Singh on #34121

    Hi Maarten,
    Thank you for the kind words.
    For User circles, Please allow me to review it on Tuesday and get back to you if we can add the member type based restrictions.

    Thank you
    Brajesh

  • Participant
    Level: Initiated
    Posts: 13
    Maarten Korpershoek on #34124

    Hi Brajesh,

    Okay, thanks a lot! I will be looking forward to your response.

    Kind regards,

    Maarten

  • Keymaster
    (BuddyDev Team)
    Posts: 24149
    Brajesh Singh on #34247

    Hi Maarten,
    Thank you for the patience.
    We have released a new update.

    With this update, you may use a few lines of code to control who can have testimonials.

    Here is an example

    
    
    /**
     * Enable/Disable testimonials for certain member types.
     */
    add_filter( 'bp_testimonial_enabled_for_user', function ( $enabled, $user_id ) {
    
    	$allowed_member_types = array(
    		'student',
    		'teacher',
    	);
    
    	$user_types = bp_get_member_type( $user_id, false );
    
    	if ( ! empty( $user_types ) && array_intersect( $allowed_member_types, $user_types ) ) {
    		$enabled = true;
    	} else {
    		$enabled = false;
    	}
    
    	return $enabled;
    }, 10, 2 );
    
    

    Please update the allowed_member_type with correct values an dput this code in your bp-custom.php(wp-content/plugins/bp-custom.php) or in your theme’s functions.php

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 24149
    Brajesh Singh on #34281

    Hi Maarten,
    Marking it resolved as per our email communication.

    Regards
    Brajesh

The topic ‘ [Resolved] Make user testimonials only available to specific profile types in BuddyBoss’ is closed to new replies.

This topic is: resolved