• Resolved feebleTom

    (@feebletom)


    I’m using WP Help version 1.8.8 on WordPress 3.8.1; just got started. However, the WP Help menu item is visible to ALL users. How do you display the WP Help to only those with Author role and above? In fact, I thought that this was supposed to be the default behavior.

    I would also like to be able to hide it from everybody except the Administrator until I’ve finished writing it. Can that be done as well? If so, how do I go about that?

    I saw one post where the $hook variable was modified and the string ‘publish_posts’ was changed to ‘read’ in order to make the Help visible to everybody, but that was in an earlier version and the referenced code doesn’t match up with the current version of WP Help.

    https://wordpress.org/plugins/wp-help/

Viewing 3 replies - 1 through 3 (of 3 total)
  • a bit of a hack, but put this in your functions.php

    add_action('admin_head','admin_css');
    function admin_css()
    {
    	if(!current_user_can('publish_posts'))//only authors and above can publish posts
    	{
    	?>
    		<style>
                    #cws-wp-help-actions
                    {
                       display:none;
                    }
                    </style>
            <?php
    	}
    }

    This simply hooks into the admin_head function and hides the manage buttons if the user is anything below an Author. Not ideal but effective!

    Thread Starter feebleTom

    (@feebletom)

    Thanks, Clearmedia. Your code looks like it should work, but just last night I found a way to do this at http://www.faqoverflow.com/wordpress/28782.html

    /* Keep custom post types UI menu off all dashboards except Administrators  */
    function wpse28782_remove_menu_items() {
        if( !current_user_can( 'administrator' ) ):
            remove_menu_page( 'edit.php?post_type=your_post_type' );
        endif;
    }
    add_action( 'admin_menu', 'wpse28782_remove_menu_items' );

    I tried this and it works. All I had to do was replace “wpse28782” and “your_post_type” with my site-specific names, and I was good to go.

    BTW, if any of my code gets filtered, it’s all there at the faqoverflow link. I wish there was a “preview” option when posting here.

    Thanks again for your reply.

    Oh ok – I misunderstood sorry feebleTom! My little code scrap just hides the manage and create buttons from the help tabs. Well done on finding a solution though!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to show WP Help only to authors and above’ is closed to new replies.