Some WP-API Tips for WordPress 4.7+

Now that the WP-API is in core, here are some useful tips for you. Filtering Posts Filtering posts was a bit confusing for me at first, because the documentation seems to suggest you would visit an endpoint like /posts/category/40 to get posts from a certain category. Instead, you are supposed to use arguments in your […]

Dealing with Custom Taxonomies in the WP-API

Update: this article focuses on the WP-API v1. Click here for an article on filtering with the WP-API v2 in WordPress 4.7+. I have recently started working on a mobile app for a WordPress site that relies heavily on custom taxonomies. The app needs to pull in posts from WordPress through the WP-API, and allow […]

Working with Custom Post Types in WP-API v2

If you worked with the first version of the WP-API, you know that getting custom post types was really easy. To get all posts, I could send a GET request to http://scottbolinger.com/wp-json/posts. To get a specific type, I could send my request to http://scottbolinger.com/wp-json/posts?type=event. There have been some pretty big changes in version 2, which […]

Basic Authentication with the WP-API (v2) and AngularJS

Working on the WP-App Project, we need to use authentication to do certain things in the app. Deleting/approving comments, or listing users for example. Basic Authentication is handy for testing code, but it should only be used in development, since you send the user/pass with every request. For production, you’ll want to use OAuth from […]