@@ -23,7 +23,7 @@ public static function init(): void {
2323 * Register the webhook CPT
2424 */
2525 public static function register_webhook_cpt (): void {
26- $ labels = [
26+ $ labels = [
2727 'name ' => __ ( 'Webhooks ' , 'wp-graphql-headless-webhooks ' ),
2828 'singular_name ' => __ ( 'Webhook ' , 'wp-graphql-headless-webhooks ' ),
2929 'add_new ' => __ ( 'Add New ' , 'wp-graphql-headless-webhooks ' ),
@@ -37,8 +37,7 @@ public static function register_webhook_cpt(): void {
3737 'parent_item_colon ' => __ ( 'Parent Webhook: ' , 'wp-graphql-headless-webhooks ' ),
3838 'menu_name ' => __ ( 'Webhooks ' , 'wp-graphql-headless-webhooks ' ),
3939 ];
40-
41- $ args = [
40+ $ args = [
4241 'labels ' => $ labels ,
4342 'publicly_queryable ' => false ,
4443 'hierarchical ' => false ,
@@ -55,8 +54,18 @@ public static function register_webhook_cpt(): void {
5554 'query_var ' => true ,
5655 'can_export ' => true ,
5756 'rewrite ' => false ,
58- 'capability_type ' => 'post ' ,
57+ 'capability_type ' => 'webhook ' ,
5958 'supports ' => [ 'title ' ],
59+ 'capabilities ' => [
60+ 'create_posts ' => 'manage_options ' ,
61+ 'edit_posts ' => 'manage_options ' ,
62+ 'edit_post ' => 'manage_options ' ,
63+ 'delete_posts ' => 'manage_options ' ,
64+ 'delete_post ' => 'manage_options ' ,
65+ 'read_post ' => 'manage_options ' ,
66+ 'read_private_posts ' => 'manage_options ' ,
67+ ],
68+ 'map_meta_cap ' => false ,
6069 ];
6170
6271 register_post_type ( 'graphql_webhook ' , $ args );
0 commit comments