There are a minimum of 3 arguments required when creating a new Menu Page using the MP_CORE_Settings_Class.

title: (string) (required) This is the title of the page.

slug: (string) (required) This will identify the page and should be all lowercase with no spaces.

type: (string) (required) Tells WordPress where this page will sit in the WP menu. To see all potential options for ‘type’, see below.

The potential options for ‘type’ in the array of args are:

  • dashboard – Add sub menu page to the Dashboard menu.
    $args = array(
        'title' => __('My Settings Page Title', 'textdomain'), 
        'slug' => 'my_settings_page', 
        'type' => 'dashboard'
    );
  • posts – Add sub menu page to the Posts menu.
    $args = array(
        'title' => __('My Settings Page Title', 'textdomain'), 
        'slug' => 'my_settings_page', 
        'type' => 'posts'
    );
  • media – Add sub menu page to the Media menu.
    $args = array(
        'title' => __('My Settings Page Title', 'textdomain'), 
        'slug' => 'my_settings_page', 
        'type' => 'media'
    );
  • links – Add sub menu page to the Links menu.
    $args = array(
        'title' => __('My Settings Page Title', 'textdomain'), 
        'slug' => 'my_settings_page', 
        'type' => 'links'
    );
  • theme – Add sub menu page to the Appearance menu.
    $args = array(
        'title' => __('My Settings Page Title', 'textdomain'), 
        'slug' => 'my_settings_page', 
        'type' => 'theme'
    );
  • plugins – Add sub menu page to the Plugins menu.
    $args = array(
        'title' => __('My Settings Page Title', 'textdomain'), 
        'slug' => 'my_settings_page', 
        'type' => 'plugins'
    );
  • management – Add sub menu page to the tools main menu.
    $args = array(
        'title' => __('My Settings Page Title', 'textdomain'), 
        'slug' => 'my_settings_page', 
        'type' => 'management'
    );
  • options – Add sub menu page to the Settings menu.
    $args = array(
        'title' => __('My Settings Page Title', 'textdomain'), 
        'slug' => 'my_settings_page', 
        'type' => 'options'
    );
  • users – Add sub menu page to the Users or Profile menu.
    $args = array(
        'title' => __('My Settings Page Title', 'textdomain'), 
        'slug' => 'my_settings_page', 
        'type' => 'users'
    );
  • comments – Add sub menu page to the Comments menu.
    $args = array(
        'title' => __('My Settings Page Title', 'textdomain'), 
        'slug' => 'my_settings_page', 
        'type' => 'comments'
    );
  • pages – Add sub menu page to the Pages menu.
    $args = array(
        'title' => __('My Settings Page Title', 'textdomain'), 
        'slug' => 'my_settings_page', 
        'type' => 'pages'
    );
  • submenu – Add a sub menu page. In this array of args, notice the additional ‘parent_slug’ setting. It will display this submenu under the page who’s slug you enter there. For custom post types, use ‘edit.php?post_type=post_type_slug’.
    $args = array(
        'title' => __('My Settings Page Title', 'textdomain'), 
        'slug' => 'my_settings_page',
        'type' => 'submenu',
        'parent_slug' => 'edit.php?post_type=post_type_slug', 
    );
  • object – Add a top level menu page at the ‘object’ level which is alongside the default Posts, Media, Links, Pages and Comments.
    In this array of args, notice the additional ‘icon’ and ‘position’ settings.

    $args = array(
        'title' => __('My Settings Page Title', 'textdomain'), 
        'slug' => 'my_settings_page',
        'type' => 'object',
        'icon' => '$icon_url', //* See bottom of page for info about setting the icon
        'position' => '$position //* See bottom of page for info about setting the position
    );
  • utility – Add a top level menu page at the ‘utility’ level which is alongside the default Appearance, Plugins, Users, Tools and Settings.
    In this array of args, notice the additional ‘icon’setting.

    $args = array(
        'title' => __('My Settings Page Title', 'textdomain'), 
        'slug' => 'my_settings_page',
        'type' => 'utility',
        'icon' => '$icon_url', //* See bottom of page for info about setting the icon
    );

$icon_url
(string) (optional) The url to the icon to be used for this menu. This parameter is optional. Icons should be fairly small, around 16 x 16 pixels for best results. You can use the plugin_dir_url( __FILE__ ) function to get the URL of your plugin directory and then add the image filename to it. You can set $icon_url to “div” to have wordpress generate
tag instead of . This can be used for more advanced formating via CSS, such as changing icon on hover.

$position: (integer) (optional) The position in the menu order this menu should appear. By default, if this parameter is omitted, the menu will appear at the bottom of the menu structure. The higher the number, the lower its position in the menu. WARNING: if two menu items use the same position attribute, one of the items may be overwritten so that only one item displays! Risk of conflict can be reduced by using decimal instead of integer values, e.g. 63.3 instead of 63 (Note: Use quotes in code, IE ‘63.3’). Default: bottom of menu structure