Skip to content

Loading…

Fix /pages parent link base route #27

Merged
merged 1 commit into from

2 participants

@thenbrent

Fixes the use of /posts base route for a child page's 'up' link.

@rmccue rmccue merged commit a60a135 into WP-API:master
@rmccue
WordPress REST API Team member

:cake:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 1, 2013
  1. @thenbrent
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/class-wp-json-pages.php
View
2 lib/class-wp-json-pages.php
@@ -110,7 +110,7 @@ protected function prepare_post( $post, $context = 'view' ) {
$_post['meta']['links']['self'] = json_url( '/pages/' . get_page_uri( $post['ID'] ) );
if ( ! empty( $post['post_parent'] ) )
- $_post['meta']['links']['up'] = json_url( '/posts/' . get_page_uri( (int) $post['post_parent'] ) );
+ $_post['meta']['links']['up'] = json_url( '/pages/' . get_page_uri( (int) $post['post_parent'] ) );
return apply_filters( 'json_prepare_page', $_post, $post, $context );
}
Something went wrong with that request. Please try again.