Skip to content

Releases: factor1/better-rest-endpoints

Add Page Template Names

09 Oct 17:28
Compare
Choose a tag to compare
Pre-release

Adds page template names to page(s) endpoints. If no template, returns default.

Update Menu Endpoint Response

07 Oct 20:04
Compare
Choose a tag to compare
Pre-release

Wraps up the menu endpoints.

Menus

better-wp-endpoints/v1/menus/{menu-slug}
Gets a WordPress Menu by slug. Accepts no parameters.

Returns the following JSON Response in each item object:

  • ID
  • menu_order
  • title
  • url
  • target
  • description
  • classes (array)
  • menu item parent

Add Menu Endpoints

07 Oct 20:01
Compare
Choose a tag to compare
Add Menu Endpoints Pre-release
Pre-release

Adds menu endpoints.

Initial Beta Release

06 Oct 18:16
Compare
Choose a tag to compare
Initial Beta Release Pre-release
Pre-release

Initial Beta Release.

better-wp-endpoints

A WordPress plugin that serves up slimmer WP Rest API endpoints - WIP

Endpoints

Posts

better-wp-endpoints/v1/posts
Gets a collection of posts. Accepts the following parameters:

  • page (int)
  • per_page (int)
  • category id (int)
  • tag id (int)
  • content (boolean) set to false to omit content from showing in JSON response

It returns a JSON response with the following:

  • id
  • slug
  • title
  • date (ISO 8601)
  • excerpt
  • content
  • all possible thumbnail sizes & URL
  • Author & Author ID
  • Categories
  • Category IDs
  • Tags
  • Tag IDs
  • ACF fields, if applicable

Post

better-wp-endpoints/v1/post/{id}
Get a post by ID.

Accepts the following parameters:

  • ID (int)

Returns a JSON response with the following:

  • id
  • slug
  • title
  • date (ISO 8601)
  • excerpt
  • content
  • all possible thumbnail sizes & URLs
  • Author & Author ID
  • Categories
  • Category IDs
  • Tags
  • Tag IDs
  • ACF fields, if applicable

Pages

better-wp-endpoints/v1/pages
Gets a collection of pages. Accepts the following parameters:

  • exclude (int)
  • orderby (string)
  • order (string - 'ASC' vs 'DESC')
  • per_page (int)
  • page (int)
  • content (boolean - setting to false hides the content from the response)

Returns the following JSON Response:

  • ID
  • Slug
  • Title
  • Content
  • ACF Fields
  • all possible thumbnail sizes & URLs

Page by ID

better-wp-endpoints/v1/page/{id}
Get a page by ID.

Accepts the following parameters:

  • ID (int)

Returns a JSON response with the following:

  • id
  • slug
  • title
  • content
  • all possible thumbnail sizes & URLs
  • ACF fields, if applicable

Custom Post Type Collection

better-wp-endpoints/v1/{custom_post_type}
Gets a collection of posts from a custom post type. Accepts the following parameters:

  • per_page (int)
  • page (int)
  • content (boolean - setting to false omits the_content from being returned)

Returns the following JSON response:

  • ID
  • slug
  • title
  • date (ISO 8601)
  • post terms
  • excerpt
  • content
  • all possible thumbnail sizes & URLs
  • Author & Author ID
  • ACF fields if applicable

Custom Post Type Post

better-wp-endpoints/v1/{custom_post_type}/{id}
Gets a single custom post type item. Accepts the following parameters:

  • ID

Returns the following JSON Response:

  • ID
  • slug
  • title
  • date (ISO 8601)
  • post terms
  • excerpt
  • content
  • all possible thumbnail sizes & URLs
  • Author & Author ID
  • ACF Fields, if applicable