WordPress.org

Forums

Custom post capabilities not working on WP 3.5.1 (2 posts)

  1. matoma16
    Member
    Posted 2 years ago #

    Hi,

    I'm having a problem having capabilities to work on the last wordpress version. The EXACT same code has worked on past versions. It works if I remove the capabilities line. If it is not removed, my custom post doesn't show on the admin.

    I need the capabilities to work so I can give access to it to my user (custom role...)
    Thanks for your help !
    here's the code :

    $capabilities = array(
            'publish_posts' => 'publish_slider',
            'edit_posts' => 'edit_slider',
            'edit_others_posts' => 'edit_others_slider',
            'edit_published_posts' =>'edit_published_slider',
            'delete_posts' => 'delete_slider',
            'delete_others_posts' => 'delete_others_slider',
            'delete_published_posts' => 'delete_published_slider',
            'read_private_posts' => 'read_private_slider',
            'edit_post' => 'edit_slider',
            'delete_post' => 'delete_slider',
            'read_post' => 'read_slider',
            'manage_categories'=> 'manage_slider'
        );
    
        register_post_type( 'slider',
            array(
                'labels' => array(
                    'name' => __( 'Informations du diaporama' ),
                    'singular_name' => __( 'diaporama' )
                ),
            'public' => true,
            'has_archive' => true,
            'supports' => array('title', 'editor', 'thumbnail'),
            'capabilities' => $capabilities
            )
        );
  2. anilmathewm
    Member
    Posted 2 years ago #

    Me to have the same issue any fix ??

Topic Closed

This topic has been closed to new replies.

About this Topic