Reorder, hide tabs in left admin menu/submenu

I come back to you about the left admin panel I need to hide some tabs or subtabs I tried that already that's work but I don't have all the field, please check the file attached.

And that's remove also for me (Super admin), is that a possibility to reoder tabs only for users not for super admin?

Also, it's possible to change the URL logo of the admin bar ?

  • Patrick Freitas
    • Staff

    Hi Sarah

    Hi are you today?

    I had a closer look in the chat, we can have some workaround here.

    First I can see that is removing the menu item in the Super Admin as well. In WordPress in most of the time has an "is_it()" function. For Super Admin you can use the is_super_admin() to refer a Super Admin, in this case we want to avoid to remove we need use NOT (!) condition, !is_super_admin() . For example:

    <?php
    if ( !is_super_admin() ) {
         function my_function(){
             .......
         }
    ?>

    You can expand this creating functions and calling functions as the WordPress codex 's site example shows:

    <?php
    //Removes the "Edit" menu for users who are not Super Admins of a multisite network
    if ( !is_super_admin() ) {
    	add_action( 'admin_init', 'my_remove_edit_menu' );
    }
    function my_remove_edit_menu() {
    	remove_menu_page('edit.php');
    }
    ?>

    You can find more about this function here:
    https://codex.wordpress.org/Function_Reference/is_super_admin

    I can see that you want to change some text on left admin menu. For that you can use the function:

    function my_text_strings( $translated_text, $text, $domain ) {
    	switch ( $translated_text ) {
    		case 'Contact' :
    			$translated_text = __( 'Form', 'contact' );
    			break;
    	}
    	return $translated_text;
    	}
    	add_filter( 'gettext', 'my_text_strings', 20, 3 );

    In this case It will use Form instead of Contact, it can be used in the !is_super_admin() if you want to have only not Super Admin changed.

    If you would like, you can send each Tabs you want to hide and I can help find where is is located for example Users is remove_menu_page('users.php');

    Have a Great day
    Best Regards,
    Patrick Freitas

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.