• Resolved reza10

    (@reza10)


    hello

    i try to remove some menu items with filters in function.php like code below :

    add_filter('tutor_dashboard/nav_items', 'remove_some_links_dashboard');
    function remove_some_links_dashboard($links){
    	unset($links['reviews']);
    	unset($links['wishlist']);
    	return $links;
    }

    it remove some items and does not remove some others

    like logout , change password in settings (i tried it’s own code snippet)

    so how to remove them ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Md Rashed Hossain

    (@wprashed)

    Hello,

    The issue you’re encountering arises because some menu items, like logout and change password, are handled differently in the Tutor LMS codebase and might not be managed by the tutor_dashboard/nav_items filter.

    To remove these specific items, you can try the following approach:

    Removing “Logout” and “Change Password” Menu Items
    Add the following code to your functions.php file:

    add_filter('tutor_dashboard/nav_items', 'remove_some_links_dashboard');
    function remove_some_links_dashboard($links) {
        unset($links['reviews']); // Removes the "Reviews" menu item
        unset($links['wishlist']); // Removes the "Wishlist" menu item
        unset($links['logout']); // Removes the "Logout" menu item
        unset($links['settings']); // Removes the "Settings" menu item
        return $links;
    }
    
    add_filter('tutor_dashboard/submenu_items', 'remove_some_submenu_items');
    function remove_some_submenu_items($submenus) {
        if (isset($submenus['settings'])) {
            unset($submenus['settings']['password']); // Removes "Change Password" submenu
        }
        return $submenus;
    }

    Best regards,
    Rashed Hossain
    Lead, Tech Support at Tutor LMS.

    Thread Starter reza10

    (@reza10)

    hello

    i tried above snippet but it is not working

    for settings page this code :

    add_filter(‘tutor_dashboard/nav_items/settings/nav_items’, function($nav) {
    unset($nav[‘social-profile’]);
    return $nav;
    });

    removes social profile from menu but it is not working for reset password item

    i also tried your given code :

    add_filter(‘tutor_dashboard/submenu_items’, ‘remove_some_submenu_items’);
    function remove_some_submenu_items($submenus) {
    if (isset($submenus[‘settings’])) {
    unset($submenus[‘settings’][‘reset-password’]); // Removes “Change Password” submenu
    }
    return $submenus;
    }

    but it is not working and i still see the reset password item submenu in settings menu

    and logout item is also not removed with your given snippet

    i want this changes for student dashboard

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.