Title: Adding menu
Last modified: January 22, 2020

---

# Adding menu

 *  Resolved [Pamela](https://wordpress.org/support/users/infoknutsford-softwarecouk/)
 * (@infoknutsford-softwarecouk)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/adding-menu-3/)
 * I have tried adding this to my plugin to add a menu to the dashboard
 *  `add_submenu_page(
    ‘xls-download’, __( ‘XLS Download’, ‘xls-download’ ), __(‘
   XLS Download’, ‘xls-download’ ), ‘export’, ‘xls-download’ );`
 * But I am getting
 * Fatal error: Uncaught Error: Call to undefined function wp_get_current_user()
   in …… public_html/wp-includes/capabilities.php on line 652

Viewing 8 replies - 1 through 8 (of 8 total)

 *  [Saurav Sharma](https://wordpress.org/support/users/sauravhny/)
 * (@sauravhny)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/adding-menu-3/#post-12352414)
 * Working fine at my end, use below code
 *     ```
       function custom_options_panel(){
         add_menu_page('Custom page title', 'Custom menu label', 'manage_options', 'Custom-options', 'wps_Custom_func');
         add_submenu_page( 'Custom-options', 'Settings page title', 'Settings menu label', 'manage_options', 'Custom-op-settings', 'wps_Custom_func_settings');
         add_submenu_page( 'Custom-options', 'FAQ page title', 'FAQ menu label', 'manage_options', 'Custom-op-faq', 'wps_Custom_func_faq');
       }
       add_action('admin_menu', 'custom_options_panel');
       ```
   
 *  [Jogesh](https://wordpress.org/support/users/jogesh_pi/)
 * (@jogesh_pi)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/adding-menu-3/#post-12352427)
 * You have issue with capabilities options.
 *     ```
       add_submenu_page(
           'xls-download',
           __( 'XLS Download', 'xls-download' ),
           __( 'XLS Download', ‘xls-download' ),
           'export',
           'xls-download'
       );
       ```
   
 * should be like this
 *     ```
       add_submenu_page(
           'xls-download',
           __( 'XLS Download', 'xls-download' ),
           __( 'XLS Download', ‘xls-download' ),
           'manage_options',
           'xls-download'
       );
       ```
   
 * [https://developer.wordpress.org/reference/functions/add_submenu_page/](https://developer.wordpress.org/reference/functions/add_submenu_page/)
 *  Thread Starter [Pamela](https://wordpress.org/support/users/infoknutsford-softwarecouk/)
 * (@infoknutsford-softwarecouk)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/adding-menu-3/#post-12352450)
 * I have change it to
 *     ```
       function xls_download_menu() {	
       		add_submenu_page(
       			'xls-download',
       			__( 'XLS Download', 'xls-download' ),
       			__( 'XLS Download', 'xls-download' ),
       			'export',
       			'xls-download'			
       		);
       } 
       ```
   
 * but the menu isn’t showing up? Is export correct? I would have thought so
 *  Thread Starter [Pamela](https://wordpress.org/support/users/infoknutsford-softwarecouk/)
 * (@infoknutsford-softwarecouk)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/adding-menu-3/#post-12352456)
 * I also put
 * add_action(‘admin_menu’,’xls_download_menu’); and it is calling the function 
   alright
 *  [Jogesh](https://wordpress.org/support/users/jogesh_pi/)
 * (@jogesh_pi)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/adding-menu-3/#post-12352556)
 * You should use
 *     ```
       function xls_download_menu() {	
       		add_submenu_page(
       			'xls-download',
       			__( 'XLS Download', 'xls-download' ),
       			__( 'XLS Download', 'xls-download' ),
       			'manage_options',
       			'xls-download', 
                               'render_view', 
                               10	
       		);
       }
   
       function render_view() {
          // HTML Output
       }
       ```
   
    -  This reply was modified 6 years, 4 months ago by [Jogesh](https://wordpress.org/support/users/jogesh_pi/).
 *  Thread Starter [Pamela](https://wordpress.org/support/users/infoknutsford-softwarecouk/)
 * (@infoknutsford-softwarecouk)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/adding-menu-3/#post-12352606)
 * AH I have changed it to
 * function xls_download_menu(){
    add_menu_page(‘XLS Download’, ‘XLS Download’, ‘
   manage_options’, ‘download’, ”); }
 * Thanks it shows up now
 * I am getting a 404 on the download page now. How do I create the actual download
   page with a form in it?
 *  Thread Starter [Pamela](https://wordpress.org/support/users/infoknutsford-softwarecouk/)
 * (@infoknutsford-softwarecouk)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/adding-menu-3/#post-12352713)
 * It is ok I have worked it out. A cup of coffee does wonders
 *  Thread Starter [Pamela](https://wordpress.org/support/users/infoknutsford-softwarecouk/)
 * (@infoknutsford-softwarecouk)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/adding-menu-3/#post-12353300)
 * Thanks

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Adding menu’ is closed to new replies.

## Tags

 * [menu](https://wordpress.org/support/topic-tag/menu/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 8 replies
 * 3 participants
 * Last reply from: [Pamela](https://wordpress.org/support/users/infoknutsford-softwarecouk/)
 * Last activity: [6 years, 4 months ago](https://wordpress.org/support/topic/adding-menu-3/#post-12353300)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
