There’s a few plugins that might do what you want, but I haven’t tried any of them.
Admin Menu Management
Page Restrict
WP-CMS
They may work, and would certainly be worth exploring further for your needs.
Thread Starter
rkyle2
(@rkyle2)
Thanks for your quick reply. I’ll explore each of those and report findings/usability here to help others with a similar issue.
rkyle2, The code that you posted does work. You are putting it in the wrong file. The file, profile.php simply points to user-edit.php
The user-edit.php contains the real code, and is where the code-snippet you posted is supposed to go.
Directions to install:
1. Take a fresh copy of user-edit.php and open it up in dreamweaver.
2. Search for the phrase: `default:
$profileuser = get_user_to_edit($user_id);
if ( !current_user_can(‘edit_user’, $user_id) )
wp_die(__(‘You do not have permission to edit this user.’));
include (‘admin-header.php’);
?>`
3. After that phrase, add `<?php
if (‘profile.php’ == basename($_SERVER[‘SCRIPT_NAME’]) && !current_user_can(‘edit_users’) )
wp_die(__(‘You are not allowed to edit.’));
?>`
4. Save the document, and close dreamweaver.
5. Back up the original user-edit.php located on the server
6. Upload the edited user-edit.php
7. Test it. Administrators will still be able to edit their profile.
8. If it doesn’t work, try these steps over again with another fresh copy of user-edit.php
9. If it works, rejoice!!
Thread Starter
rkyle2
(@rkyle2)
Thanks a lot! And, thanks for the walk-through.
if i take the code snippet:
<?php
if (‘profile.php’ == basename($_SERVER[‘SCRIPT_NAME’]) && !current_user_can(‘edit_users’) )
wp_die(__(‘You are not allowed to edit.’));
?>
and put that in to user-edit.php, then the user still goes to the dashboard profile view where they are told that they can not edit their profile.
what about removing the link to ‘siteurl’ in comments.php?
i left
<p>Logged in as <?php echo $user_identity; ?>
in place to show the username but it is simply text now without being a link redirecting to wp-admin.
i may have to redo this when i update wordpress, but taking notes is no big deal.
also combined with :
Peter’s Login Redirect
i can manage access to the dashboard. Sometimes people want the subscribers only on the front side of the content.