Questions tagged [user-roles]
Names for a set of user capabilities.
1,386 questions
0
votes
1
answer
23
views
Hide ID for WordPress User Role Subscriber
How can you Hide a specific Page or Page ID or set of CSS IDs for user Roles that are not admins? Specifically User Role (Subscriber)
I've tried
global $post;
$post_id = $post->ID;
if( $...
0
votes
1
answer
20
views
Trying to require log in to view any post/pages/taxnomy
I've set up a private WP site for clients to hold documentation I get asked for all the time (rather than emailing it or adding it to their G:Drive folder). However, I can't seem to hide the site ...
0
votes
1
answer
22
views
How can I add the User Menu for Authors (role)?
I have authors on my site and I want them to be able to add/edit/remove users. I can see how I can add the relevant capabilities to the author role with get_role and add_cap. But, this does not ...
0
votes
0
answers
22
views
Would it be possible to disable embeds for specific user roles? If so, how?
I would like to disable embeds for specific custom user roles. I found this solution to disable embeds from WPPagebuilders:
function my_deregister_scripts(){
wp_dequeue_script( 'wp-embed' );
}
...
0
votes
0
answers
34
views
User has empty instead of custom role when logged in
I am doing custom registration and logging and assigning a custom user role.
I register like this:
$user_id = wp_create_user($username, $password, $email);
if (!is_wp_error($user_id)) {
...
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/...
1
vote
1
answer
71
views
How to restrict content on a subdomain to users that registers on main site?
I would like to create the following type of set up and wonder if anyone knows if it is possible on a subdomain and how it can be done.
I have a main site, "example.com", and a subdomain, &...
2
votes
1
answer
137
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(
...
0
votes
0
answers
22
views
WordPress Create New Role Just to Manage Users?
I'm trying to create a new role where the only thing this role can do is manage/add/edit/delete users in the admin.
add_role('test_role', 'TEST Role', array(
'read' => true,
'...
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 ...
2
votes
0
answers
30
views
Any way to set user role permissions in the site editor?
Is there any way to set specific permissions in the site editor for user roles? I have a block theme and want to give editor roles the permissions to edit templates, but not to add or delete them. I ...
0
votes
2
answers
2k
views
wp-admin/admin-ajax.php 400 Bad request (chrome console)
I have a download button (to download a pdf file) on my website page, underneath it, I have the number of times that this button was clicked, it is updated in real time using Ajax-JQuery WP method,
...
0
votes
2
answers
49
views
Shortcode to show author role on the author archive page
I have an archive page to show each author domain.com/author. On the archive page for an author domain.com/author/john-doe I want to display few information like name, e-mail address and role like ...
1
vote
0
answers
19
views
Frontend delete CPT post with custom role user
I am building a custom frontend where custom role members (created with User Role Editor) can add and edit spots.
"Spots" are a custom post type registered like this:
register_post_type('...
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 ...
0
votes
0
answers
91
views
Show the author only own types of publications. (JetEngine, Elementor)
I created a custom post called Locations using Elementor + JetEngine. I also created a User Profile Builder Dashboard with the help of this, where the user (client) can add a location. But the problem ...
0
votes
1
answer
143
views
Only an admin can add new tags
Hello,
How can I restrict the addition of new tags for users who are not administrators in Posts -> Tags?
0
votes
0
answers
77
views
Show different page depending on user role
I am quite new at WordPress and sitebuilding in general but I have built a site that I am pleased with.
We are working with companies in four different countries and I want my customers to be able to ...
0
votes
1
answer
39
views
Allowing a CPT post to be edited by a single user role
I am in the process of creating a form for a user to fill out to create a listing request which creates a CPT post and user record.
In this process, I want to copy the subscriber role, rename it '...
1
vote
0
answers
17
views
Easiest way to create Reviewer Role: Can preview Drafts (and Private Pages) but not Edit them
This seems a bit of a hole in Wordpress Roles. I have a site with many cooks (Editors). I would like to give some of them read-only access to Draft and Private materials.
This post goes a little way; ...
0
votes
0
answers
13
views
Hardening user's role after add_role
Using an instance of WP_User ($user) obtained via get_user_by(), I use
$user->add_role('custom-role')
to modify the user's role(s), then
wp_update_user($user)
to store the changed user in the ...
0
votes
1
answer
69
views
WordPress User Role Permissions For Custom Post Type
I'm trying to do some work on a custom post type for a specific user role.
Basically, if the user is logged in as "Registered For Portal" then I would like that user to only see their own ...
0
votes
0
answers
29
views
Need some suggestions with Relationship fields and CPT/ACF
I am tasked with creating a Student/Teacher Portal where among other things, I need a way to build a way for Admins to assign Teacher with Students based upon Subject and Age group (Age for students). ...
0
votes
1
answer
28
views
Custom post type needs to capability to create and edit by some specific user role
I made a custom post type called "Jobs" by ACF. I am using "Members" plugin to give users role. I want some users will get the capability to create post and edit post. others ...
0
votes
2
answers
41
views
Non-super-admin users cannot access CPT even though I have explicitly added the capabilities to the user role
I've defined a CPT and any non-super admin user on any subsite cannot access it. I cannot figure out what is wrong with my code.
CPT Definition:
// Opportunities
register_post_type(
'...
0
votes
0
answers
30
views
coauthors_plus_edit_authors to display metabox based on author caps
Need to display the coauthorplus metabox with author capabilities.
On the documentation of the plugin they say its only with super admin and editor that the metabox is available.
Any idea to add a ...
0
votes
1
answer
30
views
Administrator user cannot access dashboard after localwp import
This is the 2nd time this has happened in the past few weeks so I thought I would try and get some ideas on how to overcome. There are a few others in the localwp community that have had the same ...
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 ...
0
votes
1
answer
121
views
How to make my logged-in user-role shortcode displaying name instead of slug?
I am trying to get my frontend to show the role of a logged-in user via Shortcode. I have the Shortcode functional (see below) but it displays the slug and not the real name in the frontend. This is a ...
0
votes
1
answer
225
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 ...
1
vote
1
answer
331
views
disable adding new tags on the edit and add post
I use the admin menu editor plugin.
I have not allowed editors and authors to access the tags section
But they can add a new tag in the post edit section
This is not good for our site
We want them to ...
0
votes
0
answers
36
views
What is the difference between unmoderated and unapproved users?
I recently ran into these two user categories/roles on an existing site for a new client. Most of my client sites are more informational than transactional, so I'm guessing that the categories/roles ...
0
votes
1
answer
388
views
How can I display customizer's "Additional CSS" to administrators and editors (in multisite)?
In my multi-site WordPress, administrators and editors don't see the Additional CSS section in the customizer. I would like them to have access to that panel. Only super-admins can see the additional ...
0
votes
1
answer
130
views
Add another user role based on a defined input field in Wordpress (Woocommerce)
for a WooCommerce shop, the roles customer and corporate_customer are primarily used.
As soon as a customer registers and enters a tax number in their billing address in the optional field (ID: ...
-1
votes
1
answer
440
views
Show only those pages that are created by the specific logged in user in WordPress
In WordPress, I created a new User role called "Customers" to only see the pages in the wp-admin Dashboard that only that role has created and not all the pages that are created by other ...
1
vote
1
answer
34
views
What is the correct way of validating running code when a particular role accesses a screen?
I'd like to run a series of actions if a particular role accesses a specific screen. For example,
if( is_user_logged_in() && ! current_user_can( 'activate_plugins' ) ) {
if( isset( $...
2
votes
0
answers
45
views
How to protect content from public users and limit access to certain roles in WordPress 2023?
There are hundreds of content protection plugins and role managers, however in my current case I need a custom solution.
The customer wants that only "logged in users" are to be able to read ...
0
votes
1
answer
116
views
Why is user_can_access_admin_page() an undefined function?
According to WordPress Developer Resources, the user_can_access_admin_page() function is still active and valid...
https://developer.wordpress.org/reference/functions/user_can_access_admin_page/
...
0
votes
0
answers
97
views
How to redirect non admin user after login
I have a custom user role on the site. I also have a login hook to redirect users to the home page. When an admin/editor logs in this works fine (although ultimately I would like them to redirect to ...
-1
votes
2
answers
102
views
Redirecting by role from a button
We have a button at the top of our site where users can quickly get their account information, but we need to redirect them to different pages based on their role.
Is there code I can add to this ...
0
votes
1
answer
548
views
Block Gutenberg Editor manually by User Roles with a Filter with code
This is working perfectly for me but, is this an acceptable WP way to do it? Just trying to check that based on user role that the Gutenberg Editor blocked from showing up, like when creating a post, ...
0
votes
1
answer
456
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 ...
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', '...
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 ...
3
votes
2
answers
2k
views
Wordpress users roles wp-admin
A friend asked me to Review him wp page left unfinished by the company he contracted, I can't do a backup because on wp-admin page is no visible the settings although I am administrator, dos wp have ...
0
votes
0
answers
284
views
Get all users from role and add to dropdown (select) - wordpress, javascript
I have a shortcode from functions, which retrieves a list of all users from active role. I have managed to get the list into the dropdown list with a little trickery if I wrap a div around the users ...
0
votes
0
answers
76
views
if user role is x - show image - wordpress
I have set up a member portal with ultimate member where users can fill in and submit various forms and then see the answers in a list. Each submitted answer is automatically converted into a pdf.
...
1
vote
1
answer
44
views
Wordpress show content if current user get spesific role and spesific meta value
How to make conditional if statement like "Show content if current user get spesific role and spesific meta value", if not.. hide content
<?php if( ( current user get spesific role and ...
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 ...
0
votes
1
answer
73
views
Display users by role
I am trying to display users by role, I am using the code below, but I am not sure if this code is correct.. but it works very well on the front page.
<?php
$args = array(
'role' => '...