Articles of restful

WordPress REST API Plugin Development – Add Custom Endpoint

I have this question on Stack Overflow but thought here might be a better place for it… I’m almost certainly doing something stupid – or rather not doing something obvious that I should have done. I’m writing a plugin to expose a function via http POST so I can send JSON to my wordpress app […]

Call Web Services on post first publish

I want to call some web service when i publish a post. I want to add a checkbox so as to decide whether to call or not call after publishing. I have found the code to call both REST and SOAP web services but i dont know: How to add a checkbox in the “new […]

REST alert when new WordPress post is published or updated

I have a custom PHP application and a WordPress instance running as 2 completely separate codebases on the same server. I would like my custom PHP application to be able to consume content from the WordPress instance as and when it is published or updated. I am using the excellent WP API to retrieve JSON […]

Post to WordPress using REST API from external site

I am trying to post to WordPress using the REST API. The aim is to have a form that accepts The following information: Title Content ACF Custom Field 1 (possibly repeater field) ACF Custom Field 2 (possibly repeater field) Featured Image I am new to the WP API and am having some difficulty finding some […]

wp_remote_get keeps timing out

I’m making a plugin that compares data from external API with meta items in WordPress backoffice. I tried using wp_remote_get method to query my API but it doesn’t return anything, nobody, nothing. When accessed directly with the same URL in browser the API generates JSON array without problems. What am I doing wrong? This is […]

How to loop through JSON data in wordpress WP REST API

I am using the WP REST API plugin in wordpress and want to loop through my json data using a for each loop, however when I var_dump the variable that the json data is stored in it gives me an error. “Parse error: syntax error, unexpected ‘->’ (T_OBJECT_OPERATOR) in C:\wamp\www\public_html\wp-content\themes\raj\template-wiki.php on line 22″ <?php $json […]

WP – API – OAuth 1.0a Server, How to implement with AngularJS?

I making an Angular WordPress theme and I want to add authentication to it using the WP REST API – OAuth 1.0a Server plugin, which isn’t documented not very well. I get oauth_token and oauth_token_secret using Postman, But I haven’t got an idea on how to implement OAuth 1.0a in my AngularJS theme. I’ve googled […]

AFNetworking incorrectly interpreted WP_Error

I have client code that communicates with the server to create an account. The communication works, but the error response is not received correctly. In the Objective-C code below, I use AFNetworking to send the request. I purposely sent an invalid email address and expected the failure block to get executed, but my code kept […]

How do I query my WordPress posts on another HTML page using the WordPress Restful API?

I have a fully functional WordPress site and I want the to create a new separate website that displays the posts from the wordpress site using the WordPress Rest API. I understand that typing http://my-website/wp-json/wp/v2/posts into a browser shows me this information but I want to code it into the new separate site. I don’t […]

Prevent wp_insert_user from creating duplicate users

I have a custom plugin that automatically creates a new user via wp_insert_user() if the current user does not exist yet. We use data from our remote ldap server to provide the new user’s details (user_login, user_email, etc.) for the wp_insert_user() function call. This works without a hitch on most of our sites, but on […]