title: WP-API custom post type with custom taxonomy
body: <p>I'm fighting with <a href="https://github.com/WP-API/WP-API" rel="noreferrer">https://github.com/WP-API/WP-API</a> I'm trying to add in a custom post type with a custom taxonomy called listing_categy: 
  Querying this endpoint: </p>
  
  <p><a href="http://example.com/subfolder/wp-json/taxonomies/listing_categy/terms" rel="noreferrer">http://example.com/subfolder/wp-json/taxonomies/listing_categy/terms</a></p>
  
  <p>gives me this: </p>
  
  <pre><code>[
    {
      "ID": 9,
      "name": "buying",
      "slug": "buying-2",
      "description": "",
      "parent": null,
      "count": 1,
      "link": "http:\/\/example.com\/subfolder\/listing_categy\/buying-2\/",
      "meta": {
        "links": {
          "collection": "http:\/\/example.com\/subfolder\/wp-json\/taxonomies\/listing_categy\/terms",
          "self": "http:\/\/example.com\/subfolder\/wp-json\/taxonomies\/listing_categy\/terms\/7"
        }
      }
    },
    {
      "ID": 10,
      "name": "selling",
      "slug": "selling-2",
      "description": "",
      "parent": null,
      "count": 0,
      "link": "http:\/\/example.com\/subfolder\/listing_categy\/selling-2\/",
      "meta": {
        "links": {
          "collection": "http:\/\/example.com\/subfolder\/wp-json\/taxonomies\/listing_categy\/terms",
          "self": "http:\/\/example.com\/subfolder\/wp-json\/taxonomies\/listing_categy\/terms\/8"
        }
      }
    }
  ]
  </code></pre>
  
  <p>the php file that handles the posting is this <a href="https://github.com/WP-API/WP-API/blob/master/lib/class-wp-json-posts.php" rel="noreferrer">https://github.com/WP-API/WP-API/blob/master/lib/class-wp-json-posts.php</a> : </p>
  
  <pre><code>  /**
     * Create a new post for any registered post type.
     *
     * @since 3.4.0
     * @internal 'data' is used here rather than 'content', as get_default_post_to_edit uses $_REQUEST['content']
     *
     * @param array $content Content data. Can contain:
     *  - post_type (default: 'post')
     *  - post_status (default: 'draft')
     *  - post_title
     *  - post_author
     *  - post_excerpt
     *  - post_content
     *  - post_date_gmt | post_date
     *  - post_format
     *  - post_password
     *  - comment_status - can be 'open' | 'closed'
     *  - ping_status - can be 'open' | 'closed'
     *  - sticky
     *  - post_thumbnail - ID of a media item to use as the post thumbnail/featured image
     *  - custom_fields - array, with each element containing 'key' and 'value'
     *  - terms - array, with taxonomy names as keys and arrays of term IDs as values
     *  - terms_names - array, with taxonomy names as keys and arrays of term names as values
     *  - enclosure
     *  - any other fields supported by wp_insert_post()
     * @return array Post data (see {@see WP_JSON_Posts::get_post})
     */
    public function new_post( $data ) {
      unset( $data['ID'] );
  
      $result = $this-&gt;insert_post( $data );
      if ( $result instanceof WP_Error ) {
        return $result;
      }
  
      $response = json_ensure_response( $this-&gt;get_post( $result ) );
      $response-&gt;set_status( 201 );
      $response-&gt;header( 'Location', json_url( '/posts/' . $result ) );
  
      return $response;
    }
  </code></pre>
  
  <p>I've tried sending the json to the /posts and it works fine for all bar the terms.... </p>
  
  <p>I've tried all of the following: 
  this: </p>
  
  <pre><code>"title": $scope.listobject.listname, "status": "publish", "slug": "selling","type": "listing", "post_meta": $scope.dataform, "terms": { "listing_categy": [9] }
  </code></pre>
  
  <p>this: </p>
  
  <pre><code>"title": $scope.listobject.listname, "status": "publish", "slug": "selling","type": "listing", "post_meta": $scope.dataform, "terms": { "listing_categy": [ {"ID": 9 } ]} 
  </code></pre>
  
  <p>this: </p>
  
  <pre><code>"title": $scope.listobject.listname, "status": "publish", "slug": "selling","type": "listing", "post_meta": $scope.dataform, "terms": { "listing_categy": [9, 10 ] } 
  </code></pre>
  
  <p>This: </p>
  
  <pre><code>"terms_names": { "listing_categy": ["selling", "buying"] } 
  </code></pre>
  
  <p>the documentation is awful</p>