We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [rest-api]

Questions about the core RESTful HTTP API for accessing WP content and data.

Filter by
Sorted by
Tagged with
0
votes
0answers
10 views

Plugin Data not stored in Database

I am using a Wordpress plugin called ****Easy Accordion****. The problem is plugin data is not stored in the database. How can i do that? Pls, help me to get out of this. Thank you
0
votes
1answer
17 views

Extract XML/JSON element from Zillow API response and populate into Gravity Forms field

Given this stack: WordPress 5.3 GravityForms 2.4.15.6 (paid: common, right?) Forms: 3rd-Party Integration (free: Link to WordPress plugin page) Forms: 3rd-Party Inject Results (free: Link to ...
0
votes
1answer
9 views

WC_Customer delete function returns error

Here is my code: function woo_delete_customer(){ $customer = new WC_Customer(get_current_user_id()); $val = $customer -> delete(); if($val){ $customer -> save(); $data = ...
0
votes
0answers
36 views

save_post hook error with REST API

I'm trying to auto generate the post title and slug for a custom post type upon post creation. It's sort of a log book, the users will only write in the main content field. The title and slug both ...
0
votes
0answers
23 views

Connecting Wordpress with an External API

I need insight into connecting a Wordpress with an external API. This is the expected action needed to be carried out. A user tries to search on the Wordpress with four different forms fields (...
1
vote
0answers
29 views

Woocommerce custom endpoints

Currently, I'm an android developer(Java) and trying to add some custom endpoints to my Woocommerce site. I've wasted so much time to understand concepts of WP, but still can't get clear answer. So ...
0
votes
1answer
24 views

Update block once an API request returns with a value

I've got a block that allows the user to enter a script when in edit mode, then sends this script to a REST endpoint which returns a WP_Post representing a media file which is then displayed to the ...
0
votes
1answer
45 views

Get post from custom REST endpoint in Gutenberg

I'd like to get a post object from a custom REST endpoint within a Gutenberg block. The REST endpoint returns as part of its JSON payload an array with a "post" key which contains the contents of the ...
0
votes
0answers
51 views

Wordpress forbidden 403 on delete in production vs local environment

i build a system that allow the user to delete post by ID with wordpress API. this system works fine on localhost, but after i uploaded the site to production i can't delete the post all i get is an ...
0
votes
0answers
45 views

Get featured image and additional posts thumbnail Wordpress REST API

I want to use the REST API of wordpress to build a new version of a custom theme. I'm able to get the json response of a particular category, but I need to find a way to obtain also the featured image ...
0
votes
0answers
20 views

How much PHP and MySQL or MariaDB knowledge should I know to start writing WordPress themes and plug-ins and whatever else a beginner can edit?

I'm not a novice web developer. I know how to use Python and Django at a beginner to intermediate level. I know my basic HTML5, CSS, and JS. I've been learning React.js through Scrimba.com as well as ...
-1
votes
0answers
13 views

Using a custom REST API in WooCommerce, the data from do_actions in content-product.php do not generate any output. Why?

I have WooCommerce v3.5.6 installed, and the code works as expected. But, if updated to any subsequent versions, all these do_action statements have no output over the REST API. do_action( '...
0
votes
0answers
14 views

API POST to Quickbooks with OAuth

I have created a form on my website for the customer to fill, and I would like to use this data to create a customer in Quickbooks, I have the javascript API code functioning in vs code with node.js, ...
0
votes
0answers
7 views

rest api add post meta

I want to show tow post meta in one rendered field rest api my fields are 1- folder_path 2- file_name call example website/folderpath/filename.ext i want to show it everywhere in rest api ...
0
votes
0answers
8 views

Adding get_results to wp rest api

I got custom function where I retrieve guid's attached to each post. Now I want to add this on WordPress API. global $wpdb; $post_id= $object['id']; $sql = "SELECT post_content FROM wp_posts WHERE ...
0
votes
0answers
12 views

Filter terms not working properly in rest API

I'm using rest-api plugin to fetch flight details from wordpress. I had registered a custom taxonomy called 'searchflight' with terms corresponding to country,city and flight. My problem is that when ...
0
votes
0answers
19 views

How to set the post permalink using the WordPress REST API?

When fetching the posts, I can access the link property which represents the full post link. But when creating a post, what is the way to set that permalink value? Setting the slug does not seem to ...
0
votes
0answers
21 views

How achive serving multiple concurrent Ajax / Rest calls in plugin?

I am developing a plugin that does at some point gather a bunch of data from a bunch of other servers. So for each of these servers, there will be one ajax call in the frontend that expects xhr ...
0
votes
0answers
8 views

Batch creating Product and variations

We have a multisite where the main site contains "all" products. Each sub-site is its own store with its own products. Products in the sub sites are created using a React application where users log ...
0
votes
0answers
14 views

WP Rest API, reset pagination when fetching posts from a new category

I am using ajax and the Wp Rest API to fetch posts from different categories. When I click on a category link, the posts from that category are loaded into the page. What pagination options do I have ...
0
votes
0answers
24 views

WC REST API Error Handling

I am using the WooCommerce Rest API to query the products on a WooCommerce store. The Product ID ($id) is retrieved from the order line items. Some of the old orders in my database have products that ...
0
votes
0answers
71 views

WP Rest API not working

WP 5.2.4 /wp-json/wp/v2/ Gives 404 error. I updated permalinks,have a working .htaccess on Apache and not using "plain permalinks" and still this thing don't work. My Apache and its configuration ...
0
votes
1answer
21 views

rest Api jwt authentication for get methodes

I'm developing an API for my Wordpress website, I want to authorize all API request using jwt token. already installed and configured this plugin "JWT Authentication for WP REST API".But when I try ...
0
votes
0answers
28 views

CRUD from WordPress to Business Central 365 through OData REST API

The goal here is to use WordPress as a front-end to create, read, update and delete data which is being pulled from Microsoft Dynamics 365 Business Central through OData Webservices in a JSON format. ...
0
votes
0answers
12 views

All permission check methods are called on request

Requesting the create_item() method in my custom rest-controller::WP_REST_CONTROLLER all registered and implementd permission-callbacks are called. Echo the name of the permission-callback in the ...
1
vote
0answers
28 views

Register REST route with a multi-value parameter

I want the UID parameter of this REST route I'm registering to accept both a single value or multiple values (let's say a comma-separated list, like "800,300,100"). Is there some standard way to do ...
0
votes
0answers
19 views

Wordpress REST API only gets data from primary site

I'm currently trying to display custom posts on one of my multisites, but even though the correct posts show up under wp-json/wp/v2 they dont show up on the actual site, instead it just shows the ...
2
votes
0answers
53 views

Limit REST API output to current logged in user that is also author of the content

https://developer.wordpress.org/rest-api/using-the-rest-api/frequently-asked-questions/#require-authentication-for-all-requests This requires authentication for all reque​sts. add_filter( '...
1
vote
0answers
21 views

Solve cors problem using rest api or ajax

I'm building an app with nuxt using WP as a CMS, so I have this code in my functions.php to allow any origin (temporary) using the rest api and admin-ajax urls function add_cors_http_header(){ // ...
0
votes
0answers
8 views

How to filter customer collection using Rest API v2?

Is there any way to filter customer collection by created or modified date using rest API? I have also check this document. But,there's not available any parameter for that.
0
votes
0answers
15 views

How to logout remotely from other website

My requirement is something like: Let's say I have a client side app/website. There will be logout link and on clicking Logout link, it will also remotely logout wordpress site. I believe WP has a ...
0
votes
1answer
12 views

Wordpress HTTP API NTLM Authentication

I was wondering if anyone has had to use NTLM authentication when using wp_remote_get? Trying to authenticate using Basic but that is returning the proxy error. When I use other authenticators for ...
0
votes
1answer
25 views

Upload User Avatar from android to Wordpress using Rest API

I am developing an android app that give users ability to browse , register, login, post and comment to my wordpress blog using Rest Api . I am trying now to add a way for users to update their ...
0
votes
1answer
19 views

[Zapier + WP Webhooks Pro]: Custom Fields get cut off at first comma or semicolon

I'm using Zapier and WP Webhooks Pro to connect Google Sheet and WP to auto-publish posts for each row added to the spreadsheet. It works like as expected and all fields, including custom fields, ...
0
votes
1answer
16 views

Is There A Plugin to Create WP Multisite Installs programatically

So I created a wordpress multi-site and I want to be able to create multiple sites in the network programmatically. My subscription service has an API so I can create username and passwords on the fly ...
0
votes
1answer
75 views

REST API: No route was found matching the URL and request method

I'm having issues adding a custom REST API route to Wordpress. Using my own plugin, i've registered the route as followed: add_action( 'rest_api_init', function() { register_rest_route( $namespace, ...
0
votes
0answers
9 views

Is there any method to add a Custom Comment Type to WordPress REST API?

Hellow!I am using AnsPress plugin(Forum/Question and answer plugin) with some customization.In Anspress,visitors can post replies to answers.Those replies stores in WordPress database under a comment ...
0
votes
0answers
35 views

“No Access-Control-Allow-Origin header is present” even though it is in the entry file

I'm seeing this in the Chrome browser console after doing a test fetch request: Access to fetch at 'http://localhost/wptest2/wp-json/pluginFolder/1.0/load?limit=10&offset=0' from origin '...
0
votes
0answers
17 views

Wordpress API returns empty page when page is less than X-WP-TotalPages

I am querying in the Wordpress API for all pages of media attachments. I am going page by page. I have about 5800 pages and when I hit pages 50-53 they return a blank or more of a [] but it is a ...
0
votes
0answers
14 views

Advanced analytics tools for WooCommerce?

Premise This question might seem out of topic but in my opinion it's strictly related to the whole Wordpress / WooCommerce ecosystem and its performance optimization. Problem The issue is about ...
0
votes
0answers
27 views

do_action doesn't trigger if it's in a template that gets loaded via REST endpoint

i'm building a single page application using woocommerce and custom REST endpoints to get template parts and load them into the browser ... one endpoint is getting content-single-product.php template ...
0
votes
0answers
13 views

Woocommerce Product don't return custom taxosonomy when using REST api

I created a custom taxonomy for woocommerece product. It's working fine in wordpress. but when I try to fetch it through REST (Javascript), it's missing. All other properties are returning but not ...
0
votes
0answers
20 views

Help when displaying a link in the Woocommerce order table

I am developing a module for woocommerce that consumes an API, in the back it shows the link correctly of each order that is made, but my problem is when I want to insert this link in the part that ...
1
vote
1answer
15 views

How do I get the intended post type of a revision post?

I have a headless Wordpress instance with multiple custom post types. The build takes a few minutes, so I'm building a way to display drafts by fetching the latest revision via an API, like so: $...
1
vote
0answers
21 views

Update a post based on results from GET request to another server

I need to use GET requests to retrieve the current status of a device and then update the body of a specific Wordpress post with the text data sent by the external device (for reference, it will use ...
0
votes
0answers
12 views

Wordpress improve REST API - SHORTINIT not work

i'm trying to improve the performance of Wordpress API custom endpoints. I created a plugin, simple file under plugin/PLUGIN_NAME folder where I call "register_rest_route" function to set the ...
1
vote
0answers
18 views

How to insert Comment metadata via REST API

I am trying to insert comment from my android app , i am using REST API and POST method /wp-json/wp/v2/comments/ The method is working great , but I would like to include metadata when inserting ...
0
votes
2answers
25 views

How to get all post of custom post type by rest api?

I have CPT transcript in wordpress website. And create 250 post in CPT transcript. Now, I want to fetch all transcript data and want to store in another database using rest api url http://example.com/...
0
votes
1answer
17 views

Should I worry about SQL injection when using REST API?

Should I worry about SQL injection when using REST API and sql queries via $wpdb? For example, is the bellow vulnerable to sql injection? public static function get_post( WP_REST_Request $request ) ...
0
votes
0answers
25 views

Create Session with JWT

I'm currently working on a shop like project that uses React as frontend and Wordpress with Woocommerce as a backend. To authenticate with the API I use the JWT Authentication for WP REST API, which ...