From 76a5b9e863dc5a850d43f4973a8520bb5eb397d0 Mon Sep 17 00:00:00 2001 From: Rikard Date: Fri, 19 Apr 2019 21:48:17 -0400 Subject: [PATCH 1/2] Added REST API support https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-rest-api-support-for-custom-content-types/ --- projects.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/projects.php b/projects.php index 34db85d..35d37f6 100644 --- a/projects.php +++ b/projects.php @@ -176,7 +176,8 @@ public function register_post_type () { 'excerpt' ), 'menu_position' => 5, - 'menu_icon' => 'dashicons-portfolio' + 'menu_icon' => 'dashicons-portfolio', + 'show_in_rest' => true ); $args = apply_filters( 'projects_register_post_type', $args ); @@ -480,4 +481,4 @@ private function upgrade_data( $upgrade_data = false ) { global $projects; -$projects = new Projects( __FILE__ ); \ No newline at end of file +$projects = new Projects( __FILE__ ); From 54dad8ce01254e4ff3c8feda759a3d1a900d5d6d Mon Sep 17 00:00:00 2001 From: Rikard Date: Fri, 19 Apr 2019 22:24:20 -0400 Subject: [PATCH 2/2] Added Tags and Category Taxonomies --- projects.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/projects.php b/projects.php index 35d37f6..8293746 100644 --- a/projects.php +++ b/projects.php @@ -177,7 +177,11 @@ public function register_post_type () { ), 'menu_position' => 5, 'menu_icon' => 'dashicons-portfolio', - 'show_in_rest' => true + 'show_in_rest' => true, + 'taxonomies' => array( + 'post_tag', + 'category' + ) ); $args = apply_filters( 'projects_register_post_type', $args );