From 3b23aff94a20f2c8813598abfc79402e9aa79e54 Mon Sep 17 00:00:00 2001 From: Mike Auteri Date: Thu, 28 Dec 2023 12:10:58 -0500 Subject: [PATCH] Add rest_base to post types so API endpoint is plural (matches posts and pages). --- includes/core/classes/class-event.php | 1 + includes/core/classes/class-venue.php | 1 + 2 files changed, 2 insertions(+) diff --git a/includes/core/classes/class-event.php b/includes/core/classes/class-event.php index 287ffc223..cd5b98b0e 100644 --- a/includes/core/classes/class-event.php +++ b/includes/core/classes/class-event.php @@ -128,6 +128,7 @@ public static function get_post_type_registration_args(): array { 'not_found_in_trash' => __( 'Not found in Trash', 'gatherpress' ), ), 'show_in_rest' => true, + 'rest_base' => 'gp_events', 'public' => true, 'hierarchical' => false, 'template' => array( diff --git a/includes/core/classes/class-venue.php b/includes/core/classes/class-venue.php index ff38819b9..64f6b9c3b 100644 --- a/includes/core/classes/class-venue.php +++ b/includes/core/classes/class-venue.php @@ -104,6 +104,7 @@ public static function get_post_type_registration_args(): array { 'not_found_in_trash' => __( 'Not found in Trash', 'gatherpress' ), ), 'show_in_rest' => true, + 'rest_base' => 'gp_venues', 'public' => true, 'hierarchical' => false, 'show_in_menu' => 'edit.php?post_type=gp_event',