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

How to modify wp json api media response

I'm trying to add an extra field to the wp json api reponse for the '/media' endpoint. Following the doc, I have it working for '/posts' or '/pages', but I cannot figure out how to add a field for the '/media' endpoint. So (for '/posts' or '/pages')…
Denis Florkin
  • 33
  • 1
  • 8
2
votes
0 answers

Wordpress Rest API V2: Return number of post per page via endpoint

How to output custom post type post per page via wp rest api v2 endpoints? I know i could use this: http://localhost/wp-json/wp/v2/products?filter[post_per_page]=2 But i would like to implement it via endpoints changing the url is not an option at…
per.eight
  • 428
  • 7
  • 17
2
votes
1 answer

HTML tags showing in AngularJS

I have an app which is pulling in data from another site using the Wordpress plugin WP-API. I'm suing AngularJS to then display this information, I'm really new to AngularJS so my problem is that the correct information is being pulled in from the…
Lucy Brown
  • 264
  • 4
  • 17
2
votes
1 answer

Wordpress custom page template and WP-API

My Wordpress site uses custom template pages like this one:
Mindaugas
  • 23
  • 1
  • 3
2
votes
1 answer

WP-API oAuth Server to Server Flow

I'm a little confused about the flow I need to use if trying to connect to a remote Wordpress WP-API from another server (in this case another WP instance on the same server). I am using the PECL oAuth package, and most of the code I gathered up…
FirstDivision
  • 1,340
  • 3
  • 17
  • 37
2
votes
2 answers

WP-REST API excluding category doesn't work

I used this semi-official plugin to enable API call. But I can't find a way to exclude category. For example if I have mysite.com/wp-json/wp/v2/posts?filter[category__not_in]=10, it will ignores the filter and show all latest posts. Is there a way…
hrsetyono
  • 4,474
  • 13
  • 46
  • 80
2
votes
0 answers

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…
bobsilon
  • 1,648
  • 4
  • 20
  • 33
2
votes
3 answers

WP Rest API Get Featured Image

I am building a relatively simply blog page that uses the WP Rest Api and AngularJs to show the data on the front-end. On my home page I want to return the title, followed by the featured image, followed by the excerpt. I have pulled the title and…
plantpowerjames
  • 375
  • 2
  • 10
  • 22
2
votes
2 answers

How to get site's name from WP API

I'm trying to get WordPress website title using javascript and WP API plugin I didn't find any example on how to get the site's name but I found the variable name under the entities section in the developer guide function…
Murhaf Sousli
  • 12,622
  • 20
  • 119
  • 185
2
votes
1 answer

wp-api : How can I update user meta?

Right now, I can retrieve users like this ( via Angularjs and angular-wp-api ): [everything is written in coffee here] req= method: 'GET' url: wpAPIData.base + "/users/me" headers: 'X-WP-Nonce':…
Nkokoro
  • 33
  • 4
2
votes
1 answer

How can I add attachments to a post with WP-API

I am creating posts with WP-API and I want to attach files to them. I see a section in the docs saying "create an attachment", but it seems that it doesn't associate the file with a post. I also don't see any other obvious way to associate a…
user2173353
  • 4,316
  • 4
  • 47
  • 79
2
votes
0 answers

PHP curl with WP API, Missing parameter data

I have this curl command that works on command line to create wordpress post curl --user admin:password -X POST http://localhost/wordpress/wp-json/posts --data "title=value1&content_raw=value2" So I want to convert in into Curl with PHP, this the…
cyberfly
  • 5,568
  • 8
  • 50
  • 67
2
votes
0 answers

Using WP-API Basic Authentication with AngularJS $http via setting header not working

So I want to get login user info use WP-API backend and AngularJS front end (mobile app, NOT same domain). I installed WP-API Basic Authentication on my server side and test it with curl --user muhua.hou:123123123…
Hugh Hou
  • 2,344
  • 5
  • 31
  • 55
1
vote
1 answer

Determine when theme block editor settings have loaded in block editor

I'm facing difficulties in determining the ideal timing to programmatically change settings that are provided by the theme in the themes block editor. My goal is to modify these settings as soon as they are fully loaded into the block editor. To…
bewww
  • 39
  • 2
  • 6
1
vote
0 answers

Set custom meta tags in a WordPress Post using WPAPI

I'v been trying to figure out how to set meta tags using the Node JS WPAPI (which feels outdataed) WP library, but cant get it working. For example, how would you add the tag to the HTML of a…
Mike Barnes
  • 4,217
  • 18
  • 40
  • 64