Questions tagged [api]

An application programming interface (API) specifies how some software components should interact with each other. In addition to accessing databases or computer hardware, such as hard disk drives or video cards, an API can be used to ease the work of programming graphical user interface components. In practice, most often an API is a library that includes specifications for routines, data structures, object classes, and variables.

Filter by
Sorted by
Tagged with
1
vote
0answers
12 views

Create a range slider to change font-size with different screens sizes in wordpress customizer api

I have been trying to create a theme customizer to change the font size. To do that I have created settings and control. But the issue is I am unable to achieve like as shown in the image. I have used ...
1
vote
0answers
18 views

How to add AJAX in a custom PHP function using Google sheets API

I have followed a website link to fetch data from a SINGLE CELL of a Google sheet to a shortcode. And I am using that shortcode into the COUNTER widget in Elementor to achieve counting animation while ...
0
votes
1answer
14 views

How do I display PHP file contents on front end of Wordpress?

I am working with a third party API for events, the results of the GET request I've written are rendered/displayed at this URL (inside the SDK folder): https://example.com/skiddle-php-sdk-master/demo/...
0
votes
0answers
29 views

How to queue API requests with PHP in WordPress?

I'm developing a plugin to manage some simple custom APIs. I'd like to handle clients requests to APIs with a queue, so as not to handle all requests in parallel but one at a time, with a FIFO logic: ...
0
votes
0answers
25 views

Get the name WordPress default theme in the core

With this link https://api.wordpress.org/core/version-check/1.7 I get the latest version of Wordpress, now I need: Get the name WordPress default theme in the core, twentytwentyone. how? I tried https:...
0
votes
0answers
27 views

How to store API authentication password?

I am connecting a WP site to a service through the service API. The API authentication of this service is done using the service account username and password, not API keys: You send a request to the ...
1
vote
1answer
31 views

How send get request to external api with username and password

Actually i want to send get request to an api. the response is in xml. I have tried this <article> <div class="entry-content"> <?php $url = "XXXXXXX&...
0
votes
0answers
12 views

Get API auth_token token to renew weekly

I have a wordpress website that connects to experience.com api to get account stats and data. everything is working fine besides the auth_token needing to be renewed every 10 days. Right now it is all ...
0
votes
0answers
23 views

Wordpress and API (rapidapi) request

I need assistance with the following problem: I would like to trigger a transaction from a wordpress page. A special, but not yet functioning page template was built for this (see next page). There ...
0
votes
1answer
34 views

How to change the date and time in REST API for comments?

/** * Add a Formatted Date to the WordPress REST API JSON Post Object * */ add_action('rest_api_init', function() { register_rest_field( array('comment'), 'formatted_date', ...
0
votes
0answers
20 views

apiFetch() returns infinite requests

In PHP I created a a simple endpoint to return an array of custom post type names: // Create array of custom post types function custom_get_post_types( $data ) { $args = array( 'public' =&...
0
votes
0answers
64 views

Sync posts via JSON API

We have a custom post type Events on our Wordpress website. Every event has a title, description and date. From our CRM-system, we can create a JSON feed where we list all Events. Every event in the ...
0
votes
0answers
25 views

Solution for processing lots of data with CRON/API, dealing with memory/timeout issues

Using a custom CRON job set up in my Wordpress site I am connecting to an external API to refresh some data. The API only allows for a certain amount of records to be read at a time so I have to "...
0
votes
0answers
71 views

Wordpress Woocommerce REST API JSON Error

I have a problem with Rest Api, I am using Automattic Woocommerce Rest Api to search categories, I am getting this error: PHP Fatal error: Uncaught Automattic\WooCommerce\HttpClient\...
0
votes
1answer
30 views

Integrating boxtal PHP library into a custom WordPress Plugin

I need to integrate this PHP library on my WordPress site. I read that you have to create a plugin or integrate it into the child theme. So I created a plugin and integrated the PHP library in the ...
0
votes
1answer
146 views

WP REST API remove the Wordpress shortcodes from the JSON wp/v2/posts content->rendered

I'm trying to get rid of the shortcodes that wordpress gives me when i use the WP REST API. I already managed to remove the HTML tags by editing the class-wp-rest-posts-controller.php by using ...
0
votes
0answers
57 views

Post content in wp_remote_post

I'm trying to post content with wp_remote_post. Content that I want to be posted is in a separate php file, which echo's block with html and WPBakery shortcode. I tried include but it didn't work, I ...
0
votes
1answer
49 views

Push Contact form 7 variable to front end after submission

I have a contact form 7 form that's sending information to an API. I want to display the API response on the front end. I record the user information, then post it using wp_remote_post, with my ...
2
votes
1answer
80 views

Programmatically trigger the gutenberg save

I have a load of data as JSON that I am trying to save into a fresh install of WordPress. I am using puppeteer to log into and create each page, and wp.blocks.createBlock to programmatically create ...
1
vote
0answers
37 views

Make parts of your wordpress website completely built with data from external APIs?

I have experience with building frontends with react.js that use external data from RESTful APIs (from a headless CMS). Now I have someone ask me if I could build a wordpress website that has several ...
1
vote
1answer
49 views

woocommerce registration form with klaviyo(don't work with current user)

I'm trying to integrate klaviyo with woocom form, this is the code I added below. The issue is when I add any hardcoded email in variable $emailUntrim = "xyzxyz@gmail.com" instead of $...
0
votes
0answers
89 views

Call external API based on user input

I want to create a WordPress website in which I want to display a search box on a page, where the user will be able to search for tracking numbers from different companies. On searching a string in ...
0
votes
0answers
29 views

WordPress API causing fatal error

I can't seem to figure out why my API call is failing when trying to filter the fields using _fields. It seems to work all but one of the fields, when I add it, it dies with "There has been a ...
0
votes
1answer
30 views

How to pass the API key to the client from the database? [closed]

I wrote this simple client in javascript that uses mapbox geocoding API. It is not necessary to hide the API key but what is the correct way of giving that js file access to the API key without ...
0
votes
0answers
17 views

WP API v2 POST adds records multiple times

Been trying to add POSTS using the WP API. Although the records get added 3-4 times. I am looping through an XML file and executing the post using CURL. I don't see a reason why posts are added 3-4 ...
1
vote
0answers
15 views

Wordpress Google Calendar Oath 404

I am trying to integrate google calendar with a wordpress plugin. As per the google api documentation I am authorizing using google oauth2. When it returns the code and scope in the url the scope part ...
0
votes
1answer
40 views

woocommerce api echo out response

throw woocommerce api I post a product to wordpress website, but then I want to retrieve the response, for now I want to print only the response. Using php if I use print_r($woocommerce->http) I ...
0
votes
0answers
59 views

Limit the number of external API calls per second

I would like to use wp_remote_post to retrieve data from an external API. The matter is that the external API only accepts a maximum of 5 requests per second. However, depending on how many users are ...
0
votes
1answer
56 views

Google credentials and redirect URI for Google OAuth2 in a WordPress plugin, questions

I'm developing a plugin that inserts contacts into a custom table of the WordPress database (name, phone number, email). It is possible to enter data in this table either manually, through a form, or ...
0
votes
1answer
23 views

WordPress Theme/Plugin Information API Response to Text and Button

When requesting to WordPress API for any plugin or theme information for the versions field https://api.wordpress.org/themes/info/1.1/?action=theme_information&request[per_page]=12&request[...
1
vote
0answers
19 views

Add menu items/actions for multisite users who are registered on the network but do not have a role or capability in any sites

We've built a custom application (Pressbooks) that sits on top of WordPress multisite and transforms the multisite into a CMS for book publishing. A frequent flow for super admins is to invite a new ...
0
votes
0answers
18 views

How To Get The Uploaded File In Functions.php and Send The Uploaded File To The API

I am uploading the image and I want to get that uploaded image in functions.php and send it to the API. This is my Image Upload Code That is Added In Page: <form action="" method="...
0
votes
1answer
66 views

Call require_once form admin page with checkbox

I'm creating a custom WP plugin. Inside my main plugin file (functions.php) I've includes the following line of code so a second file (module_2.php) with additional code will be loaded: define( '...
0
votes
0answers
49 views

custom email validation using javascript api with elementor pro and code snippets

I am not very familiar with WordPress and CSS however, my system info is mentioned below: php 8.0.7 wordpress 5.7.2 woocommerce 5.4.1 elementor pro 3.3.1 theme twenty-twentyone my email provider is ...
0
votes
0answers
32 views

Can I overwrite default WordPress Json API For no more pages text

When I call Json API, when there is no more pagination, the response text is The page number requested is larger than the number of pages available. I would like to change that text to custom text and ...
0
votes
2answers
38 views

Is there a way to call via javascript if a user is logged-in on a static html file?

I am using Wordpress/Woocommerce for my website along with jekyll (static html generator). I want to change a button based upon user logged in or logged out. \\ if user is logged in <button>Log ...
1
vote
1answer
30 views

Can Wordpress pass through a call to an external API and return the result directly to the client?

I have a wordpress site that will be replacing an old legacy site, however the old legacy site includes a SOAP API that I won't be able to re-implement in wordpress. Is it possible for the wordpress ...
0
votes
1answer
43 views

trigger WordPress rest any API call

Is there any way to hook all incoming requests for the REST API in WordPress? The reason why I want to trigger all API call...is When API was called I would like to save data depending on parameters. ...
1
vote
1answer
51 views

Display content according to current URL

I want to create most of the website structure based on the external API Manufactures -> Brands Here is how the output of API look like array(2) { [0]=> object(stdClass)#448 (6) { ...
0
votes
1answer
195 views

Validate rest-api call on create

WordPress Site A has an API, which is being used by another system/application (B). B is struggling to handle/controle/sanitize the posts being sent to the API, and often cause creation of duplicates. ...
0
votes
0answers
31 views

Secure WordPress API, how?

I'm writing a plugin that expose a custom resource via WordPress API's. Now the resource is public so anyone knows the API's endpoint can get the resource but I would to secure it, what's the best ...
1
vote
1answer
292 views

WP_REMOTE_POST Requests are being blocked by API provider [closed]

I'm trying to make some API POST requests via WordPress' own method i.e. wp_remote_post() Here is the sample code I'm using: $args = array ( 'sslverify' => false, 'headers' => [ '...
0
votes
0answers
42 views

WordPress Guternberg Content For React Native

I am creating react native mobile app first time. I use WordPress as a WordPress service. Everything is OK excerpt WordPress content from api. As you know, WordPress response Guternberg content block ...
0
votes
0answers
49 views

Wordpress API - Getting just post content

I am trying to get the content from a wordpress page into a file. Is there a way to do this with the API? When I try to use the API, it returns all the content in html instead of text, and I just want ...
0
votes
0answers
168 views

Business SDK Features for Conversions API in WordPress website

I am trying to integrate CAPI or Conversion API within my WordPress site in custom mode via PHP and to do so I am following the following guide: https://developers.facebook.com/docs/marketing-api/...
1
vote
0answers
13 views

Amending REST API function without deactivate/activate plugin every time changes is made

I am working on WordPress development where I have to create a custom REST API in a custom plugin. But every time I am amending the the REST API functions, I have to deactivate and activate the plugin ...
0
votes
0answers
24 views

permissions checking in ajax

My php function which is called with ajax should check if the user which called the function is administrator. So, is_admin() always returns true because it is a admin page. I just thought about ...
0
votes
0answers
14 views

Portfolio items created indefinitely from external API. Every time different number

I am trying to make new portfolio item for every json item from external api. I am working on Wordpress and placed my code in functions.php of the theme used. When i run my code, it creates portfolio ...
1
vote
0answers
32 views

What would be the best way to implement Magic Link logins in WordPress?

On the internet I saw several plugins/services offering a kind of a 'magic login' link functionality. This allows users to sign in without a password but with a magic link. That made me wondering: If ...
0
votes
0answers
73 views

Use the GET method to get the user id from External API and show all user fields

I'm trying to use the wp_remote_get function to make a call to external api, below the process. The frontend user clicks on the edit profile item. wp_remote_get makes a call which returns the id of ...

1
2 3 4 5
15