Skip to main content

All Questions

Tagged with or
Filter by
Sorted by
Tagged with
0 votes
0 answers
12 views

How to remove/limit Editor accounts privileges, to prevent them from deleting media and pages created by Admin

How can I remove (or edit) Editor account privilege's, to prevent Editor accounts from making any changes to things Admin accounts upload or create? For instance, Prevent Editors from deleting/...
Omar Juvera's user avatar
2 votes
1 answer
135 views

Redirect Login Based on User Role

I'm currently using the following code to add a login form to a page. How can I redirect users after they have logged in based on a custom user role. function my_login_form() { $args = array( ...
Jon's user avatar
  • 325
0 votes
1 answer
98 views

How to allow Contributors to edit their own posts, whilst still needing to be reviewed by an admin?

Im using the User Role Editor plugin to try to acheive this, but I've also tried PublishPress Capabilities and had the exact same problem. I'd like it so that my contributor users work like so: Their ...
user303096's user avatar
0 votes
1 answer
27 views

How to allow users in wordpress to switch between two assigned roles e.g. Candidate & Employer

I am using Careerfy Theme for wordpress which is basically a job board and has Candidate and Employer User roles set for new registrations. I want registered users to be able to switch between these ...
Job Hunt Community's user avatar
0 votes
0 answers
20 views

Condionally/limited emails from system (cantact-form, registration, passwd reset)With

With: add_filter( 'wp_mail_from', 'my_mail_from' ); function my_mail_from( $email ) { return "[email protected]"; } add_filter( 'wp_mail_from_name', 'my_mail_from_name' ); function ...
kornholio's user avatar
0 votes
1 answer
224 views

Wordpress change role from administrator to author by itself (automatically)

do anybody know this kind of phenomenon? I do not have any user managing plugins installed in my WP, but after some interaction e.g. editing pages or creating postings (its not matter) WP changes for ...
RestAPPDev's user avatar
0 votes
1 answer
455 views

Wordpress: New user role which is ONLY allowed to manage media

I would like to have a new user role (or restrict a role which is already available from Wordpress) which can only manage media (upload, delete pictures etc.) in the wordpress backend - every other ...
Lothar's user avatar
  • 3
0 votes
1 answer
175 views

How to add custom user role into wordpress

I added this code snippet to my function.php to create a user but after logging with this role I'm unable to edit the learndash course lessons quizzes... add_role( 'learndash_content_manager', '...
Masroof Ahmad's user avatar
1 vote
0 answers
77 views

How to create a User Role and give permission to only use Web Stories plugin?

I want to create a new user role "Story Maker" with only the "Google Web Stories" plugin shown in the dashboard for the user to create and publish stories. I don't want the user to ...
Frankie's user avatar
  • 11
0 votes
1 answer
91 views

Send email to user if their role is changed to Author

I would like an email to be sent to the user when their role is changed to Author. The code below sends an email when a user's role is changed to any role, but I would like it only to send if the role ...
Sly's user avatar
  • 3
0 votes
0 answers
275 views

current_user_can() returning true for capability when the user and role do not have the capability

I've been trying to remove the "Customize" from the admin bar by removing the capability from the 'tt_editor' role by adding this to the bottom of the init action function: $editor = ...
Jerome Beckett's user avatar
0 votes
0 answers
138 views

Extend user search in the users.php page to allow for searching by role and excluding specified email domains from the "users search" input box

Update: A solution for this question was provided byt @t31os_ here Extend user search in the Wp backend area on the users.php page to allow for searching by email domain and role from the "users ...
Johnathan's user avatar
0 votes
0 answers
39 views

Show only users with the same role in Dashboard user list

I'm trying to see in the dashboard user list only the users with the same role of the logged in user. For example, i have Admin, Mod and Subscribers roles, when I'm a Subscriber i want to show only ...
Alex's user avatar
  • 1
1 vote
0 answers
43 views

Increase by one the user counter on specific role

Hi i work on this code to increase by one the total users at users.php (fake counter) function my_fake_views($args) { $users_counts = count_users(); $total_users = $users_counts['...
George Ch's user avatar
0 votes
1 answer
31 views

How to lock users account until approvation

I have created a custom role that I've named customer public function setup_user_roles() { add_role('customer', 'Customer', $customer_capabilities); add_role('moderator', 'Moderator', $...
devdev's user avatar
  • 1
0 votes
1 answer
50 views

Redirect user based on role when they try access a particular page

Please how can I redirect a user base on the role when they try to access a particular page? I would need the code to do this, please.
PASCHAL DANIEL's user avatar
0 votes
0 answers
167 views

can't create user without email for an author after converting single site to multisite

We're converting a single site to multisite, and in the process we're seeing something strange with users. Previously, we could create and update users to use as authors that don't have an email ...
Erich's user avatar
  • 111
0 votes
1 answer
122 views

Does wordpress support natively the concept of logging-in users? (not admins, but users of the website)

I need to create a small members area, probably for about 1000 users, not more. I want to set private information there, forms, interaction, etc. More in particular it'll be for "providers" ...
Xavi Montero's user avatar
0 votes
1 answer
32 views

Newly created user role not displaying on users screen

I have created a new role with the following code: add_role('sponsored_content', 'Sponsored Content', get_role('contributor')->capabilities); I have added users to this role. When viewing the ...
Tommizzy's user avatar
1 vote
1 answer
568 views

Remove Capabilities from WP admin for specific user role

I am trying to remove some menu-links capabilities from the wp-admin for a user role called wsm. I have tried many ways and when i just add the code below it will remove those links from the menu for ...
Marc Tzjacker's user avatar
2 votes
0 answers
215 views

Clone wp-admin/users.php (Users Admin Page)

I have created a new page in admin. I need to show all the users in this page(like Users admin page). The reason for this is because i want to show certain custom user roles only on this page. I tried ...
Thowzif Abdullah's user avatar
0 votes
1 answer
108 views

i need to let a user to add a role from a frontend form

i need to let a registered user who already has role or 2 roles the ability to add himself a role via frontend form. i tried to look for it and didn't find anything related that can help me. any ideas?...
Matan's user avatar
  • 3
0 votes
2 answers
2k views

Allow a user or role to view drafts and previews, but not other admin privileges?

How do I allow a specific user or a specific role to view drafts and previews, but not allow them to edit posts or have any other admin capabilities? I can add a custom capability to a role, but don't ...
Michael's user avatar
  • 281
0 votes
0 answers
164 views

Switch to user link shortcode

I am using the User Switching plugin in order to allow sales agents to place an order on behalf of a customer. I have a page called My Customers which uses toolset to return a list of their customers. ...
Jackie Lozano's user avatar
1 vote
0 answers
49 views

Hiding posts by other users and non-logged in

I've been looking for a plugin that works like a private journal and had no luck. The closest I found so far was this guide from buddyforms. In terms of functionality, this is pretty close to what I ...
Excelle's user avatar
  • 11
0 votes
3 answers
2k views

Hide custom post type by user roles

I created a custom post type ( Customers ) and i want to show posts of this post type just to the users with Customer role. there is any way without or with plugin?
Mohammad Esmaili's user avatar
1 vote
1 answer
608 views

List all private pages user has access rights to read

I am trying to list all private pages that user has access to read. To explain in more details, below is the initial setup: Each user has a specific role created and assigned only ability to read ...
Jospo's user avatar
  • 13
0 votes
1 answer
536 views

Update user role for expired membership

Is it possible to use a function in functions.php that would automatically change user role when a membership goes from status "active" to "expired" ? For example : if an active ...
nevax's user avatar
  • 1
0 votes
1 answer
35 views

Load user by specific role

I need to load only the subscribers $args = array('role' => 'Subscriber'); $subscribers = get_users($args); but with this, it returns also the users that are subscriber AND other role (I need to ...
lucrece's user avatar
  • 124
0 votes
0 answers
257 views

Easily adding multiple existing users to a multisite site

I manage a multisite network for a school. The sites are private (password protected), but users within the network should be allowed to access other sites as subscribers. (i.e. all students in a ...
q_andnot_u's user avatar
0 votes
2 answers
632 views

How to make WordPress 'editor' role to list/view/add/edit users only with the role 'author'?

I have added some extra capabilities to the existing 'editor' role in wordpress with: function add_uedit_caps() { $role = get_role('editor'); $role->add_cap('create_users'); $role->...
sariDon's user avatar
  • 265
0 votes
0 answers
232 views

How to hide "Change role to" dropdown on Users admin menu

How can I hide the "Change role to" dropdown?
Rijal Islami's user avatar
0 votes
1 answer
124 views

Add User Role: Pre-saved in User-Meta [SOLVED]

I am adding an action after user registration to add another user role based off the users meta_value. When I use: add_action('um_after_save_registration_details', 'custom_after_new_user_register', 10,...
Ali Hamdan's user avatar
1 vote
0 answers
356 views

Updating wp_user_level on user update

I have the following code, which properly adds the wp_user_level of 2 when a new user is registered with the role "division_manager". I need the wp_user_level to be non-zero so they can be ...
Sandbox Wizard's user avatar
0 votes
2 answers
362 views

Find count of WordPress users by role and search string for user name

I want to get the total number of results after searching WordPress users by role and a string that matches the user name. What I tried so far: $args= array('echo'=>false, 'role' => 'author', '...
sariDon's user avatar
  • 265
1 vote
2 answers
1k views

How to display total user count by specific role in WordPress as statistics?

i want to display in my Home page total user count by specific role in WordPress as statistics I already created Role (subscriber, contributor) and i want to show the total users for each of those ...
Adnan Omar's user avatar
1 vote
0 answers
2k views

wordpress user roles are not working

I have never assigned or used a role before on this site, I have just created a new user role with plugin "user role editor" and also assign an editor Role to other account, whenever I log ...
Rehab Ahmad's user avatar
0 votes
1 answer
40 views

how to create user profile pages and display them based on users roles

Example: I have a website with 3 different user roles (amongst others): *developers *designers *contributors I would like to have profile pages for users and would like to be able to display users on ...
heartcore's user avatar
1 vote
1 answer
21 views

Displaying different in-page content to cliente/admin

i'm a young informatic engineer student who is developing his first wordpress website. It is a booking website when a client can see the available hours in certain local and book it, and the local can ...
javier romero's user avatar
1 vote
0 answers
508 views

Execute a ultimate member action when user role is updated

I want an Ultimate Member action to be performed when I assign a particular role to a user. A role "old_member" exists. If I assign this role to a user, the account should deactivate itself with the ...
anilgky's user avatar
  • 11
1 vote
0 answers
22 views

Fix permissions for users role

I have 4 users roles on my WordPress platform (role1, role2, role3, role4) Role 1 : administaror (full acces) Role 2 : proposal_editor (can create and publish posts, pages, templates, users...) Role ...
Samuel's user avatar
  • 354
1 vote
1 answer
382 views

How to display user order by role

I am trying to display user on query but i want to display order by user role. Suppose we have 2 user role, Gold and Free. I want to display Gold user first and then free users. $args = array( ...
Atif Aqeel's user avatar
0 votes
1 answer
2k views

how to make a custom field readonly or disabled by user role?

i am trying to make a simple custom field (made without a plugin) readonly or disabled for a specific user role in functions.php, is this possible ? thanks
sofdesigne's user avatar
0 votes
0 answers
99 views

Add Change role button for list of user in an event

I need a custom code function which upgrade user role in bulky action just like the default Wordpress change role function in all user Wordpress section
Stephen Wolfram's user avatar
0 votes
2 answers
1k views

hide page menu from admin panel for specific users

I want to hide page menu from the admin panel for a specific user type. I tried it with the below codes in functions.php function hide_menu_items() { global $menu; global $current_user; ...
Shawn's user avatar
  • 117
0 votes
1 answer
757 views

What's the correct way to add capabilites to user roles?

A third-party plugin adds the capability 'edit_booked_appointments'. I'd like to assign this capability to the already existing user role 'editor'. I created the following function in my child theme: ...
jexyon's user avatar
  • 3
0 votes
1 answer
1k views

How to hide user profile fields based on the role of the viewed user?

I want to hide some default fields of the backend user profile page based on the role of the user whose profile is being viewed (by the admin in this case). I used the simple CSS way to achieve that (...
Chris Osiak's user avatar
1 vote
1 answer
903 views

User capability for editing their own comments

I'd like to allow certain (logged in) users to be able to edit their comments. I don't care if they can only edit through the back-end - obviously front-end editing would be lovely, but I'm willing to ...
Tinstar's user avatar
  • 141
2 votes
1 answer
431 views

SQL User Query by Multiple Roles using PHP

I can successfully get all my WordPress users using the following code: global $wpdb; $sql = 'SELECT * FROM ' . $wpdb->users; $users = $wpdb->get_results( $sql, 'ARRAY_A' ); However, I need to ...
Michael's user avatar
  • 281
0 votes
1 answer
439 views

Hook into add_user_role and update based on new and removed roles

I need to add user meta based on each role added and removed. I tried to achieve this by hooking into add_user_role and looping through and updated list of user roles but the old ones are still ...
Leopold's user avatar

1
2 3 4 5 6