Skip to:
Content
Pages
Categories
Search
Top
Bottom

Conditional based on User Role


  • The Gal
    Participant

    @peterpevensie

    Hello,

    I’ve been struggling to figure this out for a week now and am finally at the end of my rope.

    Is there a way to create a simple conditional based on user role? I’m going to use it to create custom profile fields and to add custom static content to member_header.php.

    I think I just need to get the conditional to figure this out, but if there’s something I don’t know about custom profile fields outside of the profile field generator in BP, then I’d love to hear your thoughts on that too. lol

    Thanks so much!!

Viewing 1 replies (of 1 total)

  • The Gal
    Participant

    @peterpevensie

    OK, I found the WP user role conditional:

    `if(user_can($user->ID, “user_role_name”))`

    But I need it to be “current profile user role” and not the user browsing. This doesn’t work:

    `if(user_can($bp->profile->id, “store_owner”))`

    But I still feel like I’m on the right track here… Any thoughts?

Viewing 1 replies (of 1 total)
  • The topic ‘Conditional based on User Role’ is closed to new replies.
Skip to toolbar