From 39abc8a03d950d6d0cb8aa61fa9258285593dbc4 Mon Sep 17 00:00:00 2001 From: thenbrent Date: Sat, 30 Nov 2013 21:32:34 -0800 Subject: [PATCH] Fix /pages references in WP_JSON_CustomPostType --- lib/class-wp-json-customposttype.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/class-wp-json-customposttype.php b/lib/class-wp-json-customposttype.php index e8ceeac3dd..c72966ab48 100755 --- a/lib/class-wp-json-customposttype.php +++ b/lib/class-wp-json-customposttype.php @@ -71,7 +71,7 @@ public function registerRoutes( $routes ) { * @return array Modified routes */ public function registerRevisionRoutes( $routes ) { - $routes[ '/pages/(?P\d+)/revisions' ] = array( + $routes[ $this->base . '/(?P\d+)/revisions' ] = array( array( '__return_null', WP_JSON_Server::READABLE ), ); return $routes; @@ -185,7 +185,7 @@ protected function prepare_post( $post, $context = 'view' ) { 'links' => array( 'self' => json_url( $this->base . '/' . $post['ID'] ), 'author' => json_url( '/users/' . $post['post_author'] ), - 'collection' => json_url( '/pages' ), + 'collection' => json_url( $this->base ), 'replies' => json_url( $this->base . '/' . $post['ID'] . '/comments' ), 'version-history' => json_url( $this->base . '/' . $post['ID'] . '/revisions' ), ),