Hide dashboard icons

Candidates and employers have their dashboards, where they can manage their accounts. But in some cases, you do not want to use some functionalities, so showing some buttons on the dashboard seems little bit unnecessary.

You can do this easily, but using simple code snippets.

If you do not know how to add snippets properly, take a look at our documentation file, where we explained how you can do this.

Remove dashboard buttons

Removing button from employer dashboard

add_filter( "wpjb_employer_panel_links", "user_panel_api_links" );
function user_panel_api_links( $dashboard ) {

    // remove membership link
    if( isset( $dashboard["manage"]["links"]["membership"] ) ) {
        unset( $dashboard["manage"]["links"]["membership"] );
    }

    return $dashboard;
}

 

Removing the button from candidate dashboard:

add_filter( "wpjb_candidate_panel_links", "user_panel_api_links" );
function user_panel_api_links( $dashboard ) {

// remove membership link
if( isset( $dashboard["manage"]["links"]["mymembership"] ) ) {
unset( $dashboard["manage"]["links"]["mymembership"] );
}

return $dashboard;
}

In both cases, we show you how to remove the membership page, but you can remove any button. Just replace “membership” or “mymembership” with the correct keyword. Please be sure you make a change in if statement and in unset function!

List of buttons you can remove

List of possible pages for Employer:

  • job_add – Post a Job,
  • employer_panel – Listings
  • job_applications – Applications
  • employer_edit – Edit Profile
  • membership – Membership
  • payment_history – Payment History
  • employer_logout – Logout
  • employer_password – Change Password
  • employer_delete – Delete Account

List of possible pages for Candidate:

  • myresume – My Resume
  • myapplications – My Applications
  • mybookmarks – My Bookmarks
  • myalerts – My Alerts
  • mymembership – Membership
  • mypaymenthistory – Payment History
  • logout – Logout
  • myresume_password – Change Password
  • myresume_delete – Delete Account

Remove multiple buttons

If you want to remove more than one button, you do not need to create the whole function multiple times, you can just copy if statement, so if you want to remove from employer panel membership and payment history pages, instead of this:

function user_panel_api_links( $dashboard ) {

    // remove membership link
    if( isset( $dashboard["manage"]["links"]["membership"] ) ) {
        unset( $dashboard["manage"]["links"]["membership"] );
    }

    return $dashboard;
}

You can use this code:

function user_panel_api_links( $dashboard ) {

    // remove membership link
    if( isset( $dashboard["manage"]["links"]["membership"] ) ) {
        unset( $dashboard["manage"]["links"]["membership"] );
    }

    // remove payment history link
    if( isset( $dashboard["manage"]["links"]["payment_history"] ) ) {
        unset( $dashboard["manage"]["links"]["payment_history"] );
    }

    return $dashboard;
}

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *