Advertisement
vapvarun

Use the following code snippet to add/remove the menu from the Learndash frontend dashboard.

May 9th, 2022
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. // Use the following code snippet to add/remove the menu from the Learndash frontend dashboard.
  2.  
  3. add_filter( 'learndash_dashboard_nav_menu', 'remove_menu_items_callback' );
  4.  
  5. function remove_menu_items_callback( $menus ) {
  6.  
  7. $url = Ld_Dashboard_Functions::instance()->ld_dashboard_get_url( 'dashboard' );
  8.  
  9. // To remove 'Assignments' menu
  10. unset( $menus['instructor']['assignments'] );
  11.  
  12. // To add menu 'Custom Menu'
  13. $menus['instructor']['custom-menu'] = array(
  14. 'url' => $url . '?tab=custom-menu',
  15. 'icon' => '',
  16. 'label' => esc_html__( 'Custom Menu', 'ld-dashboard' ),
  17. );
  18. return $menus;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement