BuddyDev

Search

Show Friends Button to assigned members of wpuf packages only

  • Participant
    Level: Initiated
    Posts: 10
    Frank Schumann on #26194

    Hello again
    I use Bp-nouveau, wpuf and bp-member types pro. I want to show the friends button to special member types which has as well the wpuf subscrition pack with the pack_id=’90’.

    I habe this code which works for member types very well, but if I but the subscription packs as well comes an error (technical Problems). I tried every possible variant, but nothing works.

    the Code:

    
    /**************Hide Friends Button for Member Types***************/
    //this works only without subscription 
    function buddydev_hide_add_friend_button( $button ) {
    
    	$displayed_user_id = bp_displayed_user_id();
    
    	$user_id = ( $displayed_user_id ) ? $displayed_user_id : bp_get_member_user_id();
    
    	$member_type = bp_get_member_type( $user_id );
    	
    	$subscription_id = get_subscription( $pack_id );
    
    	if ( ( 'bewerber' !== $member_type) && ('90' !==$subscription_id  ) ) {
    		return $button;
    	}
    
    	return '';
    
    }
    add_filter('bp_get_add_friend_button','buddydev_hide_add_friend_button');
    

    hope someone can help me .
    Thanks so mich in advance
    Frank

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #26199

    Hi Frank,
    Thank you for the question.

    We do not use WPUF and since the issue starts when you try to accommodate for wpuf, Please ask their support for suggestions.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 10
    Frank Schumann on #26205

    Hi Brajesh
    Thanks for your fast answere.
    What do you think, what you recommand. Would it be better to use “paid membership pro” to manch this issue?

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #26212

    Hi Frank,
    I am not sure of the purpose.

    My suggestion will be to ask the wpuf developer on how to check for the subscription package.

    That will solve your issue.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved