Archive for the ‘WordPress Capabilities’ Category

activate_plugins WordPress capability

Saturday, November 26th, 2011

activate plugins

activate_plugins

What is 1st WordPress user permissions system capability if we sort such list in alphabet order? Yes, activate_plugins one. Information about it at WordPress Codex is very brief: “Allows access to Administration Panel options: Plugins”. But according its name this capability should allow at least activate plugins and may be something more. Where we can get right information about WordPress if not at WordPress’s core source code? I made little investigation and wish to share with you its results in this post.
Summary: activate_plugins capability on the top of the mountain really gives user access to “Plugins” and “Installed Plugins” menu items of WordPress admin back-end menu system and lets him activate/deactivate plugins one by one or applying bulk action to the set of selected plugins.
Let’s look together under the WordPress hood and see on examples of WordPress 3.3 core source code how it’s realized.

Read the rest of this entry

WordPress admin menu permissions

Monday, November 14th, 2011

WP capabilities for admin menu access

WP admin menu permissions


WordPress admin menu items access is restricted by special permissions or so-called capabilities. When you build new WordPress user role, it’s useful to know what menu item is restricted by what capability. It is necessary knowledge to add/remove admin submenus from user role via adding/removing correspondent capability.

If you have some PHP knowledge and you are curious enough, you will find the most part of WordPress admin menu definition, including its capabilities, at WordPress core source code. But what to do, if you are not PHP developer? Even me caught myself that it is too tedious open wp-admin/menu.php file and find right piece of code every time in order to get needed capability name for the admin menu item to use it in own plugin or answer on plugin’s user or site visitor questions. Why do not document this? That’s the reason of this post was written. I hope it will be useful not for me only.

Look at the table below for the list of WordPress 3.3 admin menu items capabilities.

Read the rest of this entry

Limit comments moderation

Thursday, August 4th, 2011

Limit comments moderation

Limit comments moderation

Who can moderate post comments in WordPress? There are: post author, editors, administrators, that is all users who can edit post for which the comment is sent. Let’s suppose you don’t wish that your authors and editors have ability to moderate comments. How to achieve that? If you look at WordPress capabilities list you find fast the ‘moderate_comments’ capability. So quick decision is to turn off ‘moderate_comments’ capability for the ‘Author’ and ‘Editor’ roles. It’s simple task with the help of User Role Editor WordPress plugin. But you will discover soon that it’s not enough. Why?

Read the rest of this entry

edit_dashboard WordPress capability

Sunday, June 19th, 2011

Edit Dashboard WordPress capability

Edit Dashboard

Since version 2.5 WordPress has “edit_dashboard” (Edit Dashboard) capability in its capabilities system. What is the purpose of this capability? Does it forbid logged-in user to remove some widget from the dashboard if he decides that such widget is unneeded to him and wish to hide it using the “Screen Options” link at the top of dashboard screen? Definitely “No”.
If user has “edit_dashboard” capability he has access to the configuration parameters of widgets which included to his dashboard. If widget has some parameters to tune its work, such user is able to change them. Let’s see. Go to WordPress dashboard and move your mouse pointer to the right top corner of the widget box. Let’s take for example a “WordPress Development Blog” widget which is accessible to all logged-in users. Do you look a small down headed arrow? As you may know already it serves to collapse/expand widget box. Move your mouse to the left of that arrow. If you have “edit_dashboard” capability you will see that “Configure” link appears there.

Read the rest of this entry

User Role Editor WordPress plugin – Change roles easily

Saturday, March 20th, 2010

User Role Editor - plugin for WordPress

User Role Editor

User Role Editor WordPress plugin allows you to change standard WordPress user roles capabilities with easiness of a few mouse clicks. Just turn on check boxes of capabilities you wish to add to the selected role and click “Update” button to save your changes. That’s done. Add and tune your own custom roles which you can assign to the users then. You can create new role as a copy of existing one. Delete self-made roles. Change defaul user role.
Multi-site support is provided.

Why it could be necessary? Let’s suppose you wish that your multi-authored blog contributors upload their own graphics to use in their posts. WordPress “contributor” role has no such capability by default. In such situation you have needed to change user role capabilities manually using SQL client as I described at “How to change wordpress user role capabilities” post, if you have enough knowledge in that field. But what to do if you have not?

Read the rest of this entry

How to change WordPress User Role capabilities

Sunday, November 22nd, 2009

User Roles

User Roles


Every WordPress blog owner knows that WordPress 2.8 and higher user standard roles are: Administrator, Editor, Author, Contributor, Subscriber.
What is the difference? What the “Author” can do but “Contributor” can not? Comprehensive information about it can be found here, at WordPress.org
But where all that data are stored? How to change the role if you really need it? Interested? Read this article and you will get some answers on that questions. Recently I met with the following problem at the multi-authored blog. User with role “Author” can upload images to the blog server, but can not use it in his/her posts. Any HTML tags are immediately removed from post text after “Author” saves his draft or post.

Read the rest of this entry