• Hello, I need some help,
    I’m trying to remove a submenu from a post type (sub menu add new)

    However when using remove_submenu_page I lose the permission to list all the posts of the post type, even though I have all the capabilities to edit publish, etc.

    code

    
    function desable_submenu() {
      remove_submenu_page( "edit.php?post_type=custom_post", "post-new.php?post_type=custom_post" );
    }
    //add_action( 'admin_menu', 'desable_submenu' );

    Tranks

Viewing 1 replies (of 1 total)
  • Thread Starter Luiz Araújo

    (@infolu)

    In my research and testing I noticed that the worpress does not behave properly
    Using admin_menu even though the user a user has all permissions of a post type it ends up losing access when I remove a submenu.
    My solution was to change from admin_menu to admin_init which worked perfectly.

    Thank you.

Viewing 1 replies (of 1 total)
  • The topic ‘Remove submenu without losing permission.’ is closed to new replies.