• hi guys,

    Is there a way to remove comments tab in the admin menu for all my non-admin users?

    I tried using role-manager plugin in which I turned off ‘Moderate Comments’, but cannot get rid of the comments tab.

    Cheers

    maddy

Viewing 7 replies - 1 through 7 (of 7 total)
  • The ‘edit_posts’ capability is required for that menu to display, but if you want users to edit posts, then you might want to change wp-admin/menu.php.

    Of course, if you change a core file like that, make a backup before changing, and remember you might need to fix that again for future releases.

    Adding link to trac ticket for information:
    https://trac.www.ads-software.com/ticket/4353

    there is a way, but not sure you like it or not:
    in wp-admin/edit-comments.php , at the first line, put this code:

    <?php
    	if ($user_level < 9){
    	echo "Restricted area";
    	exit;
    }

    this will block users below level 9 (admin is 10).

    Cheers

    I tried this, and it blocks everyone–including admins–from being able to access the comments section. Any ideas? I’m using WP 2.2.

    you are right, sorry. this one works and the same code should place BELOW require_once(‘admin.php’) the code :

    you can try it at my website if needed

    <?php
    
    require_once('admin.php');
    
    	if ($user_level < 9){
    	echo "Restricted area";
    	exit;
    }

    ————-
    edit: if you want to keep the header and footer, then you should move the code BELOW: require_once(‘admin-header.php’);
    then add this code (almost same):

    *******************
    //HACK FOR VIETZON
    	if ($user_level < 9){
    	echo "<div style='text-align:center;color:red; padding-top:100px';><h1>Restricted area</h1></div>";
    	include('admin-footer.php');
    	exit;
    }
    //HACK ENDS

    remove div if you want to.

    cheers

    The little code works fine -Thanks- but except if the user clicks on Manage/ Posts and then clicks on the number showing how many comments there are; we have exactly the same problem!! Coming to comments page through edit.php is not avoided like this..

    Actually I would prefer the users to see and search the comments but not see the IPs and emails of the others. Any suggestion is very much appreciated..

    Thanks..

    My workaround
    Change edit.php line
    <a href="https://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP() ?>"><?php comment_author_IP() ?></a>

    With this one.
    <a href="https://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_url() ?>"><?php comment_author_url_link() ?></a>

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Remove comments tab from’ is closed to new replies.