Я создал собственный тип поста для своих ресторанов. В настоящее время он отображается только для моей пользовательской роли restaurant_owner. Я хотел бы, чтобы это также показывало администратору.
Что я делаю не так?
Пользовательский тип сообщения:
add_action( 'init', 'pt_restaurant');
function pt_restaurant() {
register_post_type( 'bounty_product', array(
'labels' => array(
'name' => 'Restaurants',
'singular_name' => 'Restaurant',
'add_new' => 'Add New',
'add_new_item' => 'Add New Restaurant',
'edit' => 'Edit',
'edit_item' => 'Edit Restaurant',
'new_item' => 'New Restaurant',
'view' => 'View',
'view_item' => 'View Restaurant',
'search_items' => 'Search Restaurants',
'not_found' => 'No Restaurants found',
'not_found_in_trash' => 'No Restaurants found in Trash',
'parent' => 'Parent Restaurant'),
'description' => 'Used for the Restaurant section',
'public' => true,
'capability_type' => array('bounty_product','bounty_products'),
'map_meta_cap' => true,
'show_in_menu' => true,
'menu_position' => 20,
'has_archive' => true,
'supports' => array( 'title', 'editor', 'comments', 'thumbnail', 'custom-fields' ),
));
Пользовательская роль пользователя:
add_action('init', 'restaurant_owner_user_role');
function restaurant_owner_user_role() {
add_role('restaurant_owner', 'Restaurant Owner',
array (
'edit_bounty_product' => true,
'delete_bounty_product' => false,
'read_bounty_product' => true,
'publish_bounty_products' => false,
'edit_bounty_products' => true,
'edit_others_bounty_products' => false,
'delete_bounty_products' => false,
'delete_others_bounty_products' => false,
'read_private_bounty_products' => false,
'read' => true,
)
);
}