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]
- Ability to set character limit in BuddyPress?
- BuddyPress: hook to add new profile fields and groups
- Buddypress Full documentation [closed]
- What problems can BuddyPress make? [closed]
- BuddyPress | Check if user is in current group [closed]
- Show buddypress notification in the frontend [closed]
- BuddyPress Xprofile check if user can view field [closed]
- How to delete user roles?
- Can simple Admin save options in a Multisite?
- 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]
- I’m trying to Add a new Buddypress menu tab and it is not showing up [closed]
- BuddyPress: What is the use of is_default_option field in wp_bp_xprofile_fields table? [closed]
- 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 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
- how to make a profile entry read only except for site managers [closed]
- Forcing WordPress to work differently
- Show activities of defined BuddyPress groups [closed]
- Buddypress Add unserialized Profile Fields in Members Loop [closed]
- Add an extra field to BuddyPress activity form
- Query users which have same dynamically generated roles as the current user
- Ability to only view (not edit) other user’s personal profile information
- How to create a theme specific translation of buddypress? [closed]
- Reordering Buddy Press profile navigation [closed]
- BuddyPress Toolbar
- how to remove mandatory required fields in buddypress registration [closed]
- Excluding Specific Fields from Profile Builder Registration Form
- Show Specific Buddypress Group Activity Stream in page template
- Buddypress dynamic profile field
- Is it possible to remove ‘group’ from slug for buddypress groups
- bbPress: How to set conditional for specific user -or- user role, to be displayed in user profile
- Add excerpt and post thumbnail to Buddypress blog directory page [closed]
- How to set up WordPress in the intranet?
- How can I display the total number of favorites for any particular buddypress activity stream post? [closed]
- How to bring registration field to index page? [closed]
- Buddypress create custom tab on my profile and add on home page [closed]
- Integration of Cubepoints/Achievements
- BuddyPress/bbpress: There was an error when creating the topic
- How to get all logged in user id in buddypress [closed]
- bp_has_members with custom fields [closed]
- How to hide user profile fields based on the role of the viewed user?
- WordPress add_rewrite_rule redirection match GET variable not passing through to custom template
- Hide tab Buddypress profile for visitors, not logged in users
- conditional activity page for buddypress [closed]
- BuddyPress user custom url structure , any one knows filter for bp_core_get_userlink [closed]
- redirect user to their profile after log in
- Buddypress – Add activity scope [closed]
- Buddypress get data from wp_bp_groups_members table [closed]
- How to: get_user_meta – BuddyPress [closed]
- Where do I edit the user profile with Buddypress? [closed]
- how to find the current page is isngle activity page in buddypress? [closed]
- Noob Question – Buddypress Dynamic content on static page
- How do you remove the buddypress group avatar from the activity stream post? [closed]
- Buddypress Group creation step reordering [closed]
- Random 404 errors using Buddypress
- How to filter members by xprofile field via BuddyPress REST API
- Buddypress profile link on author blogroll page
- Buddy Press restrict the capability to edit users
- How to display profile fields with no data in BuddyPress profile view? [closed]
- Send a specific email in HTML and the rest in plain text
- Serve WordPress in root path of Apache
- Buddypress registration page hangs [closed]
- Certain BuddyPress Member Profile Data Getting Hyperlinked [closed]
- Buddypress Adding a Nav item and Calling Custom Fields [closed]
- I used the Buddypress Message Compose to send a site wide email to all members wasnt sent tho [closed]
- Allowing users to add HTML to BP Groups Description how can I error check html of users? [closed]
- WordPress/BuddyPress plugin to allow users to create members-only posts [closed]
- BuddyPress Component Slug 404 [closed]
- Add Sub Nav Menu Item to Buddy Press Menu [closed]
- Is There A List Of What Buddypress Template Files Go Where And What They’re To Be Renamed?
- How to disable buddypress top mini adminbar [closed]
- WordPress show content if current user get spesific role and spesific meta value
- Remove user from group after X days buddypress