InJob - Job Board WordPress Theme

How to remove/add dashboard menu?

Hello Customer,

If you need to add new or remove the link on dashboard, you can add this custom code to your child theme functions

add_filter('iwj_get_dashboard_menus', function($menus, $position){
    $dashboard_url = iwj_get_page_permalink( 'dashboard' );
    //Remove New Job and Jobs in dashboard menu
    unset($menus['new-job']);
    unset($menus['jobs']);
    
    //remove logout menu. we will add it come back again to make sure it always show end of menu list
    unset($menus['logout']);
    //Add new menu show for all users
    $menus['custom-menu'] = array(
        'url' => add_query_arg(array('iwj_tab' => 'custom-menu'), $dashboard_url),
        'title' => '<i class="fa fa-star"></i>' . __('My Custom menu', 'iwjob')
    );
    
    $user = wp_get_current_user();
    if($user){
        //add menu for employer only
        if(in_array('iwj_employer', $user->roles)){
            $menus['employer-menu'] = array(
                'url' => add_query_arg(array('iwj_tab' => 'employer-menu'), $dashboard_url),
                'title' => '<i class="fa fa-star"></i>' . __('Employer Menu', 'iwjob')
            );
        }
        //add menu for candidate only
        if(in_array('iwj_candidate', $user->roles)){
            $menus['candidate-menu'] = array(
                'url' => add_query_arg(array('iwj_tab' => 'candidate-menu'), $dashboard_url),
                'title' => '<i class="fa fa-star"></i>' . __('Candidate Menu', 'iwjob')
            );
        }
    }
    //Add logout menu come back
    $menus['logout'] = array(
        'url' => wp_logout_url(home_url('/')),
        'title' => '<i class="fa fa-power-off"></i>' . __('Logout', 'iwjob')
    );
    return $menus;
}, 10, 2);

If you want to know what menu link key, you can find like this

If you want to write content for you custom menu link, you just create a php file with name as your menu key in location \wp-content\plugins\iwjob\templates\dashboard\

Recommend: You should use child theme to make your custom on my theme. In this case, new file should create on child theme follow path: \wp-content\themes\injob-child\iwj\dashboard\

For exam: You want create new menu link on dashboard

add_filter('iwj_get_dashboard_menus', function($menus, $position){
    $dashboard_url = iwj_get_page_permalink( 'dashboard' );
    $menus['custom-menu'] = array(
        'url' => add_query_arg(array('iwj_tab' => 'custom-menu'), $dashboard_url),
        'title' => '<i class="fa fa-star"></i>' . __('My Custom menu', 'iwjob')
    );;
    return $menus;
}, 10, 2);

You can create file with name custom-menu.php in location \wp-content\plugins\iwjob\templates\dashboard\ or \wp-content\themes\injob-child\iwj\dashboard\

Best regards,
duongca
Inwave Support Team