• Hello everyone,

    I think I found a WP-Bug, and i don’t know, where to post this, so I put it here.

    Whe you create custom post types and nest one in the other you can’t create a new entry without the user capability “edit_post”.

    Here is a simple example to reproduce the error:

    function codex_custom_init() {
        $args = array(
            'public' => true,
            'label'  => 'Newsletter',
            'capability_type'	=> 'newsletter',
            'map_meta_cap'		=> true,
        );
        register_post_type( 'newsletter', $args );
    
        $args = array(
            'public' => true,
            'label'  => 'Template',
            'capability_type'	=> 'template',
            'map_meta_cap'		=> true,
            'show_in_menu'		=> 'edit.php?post_type=newsletter',
        );
        register_post_type( 'template', $args );
    }
    add_action( 'init', 'codex_custom_init' );

    You can’t create posts, even if you set the capabilities correct. When you document out the ‘show in menu’ option, everything works fine.

    Regards,
    Jochen

  • The topic ‘Need of edit_post capability in Custom Post Types with nested menu’ is closed to new replies.