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

Conversation

@jdolan
Copy link
Contributor

@jdolan jdolan commented Jul 25, 2015

  • When the client attempts to create a term that already exists, we should return to them the term_taxonomy_id as part of the error data, NOT the term_id. The term_id is useless and arguably dangerous to the client, since they may attempt to use it elsewhere (ahem ;)).
  • When associating terms, we must resolve the term_id from the client-provided term_taxonomy_id. Wordpress core uses the term_id to make the association.

jdolan added 2 commits July 25, 2015 09:25
…m_taxonomy_id with WP core's use of term_id.
… of the term_taxonomy_id, not the term_id. The term_id is useless to the client.
@rmccue
Copy link
Member

rmccue commented Jul 26, 2015

Thanks for the pull request! Good catch on the issue!

The tests are currently failing here due to your code not matching the WP coding standards. Can you fix these up please? :)

@rmccue rmccue added this to the 2.0 Beta 4 milestone Jul 26, 2015
@jdolan
Copy link
Contributor Author

jdolan commented Jul 26, 2015

All set. Would you mind re-opening #1395 until this is resolved so that other folks experiencing the same problem might find the solution?

@rmccue
Copy link
Member

rmccue commented Aug 7, 2015

This is missing a bit of test coverage on the new lines, but I'm not sure there's a way to test this with the latest versions of WP, since IIRC they don't let you create a term where term_taxonomy_id != term_id.

With that considered, merging. Thanks for the PR!

rmccue added a commit that referenced this pull request Aug 7, 2015
Resolves two issues with term creation and term assocaition
@rmccue rmccue merged commit 51023d3 into WP-API:develop Aug 7, 2015
@jdolan
Copy link
Contributor Author

jdolan commented Aug 7, 2015

👍

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