Skip to content

Endpoints

Murhaf Sousli edited this page May 7, 2017 · 3 revisions

After choosing the type of request (Collection/Model), choose the endpoint:

// These are the same
this.wp.collection().posts()
this.wp.collection().endpoint('posts')
this.wp.collection().endpoint('/wp-json/wp/v2/posts/')

// These are the same
this.wp.collection().pages()
this.wp.collection().endpoint('pages')
this.wp.collection().endpoint('/wp-json/wp/v2/pages/')

// for custom post type 
this.wp.collection().endpoint('/wp-json/wp/v2/projects/')

same thing for the directive

<div wpCollection="posts" ...>
<div wpCollection="categories" ...>
<!-- for custom post type -->
<div wpCollection="/wp-json/wp/v2/orders/" ...>

Default Endpoints:

  • posts
  • pages
  • users
  • categories
  • tags
  • taxonomies
  • statuses
  • comments
  • media
Clone this wiki locally