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
4
votes
1 answer

Add Post Meta Fields via WP API v2

I'm trying to play with the WP API v2 and insert posts from Postman. If I post this raw request, it creates a post just fine: { "title": "Test Title", "content": "Test Content", } However, I'm trying to add some custom field values to this as…
Xhynk
  • 13,513
  • 8
  • 32
  • 69
4
votes
0 answers

Wordpress REST API: Filter custom post type with multiple filters

I've a custom post type "products" for which I created custom field with the Advanced Custom Fields (ACF) plugin. When I request products with /wp-json/wp/v2/products every product has acf attributes e.g.: "acf": { "rating": 77 "fun-factor":…
EachOne
  • 91
  • 3
4
votes
1 answer

Gravity Forms & ReactJS - Loading Form into Modal and submitting

I am currently stuck on a problem with Gravity Forms and ReactJS. I am trying to load a Gravity Form as a Modal in a ReactJS component for contact purposes. Basically, how I am currently set up is by doing a GET from the WP-API for the page with the…
4
votes
1 answer

Retrieve posts by custom field with WP-REST-API in Javascript

What is the right URL to retrieve posts by meta_query with the WP-REST-API? The custom field I want to use can contain multiple values, I tried this for custom field which only can contain a single value and this works.…
colin
  • 425
  • 2
  • 5
  • 17
4
votes
2 answers

WP-API : max num pages

$opts = array(); // any arguments $query = WP_Query($opts); Normally, we can get max_num_pages by using $totalPages = $query->max_num_pages; But, i make json request by using this plugin http://wp-api.org/. When i was trying to retrieve posts…
jvs
  • 53
  • 2
  • 5
3
votes
3 answers

Why won't useEffect run my API fetch anymore and save results to state?

GOALS: Note that examples used are not the exact context of my project, but are very similar, and therefore simplified for the sake of this post I am trying to use WP-API to use Wordpress categories, post titles, and post content to generate a…
ggoldammer
  • 33
  • 1
  • 4
3
votes
1 answer

How can I do a WpGraphQL query with a where clause?

This works fine query QryTopics { topics { nodes { name topicId count } } } But I want a filtered result. I'm new to graphql but I see a param on this collection called 'where', after 'first',…
Hcabnettek
  • 12,678
  • 38
  • 124
  • 190
3
votes
1 answer

WP API Comments: posting a comment containing emojis?

I'm having an issue on a React Native / WP API mobile app. I want to use WP Comments via WP API to post comments on news. Everything works fine, except the emojis part. I can POST request with text, emoticons (smileys), but when I try to post a…
enguerranws
  • 8,087
  • 8
  • 49
  • 97
3
votes
3 answers

WP API Get Post Tags

Trying to get post tags with wordpress API - api call is /wp-json/wp/v2/posts ourHTMLString += '"' + postsData[i].tags + '"'; It is returning these values "tags": [ 766, 19, 578 ], I need the tag…
roshambo
  • 2,624
  • 6
  • 31
  • 54
3
votes
1 answer

React on existing Wordpress site

I have a WP site working. It has everything rendered by using PHP files. Now, I would like to change one page of my site to be based on React. Meaning one page-template that will execute react JS code instead of PHP. Can this be done? I found that…
Ido Barash
  • 4,856
  • 11
  • 41
  • 78
3
votes
2 answers

Custom wordpress login with API Rest and angular

is there a way to create a Custom login with the API Rest of Wordpress and angular. Currently I'm using the WP REST API - OAuth 1.0a Server plugin but I can´t figure out how to do it Or maybe its posible using the two methods (Basic Authentication…
Mauro
  • 1,472
  • 12
  • 22
3
votes
1 answer

WordPress WP REST API limiting requests by domain

This seems like it would be more obvious. I use WordPress to manage content for an external site. The WordPress content is displayed via the WP REST API and I display content with ajax and JS to this remote site. (e.g.…
pelicanpaul
  • 196
  • 1
  • 8
3
votes
2 answers

WP API Filter By Post Schema

Is it possible to return a list of posts based from the Wordpress Rest API v2 based on their schema: For List of Schemas: http://v2.wp-api.org/reference/posts/ I want to filter by sticky field, but the same would go for the rest of the fields. So…
3
votes
1 answer

Combining results from WP-API using AngularJS

I currently have this site - http://dev.5874.co.uk/scd-data/ where I have a dropdown which displays results from WP-API which I am pulling in through AngularJS. It currently combines the two sets of results as they're separate URL's, the results…
Lucy Brown
  • 264
  • 4
  • 17
3
votes
3 answers

Wordpress wp-api Get Users By Username

I have just installed this plugin into our WP site and am trying to figure out how to property use the users endpoint to find a user by their username. I have tried the filter several different ways, but it keeps returning all users. Has anyone…
Paul Zepernick
  • 1,452
  • 1
  • 11
  • 25
1 2
3
15 16