You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 24, 2018. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 24, 2018. It is now read-only.
Yea, I ran into this the other day as well. This part of the code was not updated to coincide with how terms are associated currently. Try /wp/v2/posts/{post_id}/terms/{taxonomy_slug}, e.g. /wp/v2/posts/1/terms/category.
Looks like we removed the ability to pass the post parameter to the terms controller when we added the posts/{id}/terms routes in #1216.
According to 1ca5182 from @joehoyle this was done to "make it easier". I believe the intent here was to only allowing the post terms to be queried from one endpoint instead of two different endpoints.
@michaelperrin Do you have any issues with using the `/wp/v2/posts/{id}/terms/{slug} route instead?
@rachelbaker {slug} or {rest_base}? More confusion around this often duplicate, sometimes confusing rest_base property (#1381). It really should be dropped in favor of slug. It's hijacking the purpose that slug was designed for just to work around the subjective idea that "post_tag" is "ugly."
After beginning tests with REST v2-beta3 this week, making (updating REST v1) a demo HTML5 app with framework7 (listing posts and displaying one each post), I encountered these issues to recover terms of selected terms/taxonomies.
Route like /wp/v2/posts/{id}/terms/{slug} works (but is not yet in the JSON response)
The _links response is with a link/url indexes for terms response of route ‘/wp-json/wp/v2/posts’.
But, my question is about denomination of index of the terms response ? why use an index named like an URL ‘http://v2.wp-api.org/term’ ? In javascript, it is not very easy to manipulate the object after parsing (JSON.parse). To find the array, a var (with value with this link) must be used to work with the results and this index. Example: var term_series = “http://v2.wp-api.org/term”; … console.log(JSON.stringify( this._links[term_series] )); …
Activity
jdolan commentedon Jul 6, 2015
Yea, I ran into this the other day as well. This part of the code was not updated to coincide with how terms are associated currently. Try
/wp/v2/posts/{post_id}/terms/{taxonomy_slug}, e.g./wp/v2/posts/1/terms/category.michaelperrin commentedon Jul 6, 2015
@jdolan Thanks, that's exactly what I was looking for! So the problem is more about the related links in the "get post" response.
jdolan commentedon Jul 6, 2015
Correct. Your bug report is valid -- but at least hopefully you're unblocked now :)
rachelbaker commentedon Jul 6, 2015
Looks like we removed the ability to pass the
postparameter to the terms controller when we added theposts/{id}/termsroutes in #1216.According to 1ca5182 from @joehoyle this was done to "make it easier". I believe the intent here was to only allowing the post terms to be queried from one endpoint instead of two different endpoints.
@michaelperrin Do you have any issues with using the `/wp/v2/posts/{id}/terms/{slug} route instead?
michaelperrin commentedon Jul 6, 2015
@rachelbaker I don't mind at all! I actually prefer the new syntax, thanks for asking!
It's just that the
_linksentries should be updated accordingly as it is a bit misleading for now.jdolan commentedon Jul 6, 2015
@rachelbaker {slug} or {rest_base}? More confusion around this often duplicate, sometimes confusing
rest_baseproperty (#1381). It really should be dropped in favor ofslug. It's hijacking the purpose thatslugwas designed for just to work around the subjective idea that "post_tag" is "ugly."dev-xiligroup commentedon Jul 10, 2015
After beginning tests with REST v2-beta3 this week, making (updating REST v1) a demo HTML5 app with framework7 (listing posts and displaying one each post), I encountered these issues to recover terms of selected terms/taxonomies.
Route like
/wp/v2/posts/{id}/terms/{slug}works (but is not yet in the JSON response)The _links response is with a link/url indexes for terms response of route ‘/wp-json/wp/v2/posts’.
But, my question is about denomination of index of the terms response ? why use an index named like an URL ‘http://v2.wp-api.org/term’ ? In javascript, it is not very easy to manipulate the object after parsing (JSON.parse). To find the array, a var (with value with this link) must be used to work with the results and this index. Example:
var term_series = “http://v2.wp-api.org/term”; … console.log(JSON.stringify( this._links[term_series] )); …michaelperrin commentedon Aug 6, 2015
Thanks @rachelbaker !