• 1.
    <?php
  • 2.
     
  • 3.
    add_action( ‘admin_menu’, ‘my_remove_menus’, 999 );
  • 4.
     
  • 5.
    function my_remove_menus() {
  • 6.
        
  • 7.
        /* create an array of user ids to remove the menu from */
  • 8.
        $my_user_ids = array( 14, 15, 16 );
  • 9.
        
  • 10.
        /* check whether the current user id exists in the above array */
  • 11.
        if( in_array( get_current_user_id(), $my_user_ids ) ) {
  • 12.
    	
  • 13.
    	/* id matches the array so remove the menu */
  • 14.
    	remove_menu_page( ‘link-manager.php’ );
  • 15.
    	
  • 16.
        }
  • 17.
    }
  • 18.
    ?>
<?php add_action( ‘admin_menu’, ‘my_remove_menus’, 999 ); function my_remove_menus() { /* create an array of user ids to remove the menu from */ $my_user_ids = array( 14, 15, 16 ); /* check whether the current user id exists in the above array */ if( in_array( get_current_user_id(), $my_user_ids ) ) { /* id matches the array so remove the menu */ remove_menu_page( ‘link-manager.php’ ); } } ?>

Copy Code to Clipboard Raw

Sign-in or Create a Free Account.

Snippi uses Twitter or Facebook to register and create accounts. Registration will enable you to keep track of your snippets. We never spam your timeline or wall. Ever.

Sign-in with Facebook Sign-in with Twitter