I'm trying to insert my custom post type within a menu of a theme. This theme actually have a custom post type called st_tours
. So when I register my custom post type I do:
$args = array(
'labels' => $labels,
'has_archive' => true,
'public' => true,
'hierarchical' => false,
'rewrite' => array('slug' => 'tour'),
'show_in_rest' => true,
'exclude_from_search' => true,
'show_im_menu' => 'edit.php?post_type=st_tours'
);
register_post_type('tour', $args);
but my custom post type isn't inserted in the menu of the theme, Wordpress define a new menu called Tour
.
What I did wrong?
eg:
I'm trying to insert my custom post type within a menu of a theme. This theme actually have a custom post type called st_tours
. So when I register my custom post type I do:
$args = array(
'labels' => $labels,
'has_archive' => true,
'public' => true,
'hierarchical' => false,
'rewrite' => array('slug' => 'tour'),
'show_in_rest' => true,
'exclude_from_search' => true,
'show_im_menu' => 'edit.php?post_type=st_tours'
);
register_post_type('tour', $args);
but my custom post type isn't inserted in the menu of the theme, Wordpress define a new menu called Tour
.
What I did wrong?
eg:
Share Improve this question asked Feb 5, 2021 at 17:24 sfarzososfarzoso 498 bronze badges1 Answer
Reset to default 0Here's the problem:
'show_im_menu' => 'edit.php?post_type=st_tours'
You made a typo, it isn't show_im_menu
, it's show_in_menu