Articles of wp api

How to quickly reorder posts in the admin panel that will persist for the wp-api

I generally use the Intuitive Custom Post Order plugin for any WordPress sites I work with so clients can order their posts visually. For this project, I’m using WordPress as an admin panel and consuming it’s data with an Ember.js front-end. (using wp-api V.2) The re-ordered order doesn’t show in the JSON and I’m guessing […]

Mass importing json data into custom fields (postmeta)

I am in the process of importing large amounts of data into a custom post type that has several custom fields (postmeta fields created by Advanced Custom Fields). I am using the following function to import the data and it works fine with my test file of about 10 posts with the exception of the […]

OAuth signature does not match

I am using the below in my wordpress for developing a oauth based application. WP-API (api generating plugin) WP API OAuth1 (oauth server)and WP API client-cli (oauth client library) at the below url is for the wp client-cli https://man-sudarshann-1.c9.io/api/ I am getting this error OAuth signature does not match when I click the AUTH button […]

node-wpapi: how to handle authentication?

I’m referring to official node-wpapi javascript client library for official (4.7+) REST APIs. Here the doc: http://wp-api.org/node-wpapi/authentication/#cookie-authentication I’m reading the Cookie Authentication paragraph, but I’m not in this situation. I’m trying to build a Single Page App, so I need to register/login/logout the user using REST API. I don’t need to use node-wpapi, I could […]

Get more than 10 posts in a specific category with the wordpress api

I’m currently building an Ionic app that uses the WordPress api. I can retrieve posts in a specific category by using the following: // Retrieve filtered data for the categories to show posts. function getCategoryName(categoryName) { return ($http.get(svampeURL + ‘posts?categories=’ + categoryName).then(handleSuccess, handleError)); } The problem is that it only returns 10 as it is […]

Inserting custom post meta value using WP-REST API

I’m using this tutorial to insert a post via front-end using WP-REST API. I have added more fields to add custom post meta data to the post but while the post is being submitted via the front-end, the custom post meta are not being inserted. I’m not sure where I am going wrong. Form.php: <?php […]

How to make a WP REST API query with meta_query in WP4.7?

There is no “filter” parameter in WP REST API WP 4.7 and this call doesn’t work: http://domain.tld/wp-json/wp/v2/cpt_name?meta_query[0][key]=cf_name&meta_query[0][value][0]=cf_value1&meta_query[0][value][1]=cf_value2&meta_query[0][compare]=IN Does anyone here know how to make a query via WP REST API in WP4.7?

WP REST API V2 – Modifying responses

I am trying to modify the response object of a WP REST API (v2) call following this guide: http://v2.wp-api.org/extending/modifying/ I have a post type called Careers and a taxonomy called Regions. Both are set to “show_in_rest” => true I am using pretty permalinks. When I GET mydomain/wp-json/wp/v2/careers it returns results as expected. So far so […]

WP-API: how do I allow authenticated clients only?

I set up an OAuth client for WP-API following the instructions for WP-API/OAuth1 on github. I was disappointed to realise afterwards that all of the site’s content remains available over the API, including all sorts of not-really-public metadata like user registration dates. I don’t want this. How do I restrict the JSON API to allow […]

How to filter or search the posts using postmeta tables custom meta fields with wordpress REST API

I’m new to wordpress and also working with WP REST API for mobile application development for the wordpress website. Here I want get data’s filter & search based post meta custom fields. I’ve tried for this example but getting all results not belongs property_featured=1 Kindly find my postmeta table structure for example. meta id post […]