WordPress.org

Support

Support » Plugins and Hacks » Capability Manager Enhanced » [Resolved] Support For WordPress Custom Post Type

[Resolved] Support For WordPress Custom Post Type

  • 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’
    );

    register_post_type(‘apgpdfnewsletters’,$args);
    }

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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?

    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.

    Plugin Author Kevin Behrens

    @kevinb

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

    http://codex.wordpress.org/Function_Reference/register_post_type

    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Support For WordPress Custom Post Type’ is closed to new replies.
Skip to toolbar