Capability Manager Enhanced
[resolved] Support For WordPress Custom Post Type (4 posts)

  1. Prasanth Panicker
    Posted 3 years ago #

    How do i get Custom Post Type in Types Additional Capabilities list ?

    Custom post type code pasted below

    function apg_newsletter_init()

    $apg_newsletter= array(
    'name' => _x('PDF Newsletters', 'post type general name'),
    'singular_name' => _x('Newsletter', 'post type singular name'),
    'all_items' => __('All Newsletters'),
    'add_new' => _x('Add New newsletter', 'recipes'),
    'add_new_item' => __('Add New Newsletter'),
    'edit_item' => __('Edit Newsletter'),
    'new_item' => __('New Newsletter'),
    'view_item' => __('View Newsletter'),
    'search_items' => __('Search in Newsletters'),
    'not_found' => __('No Newsletters found'),
    'not_found_in_trash' => __('No Newsletter found in trash'),
    'parent_item_colon' => ''
    $args = array(
    'labels' => $apg_newsletter,
    'public' => true,
    'publicly_queryable' => true,
    'show_ui' => true,
    'query_var' => true,
    'rewrite' => true,
    'capability_type' => 'post',
    'hierarchical' => false,
    'menu_position' => 20,
    'supports' => array('title','editor','author','thumbnail','excerpt','comments','custom-fields'),
    'has_archive' => 'Newsletters'


  2. K2Joom
    Posted 2 years ago #

    I am also interested to learn how to add custom post types.

    My theme includes custom post types for Galleries, Portfolio, which are created and displayed via a Page.
    Using s2Members to limit access to pages is a breeze, but we need to add edit capabilities to custom post types as we do not want any member to create pages, just galleries or portfolios.

    Any ideas?

  3. K2Joom
    Posted 2 years ago #

    OK, this might help.

    In capability-manager-enhanced/includes/admin.php if found this code which was commented out:

    if ( ( count($custom_types) || count($custom_tax) ) && ( $is_administrator || current_user_can( 'manage_pp_settings' ) ) ) {
    					$cap_properties[''] = array();
    					$force_distinct_ui = true;

    After uncommenting, the custom post types are now displayed in the capabilities manager, however no check boxes are displayed, so that will be the next task.

  4. Kevin Behrens
    Plugin Author

    Posted 2 years ago #

    No need to hack the plugin code. It's not making those capabilities available to you because you have not defined them.


    Set capability_type to your post_type or pass a capabilities array for more control. Or if you activate Press Permit Core and enable the post type for filtering, distinct capabilities will be auto-defined.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Capability Manager Enhanced
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.