Custom role can’t create permalink
Found that it works if I add the edit_posts capacity. But Posts is now visible in Admin 🙁 At the same time, it also fixed a problem I had with Media upload: the user could never edit right after the upload.
Found that it works if I add the edit_posts capacity. But Posts is now visible in Admin 🙁 At the same time, it also fixed a problem I had with Media upload: the user could never edit right after the upload.
My fist suggestion to this type question is to use Justin Tadlock’s Members Plugin. It should handle what you are asking, and it’s easy to set up. It has several pre-defined roles and capabilities that will probably cover what you need. If not, check out the forums and doc’s for how to customize it even … Read more
This is how I did it : function if_restrict_categories($categories) { global $current_user; $a = get_cat_if_user($current_user->ID); $onPostPage = (strpos($_SERVER[‘PHP_SELF’], ‘edit-tags.php’)); if (is_admin() && $onPostPage && !current_user_can(‘level_10’)) { $size = count($categories); for ($i = 0; $i < $size; $i++) { if($categories[$i]->parent != $a && $categories[$i]->term_id != $a){ unset($categories[$i]); } } } return $categories; } add_filter(‘get_terms’, ‘if_restrict_categories’); And … Read more
It is a strange and rare bug. While publishing our last post we checked the “Blog” and some other categories in the category section. In our previous posts we never checked the “Blog” category. Initially, when I tried to reproduce the bug, I didn’t noticed it. We again tried to reproduce the bug and this … Read more
This is one way to do it add_action(‘user_register’, ‘set_custom_default_role’) function set_custom_default_role($user_id) { // Maybe get available referral codes from database & compare them against the one available if(true) { $user = new WP_User( $user_id ); $user->set_role(‘custom-role-slug’); } }
So I figured out the problem here. When you use the members plugin and create roles for custom post types you need to create a function which maps out your meta capabilities. http://justintadlock.com/archives/2010/07/10/meta-capabilities-for-custom-post-types
I’ll guess that admin_init is too early for remove_menu_page, the hook should be admin_menu.
Open the file “polldaddy.php” and look near the first few dozen lines for this: $this->is_admin = (bool) current_user_can( ‘manage_options’ ); Change that to $this->is_admin = (bool) current_user_can( ‘edit_posts’ ); That would in theory grant authors and above the same access as an admin – you have to test yourself to be sure. See the admin_menu() … Read more
I found Future posts are not exactly a different capability. In WordPress Roles and Capabilities I found edit_others_posts is available by default for Super Admin, Administrator and Editor. I think it will be a right way you can proceed. (Not tested though) And additionally try with edit_published_posts, publish_posts etc.
I am not claiming this is a canonical list but the user related capabilities I see are: add_users create_users delete_users edit_users list_users promote_users remove_users I got this working with only list_users and edit_users. I did test all combinations of those, just a few obvious ones. Of course, you may want more capabilities than that.