• Resolved Yeso Akshith

    (@yesoakshith)


    I am trying to create a post type with register post type with show_in_menu => “slug” and when I try to access the page, then it says

    “Sorry, you are not allowed to access this page.”

    When I set show_in_menu = > true then it work fine.

    I am using map_meta_cap => true and create_posts=>”do_not_allow”.

    I have tried removing the create_posts=>”do_not_allow”, I get the same access error.

    I have checked forums but the only thing comes out is set show_in_menu => true and hide the menu but that doesn’t make any sense of having show_in_menu => “slug”.

    And also to note I have created admin menu with the slug and the post type is visible in admin menu but when I go to post_types page (/edit.php?post_type=), I get the access error.

    Not understanding what could go wrong.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Yeso Akshith

    (@yesoakshith)

    I can see the page with error
    “undefineded offset: 0 in WordPress\wp-includes\capabilities.php on line 127”
    When I change the capability in add_submenu_page to “edit_slug” from “manage_slug”. I got rid of access errors and am able to view the post type but the above error keeps popping out.

    Thread Starter Yeso Akshith

    (@yesoakshith)

    If I change the capability in add_submenu_page to “edit_posts” from “edit_slug” then it works but if I change it to “edit_slugs” from “edit_posts” then I am getting the access errors again. I have map_meta_cap true and also have the edits_posts => edit_slugs. but still I get the access error with edit_slugs

    Thread Starter Yeso Akshith

    (@yesoakshith)

    I had to to hook into global $sub_menu and remove all its capabilities to make it display.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘show_in_menu = “slug” creating access problems’ is closed to new replies.