Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Remove hardcoded /pages references #78

Merged
merged 1 commit into from

1 participant

@rmccue
Owner

Thanks to @thenbrent for this, from #28.

@rmccue rmccue added this to the 0.9 milestone
@rmccue rmccue added the Bug label
@rmccue rmccue self-assigned this
@rmccue rmccue merged commit 0fbe7f7 into master
@rmccue rmccue deleted the replace-hardcoded-pages-references branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 17, 2014
  1. @rmccue
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/class-wp-json-pages.php
View
4 lib/class-wp-json-pages.php
@@ -107,10 +107,10 @@ protected function prepare_post( $post, $context = 'view' ) {
$_post = parent::prepare_post( $post, $context );
// Override entity meta keys with the correct links
- $_post['meta']['links']['self'] = json_url( '/pages/' . get_page_uri( $post['ID'] ) );
+ $_post['meta']['links']['self'] = json_url( $this->base . '/' . get_page_uri( $post['ID'] ) );
if ( ! empty( $post['post_parent'] ) )
- $_post['meta']['links']['up'] = json_url( '/pages/' . get_page_uri( (int) $post['post_parent'] ) );
+ $_post['meta']['links']['up'] = json_url( $this->base . '/' . 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.