Chris Haugen,
You need to check user role who have ‘artist’ role and then you need to act on some video loop stuff.
Here’s the solution:
$user = get_user_by('login', $username );
if ( !empty( $user->roles ) && is_array( $user->roles ) ) {
foreach ( $user->roles as $role ){
if($role == 'artist')
media files loop
}
}
get_user_by() is return user data of passed ‘username’.
Thanks!
Related Posts:
- php return username of currently viewed author profile
- Displaying Logged-In User Name in WordPress Menu
- Create a global variable for use in all templates
- Add extra field to users
- Integrating WordPress to my website, while keeping my own authentication system
- Display user’s total comment count outside The Loop
- Changing user_nicename
- How to auto login user again after change user_login
- What is the most efficient way to search users by their display name?
- Can i check if user is doing any ajax request?
- How do I create a WP user outside of WordPress and auto login?
- Showing user ID on user main page from screen options
- Getting the Current User
- Authenticating to WordPress, using my own authentication two-factor system
- How to track a users progress through pages by inserting data into WordPress Database?
- automated tests as a user?
- How can I default to all WordPress roles when parameter is not included in shortcode?
- there’s a way to include a minimal WP for check only the current user, its roles (caps?) and then release/free it?
- Delete option value from array using update_option()
- Warning: Use of undefined constant HTTP_USER_AGENT – assumed ‘HTTP_USER_AGENT’ (this will throw an Error in a future version of PHP)
- Get all user meta by meta key instead of ID
- How to get a list of all possible values of a specific user meta key?
- User’s total comment count excluding comments on their own posts
- User management system similar to wordpress one?
- Show all posts by author
- Programmatic Login from 3rd Party site
- Add New User, extra fields which are required?
- user_profile_update_errors hook not executing
- Modify user profile data through scripting?
- Get users that likes the post
- custom user role wordpress – grant guest access to edit.php without insert/update/delete
- Do not execute If User is login as Administrator or any Specific Role
- php function to display commenter username or login
- Best practice for show data to one specific user?
- get_users meta_query: REGEXP not working for matching new lines
- Change CSS based on is_user_logged_in
- How to show a users bio on a page
- “operation successful” message
- Is it possible to create new user from external form using REST API?
- Foreach loop inside an array_merge
- Show current user posts only
- Change page password every day (predictable password ;) )
- show something only when user comes from specific page at remote host?
- Show site content based on user role
- How to list users like an archive page 10 users on page and have navigations
- Redirect to current user page upon link click
- Use of antispambot with $curauth->email
- Generate a QR code when creating a new WordPress user
- Change wordpress’ database data using ajax – how to get current user id?
- Sort new column in Users wp-admin
- Sort column in Users admin Tab
- Allow a user or role to view drafts and previews, but not other admin privileges?
- Woocommerce display orders with products from specific categories to specific admins
- Admin Panel 404 Error after login
- How to block specific user id in custom login form?
- Get current user id in function php
- How to count active users on a specific page
- how can I call a function when time expire
- Display a custom name when the user has no name settle in his account
- Call WP Rest-Api to GET /users/me returned NOTHING in console
- Uploading/integrating custom user registration page
- If user has clicked link add class and store using PHP/WordPress
- Store data from JavaScript object to custom table in user account
- Page template not working when logged out
- Redirect user to a custom url after logged in
- How to change the value of a variable using input field?
- How do I track which user clicked my button?
- Allowing Non-Latin Characters In WordPress Registration
- Use WP user status (logged_in) to manage access to independent application
- Add another role to a user when they click a button?
- Query to show average # of months all accounts with specific role have been active
- wordpress more than one ajax request at the same time issue
- Editable Student file associated with basic User ID
- Adding users to another blog
- Changing WordPress author name in database
- Matching multi user
- Private messaging – Getting and displaying the avatar/url of a message recipient
- Updating custom user meta
- Loop 1 user randomly
- Update only some custom user fields
- main menu page redirects to user ID
- How to ‘remember’ a site member’s last visited page?
- How to connect database table to each registered wordpress user.
- Adapting a php array to WordPress
- Get author meta of all writers
- Let users register weight each day and save it in DB
- Display a list of users with avatar filterable with alphabets
- Parse error: syntax error, unexpected ‘}’ in C:\wamp64\www\Proiect\aplicatie\user_check.php on line 18 [closed]
- Forbid certain users to access a specific page
- Check if username doesn’t exists
- WP query with variables gives no result for specific user
- Import users and custom user meta from csv
- How to lock users account until approvation
- rest_cannot_create_user – Sorry, you are not allowed to create new users. CURL WORDPRESS REST API
- Getting invalid user ID error when creating a new user with wp_insert_user
- How to create a User Role and give permission to only use Web Stories plugin?
- How to create custom user role without plugin?
- PHP Works only for logged in users: [closed]
- Custom Admin Menu Report for Specific User ID
- How to add custom user role into wordpress