Custom Post Type Link from Plugin

Magic here is:

'show_ui' => true,
'show_in_menu' => 'plugins.php',

Try this:

function restaurant_menu_items() {

    $labels = array(
        'name' => __('Restaurant Menu Items', 'post type general name'),
        'singular_name' => __('Restaurant Menu Item', 'post type singular name'),
        'add_new' => __('Add New', 'product page'),
        'add_new_item' => __('Add New Menu Item'),
        'edit_item' => __('Edit Menu Item'),
        'new_item' => __('New Menu Item'),
        'view_item' => __('View Menu Item'),
        'search_items' => __('Search Menu Items'),
        'not_found' =>  __('Nothing found'),
        'not_found_in_trash' => __('Nothing found in Trash'),
        'parent_item_colon' => ''
    );

    $args = array(
        'labels' => $labels,
        'public' => true,
        'publicly_queryable' => true,
        'show_ui' => true,
        'show_in_menu' => 'plugins.php',
        'query_var' => true,
        'menu_icon' => get_stylesheet_directory_uri() . '/article16.png',
        'rewrite' => true,
        'capability_type' => 'post',
        'hierarchical' => false,
        'menu_position' => null,
        'supports' => array('title','editor','thumbnail'),
      ); 

    register_post_type( 'menu-item' , $args );
}

Leave a Comment