Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [wp-api]

The tag has no usage guidance.

1
vote
0answers
20 views

Extending wp JavaScript base class to make a post request to a custom REST endpoint

I've defined a REST endpoint /my-plugin/v1/post-read to show whether a post has been read or not, per-user. In PHP, my plugin keeps track of this depending on page views while logged in. I'm now ...
0
votes
1answer
45 views

Still getting “Basic Authorization Header Missing” error after updating .htaccess?

I am trying to write some Python code to access WP via WP-API. Details: WP Version is 4.9.9 I selected the Application Passwords plug-in for authentication. I'm using the AWS Bitnami install of ...
0
votes
1answer
49 views

How to use Python to create a Post in Wordpress?

I found the API reference here: https://v2.wp-api.org/reference/posts/ Based on the API reference above, I wrote this Python code: from urllib.request import Request, urlopen from datetime import ...
0
votes
1answer
22 views

Upload buddypress profile and cover photo using rest API [on hold]

How can i upload buddypress profile and cover photo using WP rest API. I have created the custom endpoint and have the image ready in base64 within the app and all the authentication and stuff in ...
0
votes
0answers
20 views

Make a plugin API accessible

I have a few plugins and I want to alter them to make each of them responsive to API calls I.e GET, POST, EDIT and DELETE data. ultimately I want to make calls from my Cordova app to communicate with ...
0
votes
0answers
15 views

Create new editable route/endpoint based on meta key

I'm currently making a store which is receiving it's data from external sources. Being new to the world of editing/creating REST API, I've come across a problem. The problem is that the external ...
0
votes
1answer
26 views

Wordpress API for custom post types returns rest_no_route

I created a custom post type and I am trying to get the posts from it using WP-API, however, when I try to access the API I get the error rest_no_route message. The set up for my custom post type is ...
0
votes
1answer
25 views

wp_insert_user if user exists

I have been at this for almost two hours, i'm sure i'm close, but can't find the nudge to make it work. I built a module from scratch to import users from a csv file, the user creation is working fine,...
0
votes
0answers
31 views

Upload Media using the WP API

I'm trying to create a plugin to allow me to upload media files to the media library using the WordPress API V2. I'm trying to use Filepond to do this but I'm facing a 401 unauthorized issue. plugin....
0
votes
1answer
72 views

Add media with WP-Rest-API v2 II

I am having this exact question, asked in 2015, about adding media through the WP REST API. My code so far: curl -s -X POST http://www.example.com/wp-json/wp/v2/media/ -H "Content-Type: ...
1
vote
0answers
35 views

Custom Post Type not showing in Rest API on Multisite

I'm using WP Multisite and can't seem to pull through my custom post types via the API. <?php function terms_post_type() { $labels = array( 'name' => _x( 'Policies', '...
0
votes
0answers
40 views

filter by Meta custom field in rest api defined by pods as realtion to categories

i installed PODS and create a new custom post type named locations and relate it to default Wordpress entity : category when i call mydomain.com/wp-json/wp/v2/locations?fields=id,category rest ...
0
votes
1answer
19 views

Core function to check if a rest namespace exists

Does WordPress have a core function that will check if a rest namespace exists? I would like to use the following function (or something similar) in multiple plugins so it would be helpful if there ...
0
votes
0answers
94 views

Custom endpoint without loading entire Wordpress

With only WooCommerce installed the Wordpress rest api loading time is above 1.5s, this is unpractical, so i'm trying to create a custom endpoint and define SHORTINIT to true to load the minimum ...
0
votes
0answers
12 views

Create Posts from API response without duplicates

I am hoping someone can help with this. I am getting content via an API call to a third party vendor that supplies articles. I need to then add these articles as posts and also make sure I don't ...
1
vote
1answer
39 views

Can I list all installed plugins/versions and wp version from API

I would like to generate a simple text report for a Wordpress instance listing: Wordpress version Plugins installed (version and whether enabled) I can get this information from the Dashboard, but ...
0
votes
0answers
38 views

WP-API Content showing null

I am working on a decoupled theme for myself and I've worked with WP-API in the past and it was easy to get the post content. For some reason this go around I am having issues getting the content. I ...
0
votes
0answers
33 views

How to delete meta-field which is registered with register_meta to Rest API

I'm working on a Wordpress integration and updating our WP JSON api v1 to v2. We have custom post types which use two custom meta-fields. One of them should be preserved to the WP's database while ...
0
votes
1answer
433 views

Woocommerce REST API not considering discounts and coupons

I am trying to create an order on my WooCommerce store from my mobile application using the REST API v2. The order is created successfully but I can't find any solution to the following issues. I ...
0
votes
0answers
31 views

Add likes from Ionic app

I'm creating an app that is connected to my Wordpress backend. I use this to allow people to like the posts and I would like to enable it in my Ionic app. I've already managed to get it from the WP ...
0
votes
1answer
61 views

Why is wp api returning old acf values?

I have a list of custom post types (Events) with ACF fields for start and end dates that I'm getting using WP-API. I'm using the fetch api to make the calls. I have the acf-to-rest-api plugin ...
0
votes
0answers
59 views

Extending the API I created to return category names

I created this api using a plugin called WP REST API Controller. But it didn't return custom taxonomy categories so I installed a plugin called WP REST API – Pure Taxonomies, it's returning category ...
1
vote
1answer
1k views

Update Line Item Meta Data - WooCommerce API

stuck trying to update line item meta fields I've attached to each line item. From a call to a particular order you an see the line item meta attached below: "line_items":[ { "id":...
2
votes
0answers
382 views

WP Rest API max limit include parameter?

I'm using the rest API to get only selected posts though Rest API. I have used include=<ids> parameter. I have send the API request like: http://example.com/wp-json/wp/v2/posts?include=11,12 ...
0
votes
1answer
67 views

WooCommerce API Returns 401

very confused by how the rest api for WooComm is functioning. I understand how it should function, but it returns a 401 no matter what I do. My user is a super admin and has read/write permissions. ...
0
votes
0answers
74 views

Consume legacy rest api dependent upon WP API plugin

Is there any way to consume rest-api of WordPress plugins which were originally dependent upon the WP-API plugin in recent versions (v4.7 or later) of WordPress? In my case, I want to use the rest-...
0
votes
1answer
51 views

Hiding WordPress REST endpoints from public viewing using Basic Authentication

I have this function which register new endpoint. By default the end point is public. I'm using Application Passwords' plugin which create a basic authentication account, let's say Basic ...
0
votes
0answers
26 views

Mail confirmation for users created via WP-API

Premise: I'm working on a project running entirely on Angular (5) for the front-end, and uses Wordpress as back-end, which will be accessed by the front-end only via REST-API. What I've done so far: ...
4
votes
2answers
1k views

WP REST API only returning partial list of users

Started working with the WP REST API for the first time. Our ultimate goal is to dynamically load UI elements based on which user is presently logged in. However, my attempts to pull a list of all ...
0
votes
0answers
144 views

How to properly set a value to meta fields of a custom post type in WP-API/node-wpapi REST API?

I have a metafields that is assigned to a custom post which I added as a REST API field: $this->post_types = array ( 'post', 'location' ); foreach( array( 'field_1', 'field_2' ) as $field ) { ...
0
votes
1answer
427 views

rest_no_route on custom API endpoint wordpress

I've been trying to figure this out for the last day or so to no avail. I'm trying to create an endpoint to gather data from a set of tables. I'm trying to write it in OOP because I need to learn. ...
1
vote
0answers
17 views

Posting page on all subdomains

I'm just asking to see if anyone has done this or any ideas how it could be done. I have 11 Wordpress sites(on a network/multisite, 1 domain and 10 subdomains) that will grow. I'm in the process of ...
1
vote
1answer
58 views

Syntax for REST API to have bold formatted and multiple lines in product description [closed]

My description in the "Edit Product" GUI visual looks like: Description Features : Feature 1 Feature 2 I use the rest API to dump out the description and it looks like this: "description":"<p&...
0
votes
1answer
480 views

Why are <link rel> tags from the header showing up on my Wordpress site? [closed]

I am testing my new WP site. I wanted to see how it worked using a text-only browser, so I fired up "links" from my shell to visit the site. At the top of the page before my navigation menu, the ...
2
votes
2answers
4k views

How to update/insert custom field(post meta) data with wordpress REST API?

I am trying to add custom post data( post meta data) through wordpress API but I am getting difficulty while updating/adding custom post data. below is the code that am using. Code written in ...
0
votes
2answers
328 views

How can I list all installed plugins/themes/versions from CLI/API?

I would like to generate a simple text report for a Wordpress instance listing: Wordpress version plugins installed (version and whether enabled) themes and child themes installed (version and ...
1
vote
0answers
444 views

WP Rest get all by post within that category, by category name not by cat ID

I'm trying to display all posts within a specific category but by slug name not by cat id, below is what I've tried. http://centreformemories.org/blog//wp-json/wp/v2/posts?filter[taxonomy]=category&...
0
votes
1answer
2k views

Get the Category Name instead of ID from WP-API

I'm trying to get the category name instead of the ID from the WP REST API for my Custom Post Type. Some articles about endpoint modification gave me some ideas on how to solve it, but unfortunately i'...
0
votes
1answer
40 views

Should I edit a user meta field with PUT, PATCH, or POST and WP::Editable

I have a simple CPT called App in the backend. I have added a custom usermeta field called favorite_apps to Users On the front end, I show a list of apps, and then the user presses a star(☆) icon to ...
0
votes
0answers
710 views

WordPress 4.9.1 and ifttt.com connection

Good day! I'm trying to connect a WordPress blog to ifttt.com, but for some reason it always gives me the same error: "Blog URL is not a valid Wordpress url". I've tried to find a solution, but no ...
2
votes
0answers
138 views

How to filter users on custom meta fields in WP JSON v2?

I am trying to filter users on meta field, say abc is user meta field and value is 123 for user1. I have tried filter parameter with WP query like parameters, but it returns all users. 'search' ...
0
votes
1answer
668 views

Add Products to Woocommerce through WP API

I am trying to create a WooCommerce extension so that I can fetch products through API and store them in my WordPress store. I have been successful in storing simple products. But i'm stuck at ...
1
vote
1answer
124 views

Add Data to Response of WP-JSON Root

The default content at /wp-json/ contains name, description, url etc. but I want to add some additional content at this root level. I see lots of ways to modify the responses of items with object ...
0
votes
0answers
189 views

store widget in object and return it in an wp rest API response

I want to use mailjet on a wordpress website in order to enable users to subscribe to a newsletter. The users should be able to insert their email address into a form, then the mailjet plugin ...
2
votes
1answer
2k views

Create post with REST API in php with file_get_contents

Actually I have no problems getting posts. I need to create posts with the REST API in php with file_get_contents. This is my code: json_decode( file_get_contents( "http://my-site.com/wp-...
0
votes
1answer
208 views

WP-API user email change confirmation

I am developing an android client for wordpress website using wp-api and jwt plugin. By default, wordpress did not send an email confirmation when the user changes his email from control panel. I was ...
1
vote
1answer
6k views

Get more than 10 posts in a specific category with the wordpress api

I'm currently building an Ionic app that uses the Wordpress api. I can retrieve posts in a specific category by using the following: // Retrieve filtered data for the categories to show posts. ...
2
votes
1answer
110 views

How do I retrieve a list of popular plugins using the WordPress.org Plugin API?

I'd like to retrieve a list of popular plugins from WordPress.org using their API. I know I can do something like this to get a specific plugin: http://api.wordpress.org/plugins/info/1.0/...
0
votes
2answers
372 views

How to edit feature image with XML RPC?

I can't find any information anywhere about what data I need to give exactly. When I try to read the data from one of my posts with a thumbnail already I get this but there's not way you have to enter ...
0
votes
2answers
239 views

ng-repeat is not returning a list of posts

I am currently trying my hand at creating a WP theme using angular JS. I am trying to work through this tutorial: https://1fix.io/blog/2014/11/05/angularjs-json-api-wp-theme/ However, I am near the ...