Skip to main content

All Questions

Filter by
Sorted by
Tagged with
1 vote
0 answers
14 views

I want to submit multiple users if checkbox is checked

The following code is getting all terms and see if any one of them is checked or not. If any term is checked a form should show under the selected checkbox with email, the username(auto-generated) and ...
Ail Raza's user avatar
0 votes
1 answer
83 views

Remove plugin settings from post creation page for a user role

I want to remove plugin settings from the bottom of the post creating page for a given user type. I want to remove the "Plugin Organization" drop-down from the post creating page for a specific user ...
shimii's user avatar
  • 15
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
28 views

How to disable plugin capability : "create new category"

I tested that a capability can be disabled for any user role, but I found nothing to block the capability of a plugin. Is this possible? any help is greatly appreciated
proseosoc's user avatar
  • 117
0 votes
2 answers
44 views

Security Issues with custom user role or changing core role capabilities?

I have a scenario where I need a editor like role but with extended capabilities where they can access woocommerce orders,products and user page. If I would to create a custom role or change the core ...
Amy's user avatar
  • 3
0 votes
1 answer
79 views

Custom roles and capabilities media not work right

Help with new user wordpress capabilities and roles custom. The media not work upload and display images in galery. image error: https://i.sstatic.net/VE59k.png code: if ( get_role('user_products')...
Barbara Ester's user avatar
0 votes
1 answer
162 views

Best practices to handle multilpe roles and capabilities?

Consider a complex system made in WordPress with multiple roles and capabilities. Let's take a University website, for instance. A University website could have a capability to post news to the home, ...
Lucas Bustamante's user avatar
0 votes
1 answer
104 views

Remove all video attachment, both files and post/postmeta from database?

I am trying to make a function which deletes all the video files + the attachment post and attachments postmeta from the database. This should run when the user role is switched to "basic". And if the ...
jockebq's user avatar
  • 463
0 votes
1 answer
91 views

Allow multisite admins only to create users with one specific user role?

I have this function which prevents my three custom roles (used for multisite admins) to create users with other roles than "User". The three roles I have made are called, Basic, Standard and Premium, ...
jockebq's user avatar
  • 463
1 vote
1 answer
1k views

Creating user relationships

I have a project where I feel I need to create relationships between users but since this is not natively implemented in wordpress as far as am concerned then I will need advice on how to do it. One ...
nelson's user avatar
  • 97
0 votes
1 answer
1k views

Restrict viewing of posts by category, user role

This answer here is almost exactly what I'm after, but I'm just having trouble making it work for me. Basically I've set a bunch of custom user roles using add_role() and register_activation_hook(). ...
rickibarnes's user avatar
2 votes
3 answers
3k views

Allow role to delete posts but block him the wp-admin

I have a custom user role : Photograph. This role should not be able to log into the back-office, but have to be able to delete their own posts from the front-end. I am using this code to block all ...
Relisora's user avatar
0 votes
1 answer
162 views

Show comments based on user role in front end

I want to allow commenting on a custom post type by a specific user role. And a user can see only his comments only. Scenario is e.g User roles are student and instructor. The Student can comment on ...
Sachin's user avatar
  • 1
0 votes
1 answer
222 views

Overwrite user role

We're using this registration plugin to serve as a registration form to new users subscribing to our site. We have two (2) types of users: Students, and Employers. Creating two different pages both ...
Jack Rogers's user avatar
0 votes
1 answer
79 views

Custom user roles

I need to add two custom user roles that have different capabilities. The two user roles are meant for correctors, the only difference is that one corrector should only have access to the posts of our ...
Sam's user avatar
  • 435
2 votes
2 answers
8k views

How to delete user roles?

I installed BuddyPress which created additional user roles but even after deleting BuddyPress those roles are still there. How can I delete these roles? I have tried the remove_role() command but it ...
Abhinav Arya's user avatar
-3 votes
1 answer
50 views

How to give different user access to different people?

I have a video tutorial website where I have to provide videos. For that purpose I have to give different user access to those who login to particular courses. So can you please help me what is the ...
roja.k's user avatar
  • 1
0 votes
1 answer
4k views

Hide content and functions from specific user roles

I'm working on a theme and i am wondering how i can hide specific content and functions from certain user roles via PHP. I am working with a lot of prebuilt functions so what i am after is some code ...
Dennis's user avatar
  • 3
1 vote
2 answers
138 views

Custom Role with Own Page Edit Capability

I need to create a custom role that is only able to edit and publish his own page (page created by admin and afterwards assigned to the user with the custom role). I have successfully created the new ...
Janica's user avatar
  • 11
0 votes
2 answers
811 views

Switch-Case and user_role

I am trying to create a page that shows all users with a selection of details. One of those details is the user role it has. For each role I want to display a different string. In order to achieve ...
Sjors Hijgenaar's user avatar
0 votes
1 answer
47 views

Disallow "contributors" to edit their own posts once they've been set to "Pending Review"

My question is exactly what is in the title: how can I disallow "contributors" to edit their own posts once they've been set to "Pending Review"? I can't seem to find any documentation on how to do ...
Tara's user avatar
  • 45
0 votes
0 answers
186 views

Users can only save their draft once before saving for revision

I use the Members Plugin and Custom Post Types. I created a role and want them to contribute posts (within this Custom Post Type musician) but don't publish them. Additionally I want to give the ...
luke's user avatar
  • 533
5 votes
1 answer
1k views

How to Change the Entire WordPress Admin panel Look and Feel?

I am trying to change the WordPress Admin panel look and feel for depending upon the different role types that are in WordPress. How can create/assign different themes for each role i.e. Editor > ...
FaisalShehzad's user avatar
0 votes
0 answers
111 views

Change the functionality of wordpress users module in admin

I want to restrict wordpress admin to view all users in user list. For say, I have created custom roles (company users, employee). A company user type role can have multiple employees. I want ...
Pradeep Singh's user avatar
3 votes
3 answers
2k views

Prevent from deleting any user role but subscriber

In the administration of my blog, I would like to prevent anyone (admin included) from deleting any user unless it is a simple subscriber. Basicaly, in the "users" section of the administration, I ...
Baylock's user avatar
  • 385
3 votes
1 answer
174 views

How to not allow custom roles to edit published custom post types?

I have a WP site with a custom role (revisor) and a custom post type (events). What I would like to do is allow my revisors to add new events, but not edit existing. I'm already using the Members ...
Aaron's user avatar
  • 325
1 vote
1 answer
113 views

Ability to only view (not edit) other user's personal profile information

I have created 2 roles, Center and Student, for my WordPress website with different capabilities using members plugin. I want the student role users to be only able to view and edit their personal ...
user45922's user avatar
0 votes
1 answer
23 views

How to stop displaying the Id without losing the functionality

I am using a custom code to make certain plugin's functionality available only with particular capabilities. Here is the code: <?php // Check if User can Edit // Set permission to false = 'not ...
Netizen's user avatar
  • 179
3 votes
4 answers
11k views

Capability to edit own posts and not others

What is the capability that let users to edit their own posts and not others? I am trying to enable the post authors to avail a plugin function only on the posts they own. The permission to access ...
Netizen's user avatar
  • 179
0 votes
1 answer
124 views

Saving a post, content filtering and user levels

I wrote a function to add and insert additional metadata to images. It looks like this: function add_image_orientation_fields_to_edit($form_fields, $post) { $current_value = strtolower(...
Hugh R Jaynall's user avatar
3 votes
2 answers
2k views

Redirect After Delete User in Backend

How do I redirect to a certain page after user deletion? For demonstration purpose, let's say I want to redirect to the dashboard on user subscriber deletion. This is what I have tried so far: ...
Giraldi's user avatar
  • 1,485
1 vote
2 answers
596 views

Downgrade user from role that allows post creation

I am an admin of a multi-author blog. I am implementing a monitoring system which will require me to downgrade a user from an 'author' (this role allows them to make a custom post) back to the '...
Adzay's user avatar
  • 83
3 votes
1 answer
2k views

Modify custom Users Manage page

I'm trying to create a submenu page under 'Users' which is like the 'All Users' page but for listing users of specific roles only. Let's just call this submenu page 'Customer'. So far I managed to ...
Giraldi's user avatar
  • 1,485
0 votes
1 answer
473 views

What capability is required to view posts, scheduled in the future, by someone else?

So, I'm trying to create a number of custom roles within my theme to meet with the custom requirements of the site. The first, and most simple, being 'external viewer' who I want to simply be able to ...
gravy's user avatar
  • 167
10 votes
5 answers
14k views

WordPress SEO by Yoast: Hide Meta Boxes in Posts for Non-admins

I have multi-author website and I am not very comfortable for allowing all members to enter SEO details in the posts they are publishing. I would like this would be visible only to Administrator of ...
Audrius's user avatar
  • 111
1 vote
1 answer
735 views

How to check user role?

I have functions that have to execute based on the user roles. How do I check the user role so that I can insert the respective function under their role? EG. if ($_GET['role'] == "free member" ) {//...
dev-jim's user avatar
  • 1,988
0 votes
4 answers
663 views

Restrict access to non-wordpress section of site with user roles?

Is it possible to limit access to a page using wordpress user roles that isn't included in the wordpress install. For example I have a CS Cart install with only a couple of products but I need to ...
Vince P's user avatar
  • 579
0 votes
1 answer
169 views

WordPress strips some attributes for author posts

I added template to my WP posts, so when you click Add New content area alreday with text. Template smt. like this <div id="myDiv"><p>Add your text here</p></div> If user has ...
Narek's user avatar
  • 115
2 votes
1 answer
939 views

How do I properly format the user_role array?

I used a role editor recently and needed to delete a role. After deleting it I noticed that it began to appear as blank in the edit user role drop-down. After a bit of investigating and deleting ...
Zach Shallbetter's user avatar
1 vote
1 answer
2k views

Define new user capability for custom post types?

If I create a custom post type and want to create custom capabilities for that, how do I do this? For example, I want to let my Editors to edit and create and delete posts and pages, but not the ...
Maxim Zubarev's user avatar
0 votes
2 answers
1k views

How do I "trash" a custom post type post while logged in as Admin

I am using the members plugin and have a custom post type of "listing" When I navigate to listings in the backend, I can edit. quickedit, and view. There is no option to trash. I am logged in as ...
TJ Sherrill's user avatar
1 vote
3 answers
384 views

User Roles Not Sticking

I have added a custom user role of super_poster, basically they make 20 posts and once they hit $postlimit get auto-moved back down to contributer level, the moving down and post counting works ok, my ...
MartinJJ's user avatar
  • 1,994
0 votes
1 answer
523 views

Force modified contributor role to be re-approved on edit?

I gave the Contributor role edit_published_posts capability. Contributor submits a post, Admin publishes it. Now Contributor can edit it without approval. Is there a way to force it to be re-approved ...
Oscar Godson's user avatar
1 vote
1 answer
2k views

How can I disable the update notice for non-administrators?

As I already told, I'm setting up a Blog for a friend. Next to not being him an administrator but an editor that can make changes to theme options) I have an additional question. I don't want him to ...
hakre's user avatar
  • 12.9k
6 votes
5 answers
7k views

How can I hide a category from Contributors in the edit/add new post screen?

I have a situation where I need to hide a specific category and it's children from users who are logged in as Contributors. I don't want them to see this category and it's children in the categories ...
davemac's user avatar
  • 648
0 votes
2 answers
396 views

How to determine which capability to use?

For example, I want to use add_menu_page() function to add a menu item to the dashboard. To control which users will be able to access it, I'm supposed to use capabilities... <?php add_menu_page( ...
tkit's user avatar
  • 523
4 votes
2 answers
3k views

Associating an "author" with a custom taxonomy

I have a custom role, "Ministry Representative", which is able to log in and create and manage their own "Opportunities" and "Events", which is each a custom post type. On the front end of the site, ...
Jonathan Wold's user avatar