I think you need to check if the displayed user has that role, try replacing $user->ID
with bp_displayed_user_id()
:
function my_setup_nav() {
if ( user_can( bp_displayed_user_id(), 'store_owner' ) ) {
// ... rest of your code
}
}
Related Posts:
- How to get a buddypress user profile link and a certain user profile field for the current post author?
- Syncing BuddyPress and WordPress profile fields [closed]
- Rename Buddypress Profile Tab
- Login redirect to certain bp profile page
- How to check if the current page is a “personal activity”-page in buddypress? [closed]
- BuddyPress | How to merge the “setting” & “profile” pages into one page? [closed]
- BuddyPress User Profile Menu
- Can you use the buddypress profile system without installing the whole of buddypress? [closed]
- Buddypress export Profile Fields [closed]
- Conditional tags to differentiate between profiles and activity with buddypress [closed]
- Include Buddypress & bbPress styles/scripts conditionally [closed]
- SQL Query members by profile fields Buddypress [closed]
- Using wp-postratings to rate user on profile pages [closed]
- BuddyPress user bio in profile [closed]
- BP Profile Search with limited range
- Code correction – Hide a profile from visitors with a specific role
- Adding custom HTML to each profile group tab [closed]
- buddypress edit profile [closed]
- Disallow user from editing their own profile information
- How to hide admin account in BuddyPress? (for security reasons)
- How to Modify/Change a Buddypress/WordPress Account Activation Process
- Integrating Buddypress, Wootumblog and WPMU Sitewide tags
- BuddyPress: Allow only one email domain to register
- Ability to set character limit in BuddyPress?
- Add BuddyPress Profile Menu Item [closed]
- BuddyPress: Adding a new tab in groups
- BuddyPress: hook to add new profile fields and groups
- wp_editor on front end – JavaScripts not included
- Buddypress Full documentation [closed]
- Get user role by using user_id in buddypress
- What problems can BuddyPress make? [closed]
- How to force buddypress users to complete profile after registration? [closed]
- how to get current user name by user_id in buddypress?
- What’s the easiest way to change the default landing page for BuddyPress groups?
- BuddyPress | Check if user is in current group [closed]
- How to override Member’s Avatars in BuddyPress [closed]
- Buddypress send email notification only if user is not logged in [closed]
- Delete all user attachments
- How to re-enable admin bar with Buddypress active? (BP bar removed) [closed]
- How to ensure buddypress custome profile field is unique
- Why is wp-login redirecting to the home page when I use this function?
- Show buddypress notification in the frontend [closed]
- Buddypress and WordPress on different subdomains with the same database?
- BuddyPress Xprofile check if user can view field [closed]
- How to reply to Buddypress notifications? [closed]
- Posting Photos and Other Attachments in a BuddyPress Forum?
- BuddyPress: How to get info of users filtered by some x-profile data? [closed]
- How to delete user roles?
- Adding HTML/Text to Top of Subscriber’s Profile Backend Page
- Can simple Admin save options in a Multisite?
- Buddypress get member meta info for specific user ID [closed]
- Redirect after registration in BuddyPress [closed]
- Remove tabs from buddypress groups and members pages [closed]
- changing the signup button url in WPMU/Buddypress
- Buddypress profile pictures sync across WordPress Multisite Network
- Make Profile link, link to the BuddyPress profile instead of the WordPress dashboard? [closed]
- How to Change BuddyPress Mystery Man Graphic without Overwriting Core Image File [closed]
- I’m trying to Add a new Buddypress menu tab and it is not showing up [closed]
- How to get larger version of author avatar
- How can I add an image field to BuddyPress Extended Profile Fields? [closed]
- Exclude User from Activity Stream in BuddyPress?
- How to run scripts when a new blog is created in Buddypress?
- Showing the user’s username in registration email or activation page with BuddyPress [closed]
- Display four buddypress activies [closed]
- How to remove unused avatar uploads in buddypress [closed]
- Buddypress Fake (non-bot) Users [closed]
- List User Comments on User Profile BuddyPress [closed]
- cubepoints/buddypress show new rank on activity? [closed]
- Upload files into buddypress profiles [closed]
- BuddyPress: What is the use of is_default_option field in wp_bp_xprofile_fields table? [closed]
- Saving custom profile fields
- BuddyPress – Hook to Update Custom Profile Fields [closed]
- How do I find the bbpress forum ID for a forum in a buddypress group?
- How to get Viewing profile ID in buddypress? [closed]
- Is it possible to have a network of BuddyPress sites, a-la WordPress MU, with single-sign-on? [closed]
- How to add local users to wordpress without email password?
- delete a photo tag in rtmedia [closed]
- How to make a Discussion Group ”Sticky” in BuddyPress [closed]
- Can’t Find BBPress data in Database
- Buddypress register.php user redirect [closed]
- How to get user id which is done by buddypress [closed]
- BuddyBoss (BuddyPress / bbPress) moderation filters not doing anything
- How to add a count in a custom tab in a Buddypress group
- Creating user relationships
- how to make a profile entry read only except for site managers [closed]
- Table ‘wp_signups’ doesn’t exist [closed]
- New user created as Participant rather than Contributor [closed]
- Forcing WordPress to work differently
- Show activities of defined BuddyPress groups [closed]
- Buddypress Add unserialized Profile Fields in Members Loop [closed]
- How to edit buddypress templates? [closed]
- Is there a plugin or something that allows you to use BuddyPress without having to create a BuddyPress-ready theme?
- Add an extra field to BuddyPress activity form
- Query users which have same dynamically generated roles as the current user
- Buddypress – adding custom post to members
- How to show a gloabl message on a user profile page (in back end)?
- Ability to only view (not edit) other user’s personal profile information
- BuddyPress – Get a List of Defined xProfile fields [closed]
- How to create a theme specific translation of buddypress? [closed]
- Reordering Buddy Press profile navigation [closed]