Skip to content

Better support for custom content types #138

@artoliukkonen

Description

@artoliukkonen

Currently only way to query custom content types is with .root method.

/**
 * Generate a query against an arbitrary path on the current endpoint. This is useful for
 * requesting resources at custom WP-API endpoints, such as WooCommerce's `/products`.
 *
 * @method root
 * @param {String} [relativePath] An endpoint-relative path to which to bind the request
 * @param {Boolean} [collection] Whether to return a CollectionRequest or a vanilla WPRequest
 * @return {CollectionRequest|WPRequest} A request object
 */

It'd be great to be able to define your own custom content types so one would be able to use those just like .posts and .pages . I have some ideas how to achieve this, will try to do a pull request soon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions