BuddyDev

Search

[Resolved] Custom Link in BP Profile by user role

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

    Hi. maybe someonecan help me with a hint. I put a custom link in the bp user Profile nav. Works so far, but I habe to user capapillity and want to show this link only for those user which loged in there Account and habe the cap ‘contributer’. I tryed this condition after the function, the first part works, the second after && does not work.:

    if ( ! bp_is_my_profile() && ! $user->has_cap(contributer)) {
    return ;
    }

    I could also user the member type of the member type pro plugin, if it is easier.
    Thanks for your help.
    Frank

  • Keymaster
    (BuddyDev Team)
    Posts: 24645
    Brajesh Singh on #26029

    Hi Frank,
    Thank you for the question.

    You may update your condition with the following

    
    
    if ( ! bp_is_my_profile() || ! current_user_can( 'edit_posts' ) ) {
    	return;
    }
    

    It will show for everyone except the subscriber(it will show for contributor, author, editor, administrator etc).

    Regards
    Brajesh

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

    Thank you very mich for this hint.

    Now I have a nother Problem with registration. I have to member types A = Contributer, B = Subscriber. With B registration is function, with A not. also when I chance in WP the defoult registration as contributer it has the same effect. I fighthing with this Problem since one week, trie out a lot but doesnt work.
    Do you habe any idea?

  • Keymaster
    (BuddyDev Team)
    Posts: 24645
    Brajesh Singh on #26071

    Hi Frank,
    I am sorry I am not able to understand you issue. Can you please help me understand it better?

    Also, In future, Please open new topic for new issues. That way it helps all.

    Thank you
    Brajesh

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

    Ok I will open a new topic.

The topic ‘ [Resolved] Custom Link in BP Profile by user role’ is closed to new replies.

This topic is: resolved