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

Make assigning terms to a post less wonky #2032

Closed

Description

@danielbachhuber

To assign category ID 9 to post ID 1, I currently need to:

POST /wp/v2/posts/1/categories/9

This seems a bit wonky. It's also not possible to control the order of the terms, or assign more than one term at a time. See #1421

I'm not sure why we created separate endpoints for term management in the first place (I didn't search past discussion). What if, instead, we dropped the Post Terms controller, and magically registered categories, tags and other custom taxonomy-based attributes as an array of ids to the Post schema? This would be more in line with author, featured_image (which are ids that represent other resources).

cc @joehoyle

From #2016 (comment)

Activity

  1. added this to the 2.0 milestone on Jan 14, 2016
  2. joehoyle commented on Jan 14, 2016

    @joehoyle
    Member

    Yes! I'd much prefer this - I think we were thinking in the abstract when we did this, I'd be +1 for on the base object rather than a taxonomies prop, as a an update to the object is a bit more tricky if you only want to update a single taxonomy (which is probably more typical).

    So

    {
        id: int,
        categories: []
        tags: [],
        $taxonomy_rest_base: []
    
    }
    
  3. danielbachhuber commented on Jan 14, 2016

    @danielbachhuber
    MemberAuthor

    Let's get this into the next beta then.

  4. kadamwhite commented on Jan 18, 2016

    @kadamwhite
    Contributor

    separate endpoints for term management

    This would only impact how terms are associated with a specific post or object, then, correct—no impact to the /wp/v2/categories and such? If so, +1 from me; consistency in how these associated resources are managed within the API only sounds like a good thing.

  5. joehoyle commented on Jan 20, 2016

    @joehoyle
    Member

    I'm happy to take this on @danielbachhuber, will try to get it done on my flight tomorrow.

  6. danielbachhuber commented on Jan 20, 2016

    @danielbachhuber
    MemberAuthor

    Ok. If you don't get to it, I can pick it up at the end of the week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions