No featured media in API request

You don’t set featured image for your post ,so return 0 in feature image obj. after set it you can use featured image obj. for example: I wrote this with PHP, you can upload this to another host and display the images of the WordPress website that you specified in the URL variable on those … Read more

WP-API user email change confirmation

wp-api didn’t has any route for new user registration as the route /users requires authentication for create operation As far as I know, using proper authentication (I’m using JWT), rest API does let you create new users. The problem is that if you go that way, you have to implement your own mail-verifcation system, since … Read more

backbone fetch() not working

fetch returns a promise, so you want to wait until the promise is resolved. For example: new wp.api.models.Post( { id: 1 } ).fetch().then( console.log ); or doing something with the data: new wp.api.models.Post( { id: 1 } ).fetch().then( post => { console.log( post ); } ); To address your comment, Promises are async – so … Read more

WP Rest API get page from path

It is usually easier for me to decide how the front end should behave, and then determine how to get the appropriate data. So, in your example, services would be a module with some functionality, and then service-a would be the slug. However, if you only care about the URL looking the same you can … Read more

WP API to fetch all records for /posts, /media, /categories

They have modified this filter in the latest 2.0 Beta 14.0 release. The behavior with the value -1 you’re familiar with was in fact a bug. You should define new parameters in your request. This link should be interesting: https://github.com/WP-API/WP-API/issues/2357

How to upload image to wordpress from external page

Just to make sure: You have a local environment, without WooCommerce, from which you want to create a product in your WooCommerce WordPress site, and make sure that the images you provide are uploaded to your WordPress site. 1. Install library Make sure that you in your local environment have installed the WooCommerce REST API … Read more

OAuth signature does not match

I was facing a similar issue when trying to use Client-CLI with OAuth 1.0a plugin, however I found a solution here on the official repository. In the file lib/class-wp-json-authentication-oauth1.php on line 524, change the following code: $base_request_uri = rawurlencode( get_home_url( null, parse_url( $_SERVER[‘REQUEST_URI’], PHP_URL_PATH ), ‘http’ ) ); to: $home_url_path = parse_url(get_home_url (null,”,’http’), PHP_URL_PATH ); … Read more