Skip to content
This repository has been archived by the owner on Sep 24, 2018. It is now read-only.

Ensure Terms link to their appropriate Taxonomy #1814

Merged
merged 2 commits into from
Dec 9, 2015

Conversation

danielbachhuber
Copy link
Member

Fixes #1296

@danielbachhuber danielbachhuber added this to the 2.0 Beta 9 milestone Dec 9, 2015
@danielbachhuber
Copy link
Member Author

@WP-API/amigos #reviewmerge

@danielbachhuber
Copy link
Member Author

local ➜  ~  http GET wordpress-develop.dev/wp-json/wp/v2/categories/1
HTTP/1.1 200 OK

{
    "_links": {
        "about": [
            {
                "href": "http://wordpress-develop.dev/wp-json/wp/v2/taxonomies/category"
            }
        ],
        "collection": [
            {
                "href": "http://wordpress-develop.dev/wp-json/wp/v2/categories"
            }
        ],
        "self": [
            {
                "href": "http://wordpress-develop.dev/wp-json/wp/v2/categories/1"
            }
        ]
    },
    "count": 111,
    "description": "",
    "id": 1,
    "link": "http://wordpress-develop.dev/blog/category/uncategorized/",
    "name": "Uncategorized",
    "parent": 0,
    "slug": "uncategorized",
    "taxonomy": "category"
}

@@ -484,6 +484,9 @@ protected function prepare_links( $term ) {
'collection' => array(
'href' => rest_url( $base ),
),
'about' => array(
'href' => rest_url( sprintf( 'wp/v2/taxonomies/%s', $this->taxonomy ) ),
),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closing paren is off ;)

@rmccue
Copy link
Member

rmccue commented Dec 9, 2015

lgtm, needs standards tweak

danielbachhuber added a commit that referenced this pull request Dec 9, 2015
Ensure Terms link to their appropriate Taxonomy
@danielbachhuber danielbachhuber merged commit dbbf512 into develop Dec 9, 2015
@danielbachhuber danielbachhuber deleted the 1296-term-link-taxonomy branch December 9, 2015 23:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants