The capabilities tag has no wiki summary.
0
votes
1answer
9 views
how do I add role and capability after I create a new user
I have a simple requirement:
1. create a user
2. create a role for the user
3. add capability for the role
First, create a new user
$uid = wp_insert_user($userdata);
Second & Third, create a ...
0
votes
4answers
19 views
what's the meaning of the field wp_capabilities in table wp_usermeta
I am new to wordpress, in table wp_usermeta I notice that we have a row
meta_key meta_value
wp_capabilities a:1:{s:13:"administrator";b:1;}
First, what's the meaning of ...
1
vote
1answer
12 views
Remove wordpress author's capability to moderate comments on their own posts
WordPress authors have permission to edit others comments on their own post. How to disable this and still allow the authors to edit their published posts?
0
votes
0answers
17 views
Don't strip iFrame without “unfiltered html” capability
I want some custom user roles to be able to insert youtube iFrames in the wp_editor. But since I don't want these users to have the whole scope of the capability "unfiltered html", I don't know how to ...
0
votes
0answers
14 views
Assign custom posttype capabilities on init: no menu-item on activation
I develop plugin with custom post type (cpt) who has some custom capabilities. I add those capabilities to the roles (according to the current caps, see code below) on plugin activation. That won't ...
0
votes
0answers
9 views
No multisite but a super admin without sufficient privileges
I have no multisite but I'm super admin. Why I do not know. After I changed username and password on the super admin has super admin no longer all privileges. In some settings, and plugin, I get:
...
0
votes
1answer
16 views
Custom Capabilities for CPT and Problem with current_user_can()
I have setup a CPT with custom capabilities.
add_action('init', 'fac_product_posttype_init');
function fac_product_posttype_init(){
$product_labels = array( ... );
$caps = array(
...
0
votes
1answer
34 views
get_posts() doesn't consider user permissions
I want to show a list of links to posts for the logged in user on my wp.
So I started to do so:
$posts_array = get_posts( array( 'post_type' => 'download', 'post_status' => 'publish' ) );
...
0
votes
0answers
14 views
Custom taxonomy not working after capability change
I have a custom taxonomy, that worked fine. Until I did the following:
Added new role
Assigned a new capability for the taxonomy
Created new post type, and assigned the taxonomy to it (The cpt name ...
1
vote
0answers
31 views
Restrict edit, but allow preview for custom post status
I am developing a Wordpress site with Edit Flow plugin, so I can create custom post statuses to manage author and contributor posts more easily.
So I have created custom post status and I've got ...
0
votes
1answer
28 views
Roles and Capabilities in Custom Post Types
Is there a way to create one role with one capability and apply it to some of the custom post types?
What I am doing right now is ending up with applying capabilities to all of the posts..
creating ...
0
votes
0answers
25 views
Create new capability but restrict to specific page
I am using a custom upload box to allow a subscriber to upload their own avatar. currently the upload is failing as subscribers do not have media upload permissions.
I do not really want to enable ...
0
votes
1answer
36 views
Conflict between Capabilities and Menu Visibility with Custom Post Types
I hope this isn't just the result of typo on my end, but if it is, I'm not seeing it.
I'm adding a custom post type to my site. Actually I'm adding three. Two of them I'm trying to set custom ...
0
votes
0answers
36 views
Capability to read user's own draft post of CPT
I've got a custom role called 'Gym' and custom post type (CPT) called 'Story'. Every Gym user can create a draft of a story and view their own story drafts.
My 'Story' CPT have got the following ...
1
vote
0answers
41 views
Wordpress capabilities on pending post status
I have user with contributor user role. In default if you publish article as contributor you can only view it and you can't delete or edit it. But when you submit new post for review, you can do all ...
1
vote
1answer
29 views
User capability per post
According to Codex we can perform current_user_can checks for certain post_ID, but I fail to find any bit of info how to set a capability explicitly for that post_ID.
A follow up question - how to ...
0
votes
1answer
49 views
How can I have different groups of editors only allowed to edit certain parent+subpages?
I've tried a bunch of different plugins, including Role Scoper, Advanced Access Manager, User Account Manager and more, to accomplish this but can't seem to get it working right.
Basically, the ...
5
votes
1answer
138 views
Allow Editors to edit pending posts but not draft ones
I have a large number of users with Editor Capabilities that help to go through the post submissions. This is my current setup for this role:
As you can see, they are allowed to edit_posts and ...
0
votes
0answers
25 views
How to make a plugin appear only to a certain role of user?
I'm using a plugin called "Team Result", to create team results and things like that. It appeared on the dashboard for admin(me). As you can see in this print ...
1
vote
0answers
30 views
Purpose of Adding Capability to Role But Not Grant?
I am attempting to create a custom role upon activation of my plugin. Along with that role, I wanted to add new capability to that role to access later. Now, after reading the Codex, I am totally ...
2
votes
2answers
83 views
Read only capability for custom post in admin area
I'm actually building custom type to WP and need to be able to restrict post access to some user role, ie. in admin area, collaborators can see posts but can't edit them, just only open them as ...
0
votes
1answer
25 views
Completely remove ability to create users?
I have added the code below to a plugin:
add_action( 'admin_init', 'remove_add_users_cap' );
function remove_add_users_cap() {
$role = get_role( 'administrator' );
$role->remove_cap( ...
0
votes
0answers
16 views
Adding a capability to a role doesn't apply users that hold the role
When my theme is activated (after_switch_theme hook) I add caps to administrator role but it doesn't affect caps of the admin user.
$user_roles = new WP_ROLES();
...
0
votes
1answer
39 views
How to let a role handle media without post permissions
I have a CPT to replace my "post"-post-type, but I still need to be able to use attachments. The problem is, that attachments have the post-capabilities.
I don’t want to give post capabilities to my ...
1
vote
0answers
42 views
Unable to delete custom post types, confusion around capabilities
So I'm working on a plugin for creating a questions/answers system that's as simple and well-integrated as possible (not unlike this site) but am stuck at the creation of the custom post types.
You ...
0
votes
0answers
44 views
pages not found for custom user role
I've created a custom user role for my clients to allow them to manage theme options, and all the other capabilities that the default admin has with the exception of several capabilities that would ...
2
votes
2answers
66 views
What is the difference between “create_users” and “add_users” capabilities?
The codex lists both create_users and add_users under roles and capabilities.
Does anyone know what is the difference between these two?
1
vote
0answers
32 views
Is it wise not to use only meta capabilities for certain basic post types?
I've been a WP developer for a couple of years now but only recently has the concept of meta vs. primitive capabilities really "clicked" with me. I'm building some tools right now to allow easy ...
0
votes
1answer
37 views
“sufficient permissions” error for admin after duplicating WP database to new install
I recently copied the tables from a live WP install to a dev site for that same site. I've changed all the prefixes, the site/WP URLs, and the salt values.
I can successfully log into the new dev ...
0
votes
1answer
66 views
Custom role, capabilities, and post type: preview button wrecks things
I'm using the Members plugin to manage capabilities of a custom role that will only be able to edit/publish a custom post type that I created in my functions.php file. After much work, I got this ...
1
vote
1answer
36 views
Adding Custom Capabilites
So, I'm not sure if this is possible, but is it possible to add custom Capabilities?
So, I've written a group message application, that ties in with Wordpress. I only want certain members (set via ...
0
votes
1answer
99 views
Creating a folder structure
My WP site has a members area which they pay to get access to.
I want that area to be a subfolder, so something like site.com/premium/nameofpage.
I am aware of url rewriting, htaccess etc. Is that ...
2
votes
1answer
62 views
edit_comment capability for subscriber
I have given my site's subscriber role the following permissions (unserialized DB-query):
[subscriber] => Array
(
[name] => Reader
[capabilities] => Array
(
...
3
votes
1answer
132 views
Temporarily give 'manage_options' capability
In order to allow editors to edit other's author meta (update_user_attribute), I must give them the 'manage_options' capability or else I get a 'Cheatin' huh' die message. I only want to give them ...
0
votes
1answer
58 views
Grant access to admin menu?
I'm trying to grant the user role 'editor' to have access to the Users top-level menu, and then control which sub-menus they have access to. The add_action lives in the _construct method.
add_action( ...
0
votes
2answers
217 views
Reset Roles (or undo role changes on theme change)
I am creating a theme that deletes some user roles that are not necessary and creates others. (It deletes author and contributor and renames subscriber).
Everything works, but on theme deactivation, ...
2
votes
2answers
150 views
Adding capabilities to super admins
I'm developing a plugin that uses custom capabilities. Some of those capabilities need to be added to all users who are super admins. Currently, I'm using this code:
$supers = get_super_admins();
...
2
votes
1answer
167 views
Limit access to page depending on user level
I've been asked to build a WordPress that limits access to posts with a particular custom post type based on the logged in users level. There will be a number of pre made user roles and they would ...
1
vote
1answer
89 views
Prevent Editors from Editing/Deleting Admin Accounts
I need editors to be able to add/edit/delete other users. Giving them those capabilities is easy with code similar to this:
$editor = get_role('editor');
$editor->add_cap('edit_users');
The ...
0
votes
2answers
371 views
Show Welcome Panel on Dashboard for every user
I have customised the welcome panel on the dashboard for users with information in. I then hid the "Dismiss" button and added CSS to make the welcome panel always visible. Using the 'welcome_panel' ...
0
votes
2answers
184 views
Require Capability to View Woocommerce Product
I am using Woocommerce and I have products in a category called B2B whose single_product.php is only to be shown to people with the capability read_b2b.
<?php if ( have_posts() ) : ?>
<?php ...
2
votes
1answer
197 views
Apply custom role capabilities to administrator (without plugin)
I have a custom role that allows access to only a sigle custom post type. This is all well and good, but now it is only showing up for this role, not for admin and super admin. I'm having a hard time ...
0
votes
1answer
96 views
How to give “author” user role appropriate capabilities to add PollDaddy polls? WordPress multisite
At the moment, users with role "Author" can only view but not add or edit polls. "Editor" and "Administrator" (site administrator) can add and edit polls however.
This is despite the fact that I ...
0
votes
1answer
52 views
custom post type capabilities - needs to be VERY secure
Hi I'm trying to define custom post type capabilities for staff contracts on an intranet site, so due to the sensitivity of the information this needs to have as best security as possible and simply ...
0
votes
1answer
43 views
how to change capability required to view an admin page? [duplicate]
Possible Duplicate:
Hooking into add_submenu_page
This plugin uses add_menu_page function to create an admin page and I was wondering is there a way to change the capability that is set by ...
1
vote
1answer
65 views
Pending status by default for a specific role
I would like to prevent users from one specific role from publishing directly their articles.
Only administrators should be able to approve these.
The only choice they would ever have is to put their ...
1
vote
1answer
576 views
Hooking into add_submenu_page
Ever come across a plugin that is using the manage_options capability for a page that... really doesn't need to be? Well, I've come across just that.
This may be more of a general question about ...
0
votes
1answer
208 views
How to restrict specific post types from being read or added by specific user roles (eg. author)?
I'm not very clear how to restrict admin area post types access to specific user roles.
In my case, I have some post type such as "suppliers" which I do not want to show to "authors".
By default WP ...
5
votes
4answers
1k 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 ...
0
votes
1answer
63 views
Custom post type & role issues
I am having issues with using custom post types and custom user roles. I created a custom post type called Businesses. Then I created capabilities for users of a certain type to be able to add and ...


