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
1
vote
1 answer

How can I create a new wordpress post from within NodeJS?

I'm trying to access my WordPress site from a NodeJS program. Specifically, I'm trying to create a draft post from within a NodeJS program. I've never done this before, and I can't get it work. I've tried a few ways of doing this. First I used WPAPI…
1
vote
0 answers

Retrieve only one attribute of embedded data WordPress API

I am fetching data from my WordPress site's API, and I need to embed the data from the 'author' field in order to retrieve author name, as by default only the author ID is returned. However, when I use the _embed global parameter to embed the data…
1
vote
1 answer

wp api React will not create ACF Fields on a POST request

I'm developing a react 17.0.2 application using wpapi 2.2.1. on the Front End. On the WordPress backend, I'm using the Advanced Custom Fields plugin 5.12.2 along with the ACF to REST plugin 3.3.3. I created some ACF fields associated with posts…
1
vote
1 answer

Node WPAPI REST with JWT Authentication combined?

I have a Wordpress REST-API Backend with a UI5 JavaScript Frontend which loads some Post-Data to list them. I want to protect this by a simple Login-Form in the Frontend. To fetch and create the posts i use Node-WPAPI with basic authencation, like…
mxkraus
  • 191
  • 1
  • 10
1
vote
0 answers

Endpoint for ACF options page field WordPress REST API?

Hope someone can help with this, I'm building out a small plugin that will allow me to bounce a single data field to an endpoint. The data is currently stored in a ACF under an ACF options page. I have been able to write a small plugin that allows…
xDE4DSH0Tx
  • 33
  • 4
1
vote
2 answers

WP_REST_Request return rest_no_route (404) for custom endpoint

I created a custom endpoint for the WordPress API-REST. I can access it normally via browser. But when I try to access it via WP_REST_Request, I get a message of "rest_no_route (404)"
1
vote
0 answers

Vue Js + vueformulate + Wp Api Rest + Gravity Forms plugin

I am learning VueJS and trying to use WP API Rest + VueJS + VueFormulate to create a form. My idea is that the user can upload a PDF file to the wordpress site. I have this Wordpress REST API> http://wptest.local/wp-json/wp/v2/media then I use Axios…
Lash Azem
  • 11
  • 1
1
vote
0 answers

Adding a wp: featured image to loop when using a headless CMS via the Wordpress API and Vue.js

Would like to know how to implement the Wordpress Featured Image to multiple vue.js/nuxt.js based headless-CMS approaches using the Wordpress restful API. Initially, I followed this immensely helpful tutorial headless-cms with nuxt and created a…
pb14
  • 11
  • 1
1
vote
1 answer

WordPress is creating nonce as a logged in user but verifying it incorrectly

I'm having trouble validating a nonce created with wp_create_nonce() inside a hidden input with the name nonce in an html form: The form submission is done…
dewd
  • 4,380
  • 3
  • 29
  • 43
1
vote
1 answer

How to wait for image to download before executing the rest of the code

I hope you are doing okay, so I have been using nodejs for a while now, and I'm still getting used to asynchronous functions and stuff, so the thing is I download an image from a server using axios, and wait for image to download and then use the…
1
vote
1 answer

rest_authentication_invalid_api_key_secret JWT wordpress

i used https://github.com/WP-API/jwt-auth for authentication I created api-key and api-secret in profile page when i call api (http://acms-srs.localhost/wp-json/wp/v2/token), showing errors { "code":…
Pirta Matharu
  • 267
  • 1
  • 5
  • 22
1
vote
1 answer

Wordpress API - how to add rest field to tags

I'm doing a headless wordpress, so using wordpress API. Using Yoast for SEO, I've added yoast SEO data to my post types API endpoints like this: function wp_api_encode_yoast($data, $post, $context) { $yoastMeta = array( …
geochanto
  • 972
  • 2
  • 13
  • 45
1
vote
0 answers

401 Unauthorized response only on new version of chrome/firefox browsers when using the WP-API Basic-Auth plugin

I have installed the plugin made by the Wordpress Team: https://github.com/WP-API/Basic-Auth I am making this request with Wordpress 4.6.14: The making a GET request to the following API…
1
vote
0 answers

Posting Comments to WordPress with WPAPI

I'm using Netlify event-triggered webhooks to call a script that's designed to post a new comment to the WordPress API. I'm trying to implement wpapi to make the POST request but not sure if I'm hooked up properly. exports.handler = async (event,…
David Gaskin
  • 548
  • 7
  • 26
1
vote
1 answer

Can I get Wordpress Plugin Data through Wordpress API?

I am looking to build a wordpress website with GatsbyJS (so no PHP usage. Just using Wordpress API and react JSX on the front-end). I know I can get any core wordpress data at /wp-json route, but I'm not sure about plugin data. I've tried to look…
geochanto
  • 972
  • 2
  • 13
  • 45