Tag Info

New answers tagged

0

I had issues with this as well. What I wanted was to give one user Admin but remove certain menus from the backend admin side bar. I removed AAM because it was giving permission problems and used Menu Editor Pro instead. Everything works perfectly. Of course, this is not the most secure way to go about it, it still allows access to the hidden admin pages ...


0

If you have a user role called "consultant" and you do a search filtering by capability "consultant", you wouldn't find anything. Roles and capabilities are different things. Here is the codex reference: http://codex.wordpress.org/Roles_and_Capabilities


0

You might try using the pre_get_posts filter, along with get_users, to alter the query that's exposed on your theme's search.php. I'm interested in seeing how this could be achieved, so I've decided to strap on my proverbial rucksack and do some fiddling. If I get anywhere, I'll post my results here.


0

This link might be useful in solving your problem: http://3.7designs.co/blog/2014/08/restricting-access-to-custom-post-types-using-roles-in-wordpress/


0

My advice is to read the Codex regarding user roles and capabilities. Contributors cannot publish posts. Edit: I am able to successfully add new users with the 'contributor' role, and select them from the dropdown as the author of a post, which is what I now realize you're having issues with. So something is definitely wrong if this is not working for ...


3

You can try the following: /** * Post Update Locker For Authors * If an administrator has updated the post, then lock it for author updates. * @see http://wordpress.stackexchange.com/a/168578/26350 */ add_action( 'pre_post_update', function( $post_ID, $data ) { // Target only authors: if( ! current_user_can( 'edit_post' ) || current_user_can( ...


0

I was looking for a solution where the Editor could edit only menus AND create/edit users without needing a plugin. So I ended up making it for those who are interested. // Customizes 'Editor' role to have the ability to modify menus, add new users // and more. class Custom_Admin { // Add our filters public function __construct(){ // Allow ...


0

Your (super) admins will still be able to edit users' details -- it'll just be a two-step process. First they'll create the user; then, they'll go to the new user's details page (eg, example.com/wp-admin/network/user-edit.php?user_id=[xxx]) to edit the user's details. I'm not sure I comprehend the second question. Do you require that readers of your online ...


1

That's the correct way to get what you need. Though I'm not sure why WordPress returns an array of roles since ( to my knowledge ) you can only have 1 role at a time. Roles being an array you can modify by just retrieving the role index 0: $blogusers = get_users(); // Array of WP_User objects. foreach ( $blogusers as $user ) { echo '<span>' . ...


0

After going through a few solutions including capabilities -nothing seemed to work. I finally rechecked the size of live wp_usermeta verses localhost wp_usermeta and found that the upload had been chopped and missing some values. I emptied the table and re-uploaded the whole usermeta afresh. Wordpress worked straightaway after the upload. - Hope this saves ...


0

I just found this question and although it might work, I was not satisfied with the solution. There had to be a better way to do this, without registering the taxonomy again. And there is a better solution, I am now using in my CPT plugin. public function wpse_108219_set_taxonomy_caps( $taxonomy, $object_type, $args ) { global $wp_taxonomies; if ( ...


0

One way would be to create a new page each time a user is created. Store that page id in the user meta. If you're doing all the editing on the front end, then it's as easy as doing a conditional check to see if the page id stored matches the one in the user-meta data or if the user is an admin, otherwise deny access. It'd be even easier if you're doing it ...


0

Okay John, I get what you are trying to do, unfortunately, you can't do that with the out of the box WordPress (wp) installation. WP users are broken down into user levels like Admin, Editor, Author, etc. Each level has its own set of capabilities. The problem with having all your members with the same user level is that they all possess the same ...


0

Read the WordPress Codex on the subject of Roles http://codex.wordpress.org/Roles_and_Capabilities To confirm that the system works the way you want, as an admin create a test member with the author role and sample content as you would for a 'real' member. Then sign out and sign in using your test member's credentials and see what capability that test ...


0

Paste this code inside the functions.php file of your currently active theme. You can make it a plugin file too. It uses the "the_comments" filter to remove the unwanted comments from the backend table. /** * Filter out comments of other posts than current logged-in user. * * @param $all_comments all the comments to be displayed in List_Table * * ...


1

Figured my comment would actually make a better answer, so here we go. You can hook other methods within the plugin class onto admin_init (for the admin side) within the constructor, like so: class Plugin_Class { public function __construct() { add_action( 'admin_init', array( $this, 'some_other_method' ) ); } public function ...


0

function is_user_a_member_of_this_group($user_id, $group_id) //return: bool return groups_is_user_member( $user_id, $group_id ); }


0

Manually change 1 user to a contributor then view their wp_capabilities entry in wp_usermeta table. Update the rest of the table to set wp_capabilities to this value for the 12,000 users.



Top 50 recent answers are included