Custom Post Types
-
Hello,
first of all: we have lifetime licence, but dont know how to open a ticket in other way like here. Its a big project allready launched, we really need help in this case. We can arrange a paid session if possible, its urgent.We have many custom post types and our simple goal is to enable/disable granular rights (for example delete) for each post type (and custom post type) separately. After enabling the custom post types capabilities (code below), we can see in “Roles” many new checkboxes for the custom post types – and we can check/uncheck them separately. In “Admin Menu” the custom post type is visible as well and checked. So far everything looks fine.
Problem: It doesnt matter if we check/uncheck any of the rights in “Roles”. The options delete, edit, etc do not show up anymore in Backend for the user role.
Cheers, Daniel
Our custom post type code, example from post type “gvp_accordion”:
function gvp_accordion() { register_post_type( 'gvp_accordion', array( 'labels' => array( 'name' => __('Accordions', 'gvp'), 'singular_name' => __('Accordion', 'gvp'), ), 'taxonomies' => array('gvp_accordion_category'), 'rewrite' => array('slug' => 'accordion'), 'public' => true, 'has_archive' => true, 'show_ui' => true, 'publicly_queryable' => true, 'supports' => array( 'title', ), 'capability_type' => 'gvp_accordion', 'capabilities' => array( 'publish_posts' => 'publish_gvp_accordions', 'edit_posts' => 'edit_gvp_accordions', 'edit_others_posts' => 'edit_others_gvp_accordions', 'edit_private_posts' => 'edit_private_gvp_accordions', 'delete_posts' => 'delete_gvp_accordions', 'delete_others_posts' => 'delete_others_gvp_accordions', 'delete_private_posts' => 'delete_private_gvp_accordions', 'read_private_posts' => 'read_private_gvp_accordions', 'edit_post' => 'edit_gvp_accordion', 'delete_post' => 'delete_gvp_accordion', 'read_post' => 'read_gvp_accordion', ) ) ); } add_action('init', 'gvp_accordion');
- The topic ‘Custom Post Types’ is closed to new replies.