Questions tagged [wp-api]

Provides an easy to use HTTP REST API to access your WordPress site’s data.

This project was born to create an easy-to-use, easy-to-understand and well-tested framework for creating these APIs, plus creating APIs for core.

This plugin provides an easy to use REST API, available via HTTP. Grab your site’s data in simple JSON format, including users, posts, taxonomies and more. Retrieving or updating data is as simple as sending a HTTP request.

Official website

235 questions
7
votes
3 answers

WordPress REST API - more than 10 posts

I searched this issue and tried several solution with no luck. My main route is here: https://cnperformance.wpengine.com/wp-json/wp/v2/products?_embed I installed the 'WP REST API filter parameter' plugin to restore filter removed when REST API…
kurtg
  • 73
  • 1
  • 1
  • 5
7
votes
2 answers

Assign custom taxonomy to post with REST API

I'm using the built-in WP REST API to create posts (custom post type). I've got this part working, below is some example JSON I submit to create a new post. { "title": "The story of Dr Foo", "content": "This is the story content", …
ProEvilz
  • 5,310
  • 9
  • 44
  • 74
7
votes
1 answer

Using Contact Form 7 via WP REST API

Having little access to the server on this external site, I have used WordPress and the WP REST API v2 to pull in content that is, of course, managed on WordPress. Works great! I have been able to post Contact Form 7 data from this external site to…
pelicanpaul
  • 196
  • 1
  • 8
7
votes
4 answers

WP Rest API + AngularJS : How to grab Featured Image for display on page?

I am accessing Wordpress data through an HTTP REST API plugin (this wordpress plugin: http://v2.wp-api.org/). I know how to grab my post title, but how do I display the featured image associated with that post using this plugin? My test shows the…
redshift
  • 4,815
  • 13
  • 75
  • 138
6
votes
3 answers

Wordpress API json, how to get prev and next posts in single post?

how to get prev and next posts in single post wordpress api, i can't get this, how to make json prev and next like in wordpress without API i want to get slug posts i can use next prev in single post, how to get slug, link, or id post for next and…
Ikhsan Mahendri
  • 143
  • 2
  • 9
6
votes
2 answers

Query Multiple Post Types Using WP REST API V2 (WordPress)

I have used WordPress REST API Version 1 (V1) in the past on several websites. One feature that I used extensively was the ability to call multiple post types in a single query. In WP REST API Version 1 I was able to use the following endpoint to…
Marc
  • 4,661
  • 3
  • 40
  • 62
6
votes
2 answers

Custom route endpoint for WP-REST API gives "code": "rest_no_route", error

I am following this tutorial to create custom end points to WP-API . I am always getting this error on hitting /wp-json/custom-plugin/v2/get-all-post-ids/ on postman to test : { "code": "rest_no_route", "message": "No route was found…
Divyanshu Jimmy
  • 2,542
  • 5
  • 32
  • 48
6
votes
1 answer

WordPress REST API - Allow anyone to POST

I am building an application on WordPress that requires a simple front end form where anyone can submit information that needs to be saved in the database. I am attempting to handle this through the REST API. (Due to the nature of the application,…
Marc
  • 4,661
  • 3
  • 40
  • 62
6
votes
2 answers

Restsharp returns 403 while Postman returns 200

This is the (modified) snippet that Postman gives for successful call to my page. var client = new RestClient("http://sub.example.com/wp-json/wp/v2/users/me"); var request = new RestRequest(Method.GET); request.AddHeader("authorization", "Basic…
steakoverflow
  • 1,206
  • 2
  • 15
  • 24
6
votes
1 answer

Authenticate custom WP API endpoint with social login (OAuth)

I'm using Wordpress + WooCommerce in combination with the WP-API as a backend for my mobile ecommerce App. My goal is to offer some social login (via Facebook, Twitter, Google etc.) within the app to register/login and then use the WooCommerce API…
flavordaaave
  • 644
  • 9
  • 21
5
votes
1 answer

Get posts with WP-REST without authentication

I'm new to WP-REST API and Wordpress in general. I've tried to get the posts list using the endpoint wp-json/wp/v2/posts but I get the classic 403 error. I'd like to ask if there is a way to disable authentication for GET requests like posts,…
Leo
  • 150
  • 1
  • 9
5
votes
2 answers

Register rest route in a class library do not work

I have run in two an issue with building a WP plugin, the issue is that I want to use the WP Rest API and to extend it, with my own endpoint. I'm writing the code using a class object, I register add_action('rest_api_init' the problem I have is that…
Totta Zetterlund
  • 313
  • 5
  • 18
5
votes
1 answer

WP-API get posts and order them by a descending order

I am trying to grab posts and order them by date, in a descending order. I am talking about this API: https://github.com/WP-API/WP-API I…
Ariel Weinberger
  • 2,195
  • 4
  • 23
  • 49
4
votes
2 answers

How to store data from API so that it can be accessible in other components

I am doing a project with React.js and Wordpress REST API. All this time I have been using axios to get the data from API whenever the component mounts. This means that every single time I render a component that has to display some data I make an…
4
votes
1 answer

WP API V2: Query posts by ACF

I would like to query my posts by filtering for a custom meta added with Advanced Custom Fields. It's a boolean meta, so every post will have something like: GET http://localhost/wp-json/wp/v2/posts { ... "acf" : { "highlight" : true } …
LucaP
  • 638
  • 1
  • 12
  • 34
1
2
3
15 16