Questions tagged [wp-api]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
18 views

Trying to create and update wordpress from python library

The Background: I am a software developer that is trying to create a sports analytics website. I used to created wordpress-based sites on the side so I have a WHM where I can host sites. I'd prefer ...
AdamCodes716's user avatar
0 votes
1 answer
25 views

How to submit a button automatically after every scheduled hours?

How to submit a button automatically after every scheduled hours ? I tried some JavaScript but all failed. What I am doing? I am trying to fetch product categories from an external API Why I want ...
Ricky's user avatar
  • 53
0 votes
1 answer
87 views

Adding Microsoft Teams Incoming Webhook to WordPress, Problem with Rest Route?

I am trying to implement an incoming webhook on my WordPress website to send a message to MS Teams when I receive a form submission. The message includes an ActionCard with a multiple choice input ...
Aristocles's user avatar
0 votes
0 answers
89 views

Woocommerce API for calling products by Category ID

I belong to a Non Technical background. I have recently built an app from freelancers, Now I am looking to call the products from woocommerce by using category id. Can someone suggest how can I do it? ...
Bhaskar Mishra's user avatar
0 votes
0 answers
134 views

wordpress rest api authentication failed

I wanted to upload an canvas element as image to wordpress with rest api, i found following error, "rest_cannot_create" data : {status: 401} message : "Sorry, you are not allowed to ...
Safayet hossain's user avatar
0 votes
1 answer
501 views

Custom post type REST api 404: Updating failed. No route was found matching the URL and request method

I have registered a new post type as: $this->sconfig= ['post_type'=> 'event', 'slug'=>'events']; add_action('init', array($this, 'register_event_posttype')); and function ...
sariDon's user avatar
  • 255
0 votes
2 answers
392 views

External api call using wordpress

I want to start a new website and chose wordpress as my cmd, but im having a restriction. The website is all about api request to other websites and i triedto get an api to test it as an example. ...
Taofeeq Tajudeen 's user avatar
-1 votes
1 answer
48 views

How can I create a custom plugin to call webapi after user registration?

I want to ask how can i call my webapi after any user is registered in users table then my api is call and data is same data is send on that api
Divya Choudhary's user avatar
0 votes
0 answers
36 views

API request forbidden when requesting from same domain

I have a custom API endpoint that is rejecting calls being made from the same domain. EG: I can request .../wp-json/darts/v1/venues from Postman (or CURL) and get a 200 response and the expected list ...
rob_was_taken's user avatar
0 votes
0 answers
35 views

get_post_thumbnail_id() not getting correct featured image after post edited

Hy, everything works fine until I change featured image by editing post, using wp_get_attachment_image_src(get_post_thumbnail_id($post->ID),"full") I get the url to the original picture, ...
Josip Bogdan's user avatar
0 votes
0 answers
18 views

How to update WordPress Plugins in your own maintance application?

I have an inhouse application for managing clients and their websites. Now the idea is to add maintenance for the WordPress websites inside of the application but I can't seem to figure out how to ...
Raccoon's user avatar
0 votes
1 answer
36 views

How can I use React packages with the clasic editor?

I'm trying to add some extra functionality when editing a post using the classic editor, so that when the user clicks the Update button to save the post, I want to show a React component that will ...
andrux's user avatar
  • 111
0 votes
0 answers
322 views

Cant create or update meta fields using WordPress REST API

I have wp theme with custom fields in posts with following meta keys in photo, can't create post with custom fields values using rest-api (I'm able to create posts with no problem but cant edit or add ...
Rafal's user avatar
  • 1
1 vote
0 answers
163 views

update_callback is not working in register_rest_field

I am registering a new field in my custom post type using register_rest_field. But I am unable to add/update the field using the rest API of post add/edit. However, the get_callback function is ...
Rajib Dey's user avatar
0 votes
1 answer
57 views

Get single item from cURL plugin API call inside bash [closed]

I'm trying to get only the last_updated date from a plugin through an API call in a bash script. I'm trying to use cURL but that's giving me some issues. On the browser I can get to to plugin like ...
ecotechie's user avatar
0 votes
1 answer
277 views

Getting featured image with PHP and not javascript from wordpress api _embed [closed]

Not having access to the functions file, I can't add the function to add the featured image to the API so I need to use wp-json/wp/v2/posts?_embed. With javascript I believe it is ._embedded['wp:...
user8463989's user avatar
1 vote
1 answer
245 views

Display post title from WordPress excluding a string via API

Imagine you have custom post types - Users. There are fields for each user as the post title, description, image, and rules. All titles are names of the Users and all they have Mr. before the names. ...
Ilianskia's user avatar
0 votes
2 answers
1k views

Wordpress REST API - get custom taxonomy category posts

I want to use Wordpress REST API to get the posts that are inside a custom taxonomy created by the theme. The taxonomy is called "my_portfolio" but if I use this I have this response: {&...
liz14's user avatar
  • 101
0 votes
0 answers
159 views

Allow REST API Endpoint to specific user and hide from public

So I've been working on trying to figure this out, but I can't seem to get the right answer or even find docs online regarding this issue, so I'm reaching out to the community to see if I can get some ...
Test2's user avatar
  • 1
1 vote
0 answers
25 views

Create a custom post with custom post-metadata with WP API

I'm using WP API to insert a custom post in Wordpress. The custom post is "property". What I now need to do is assign that post a "metadata" (DB table "wp_postmeta") At ...
Mr.Web's user avatar
  • 111
0 votes
0 answers
39 views

How can I create new CustomPostType record using wp.api.collections?

I would be very grateful for your help. Already racked my brain for today! So, I used the CPT UI plugin and created my custom post type with it. Immediately when setting it up, I enabled RestAPI ...
Vit's user avatar
  • 1
1 vote
0 answers
208 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 ...
Trushar Gavit's user avatar
0 votes
1 answer
628 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', ...
Johan's user avatar
  • 309
0 votes
0 answers
27 views

Check if user can in javascript

Using the rest API I retrieve a collection of posts: const recordsParams = {} const recordsCollection = new wp.api.collections.MyPostType(); recordsCollection.fetch( { data: recordsParams } ) ....
Laurent's user avatar
  • 214
1 vote
1 answer
458 views

wp-api Backbone JS Client fetch options

I’m making a webapp based on wordpress in which I’m using the REST API for my users to get and create posts. I found the very useful REST API backbone javascript client which seems great. However the ...
PaddleStroke's user avatar
0 votes
1 answer
588 views

How to create WordPress custom end point with multiple parameters?

I want to get all WooCommerce orders from given date range. I can retrieve all orders at once. But I am confusing with passing the date range via API URL. Can anybody help me with this? I know it's ...
user2584538's user avatar
0 votes
1 answer
122 views

Is there a way to download only the Rest API part of WordPress?

Is there a way of downloading only the Rest API part of WordPress and not all the old PHP files?
Ayo Reis's user avatar
  • 111
0 votes
1 answer
341 views

Custom Endpoint API based on attribute gutenberg block

I need to return all posts that have the value of a specific attribute that is saved in the custom block attributes gutenberg. This value in the query will be according to the endpoint below. http://...
Renan Bessa's user avatar
2 votes
0 answers
786 views

is_user_logged_in not working from WP-API (wp-json)

I want to hide certain posts from visitors that are not logged in. The code below works perfectly when the visitor visit the page but not is I try to see all the pages from the API with wp-json/wp/v2/...
Gibon Webb Uppsala's user avatar
0 votes
1 answer
339 views

How to see posts in taxonomy endpoint

I am looking at a custom taxonomy endpoint and there are custom post types for this taxonomy but they don't show in the endpoint. Is there something I need to add to this endpoint or something to the ...
user8463989's user avatar
0 votes
1 answer
150 views

Get a complete list of all categories using node-wpapi

I'm trying to get a complete list of all categories using node-wpapi. But I can not do that. I use wp.categories(), but it only returns a response containing up to 10 categories. Actually, there are ...
Pierogi's user avatar
  • 131
2 votes
2 answers
637 views

Keep getting 401 error from WordPress on AWS Lightsail

I'm trying to post to a WordPress server on an AWS Lightsail instance using node-wpapi. However, the server returns a 401 error. I already have a .htaccess file with RewriteRule .* - [E=REMOTE_USER:%{...
Pierogi's user avatar
  • 131
1 vote
1 answer
223 views

is it possible to filter a rest api endpoint by using a registered rest field?

I added a rest field into a custom post type endpoint as following: function artists_per_building() { register_rest_field( 'building', 'artists', array( 'get_callback' => '...
Daniel Jonguitud's user avatar
0 votes
0 answers
228 views

do_action in API call

I have a woocommerce plugin and it provides an API url ?wc-api=myplugin. The plugin adds a new email also. function add_newstatus_woocommerce_email( $email_classes ) { require( 'emails/class-...
rrd's user avatar
  • 101
0 votes
1 answer
916 views

why woocommerce api only do not upload images from local computer? [closed]

I want to upload images on my computer to a wordpress website, however the woocommerce api is only working well with everything except images on my computer. Here is the code I am using when it works ...
tiago calado's user avatar
0 votes
0 answers
207 views

upload image to wp-api

I am using a localhost external website, that isn't wordpress related, and I want to upload an image to wordpress, possibly needs to be with wordpress api, however I would like to know how to connect ...
tiago calado's user avatar
0 votes
2 answers
1k views

How to upload image to wordpress from external page

I have a webpage on localhost that do not have wordpress environment, I had use woocommerce api to create the product, however woocommerce api doesnt seem to upload the image. I want to create the ...
tiago calado's user avatar
0 votes
0 answers
134 views

wp_update_user very slow

I am changing a user role with a custom endpoint. If the ID is incorrect, it fails right away and I get my error message. If it is successful however, the role is updated in the backend right away but ...
user8463989's user avatar
1 vote
1 answer
860 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' => [ '...
Duryab's user avatar
  • 11
0 votes
0 answers
166 views

WP-API call function

I'm sorry, I speak a little English. My website API: https://examplee.tld/wp-json If visit my API please run my own plugin: https://examplee.tld/wp-content/plugins/myplugin/myplugin.php <?php /** ...
jozs2021's user avatar
1 vote
1 answer
1k views

React post to WordPress custom post type

I am not sure if this is the right way to do it but I have a react site using WordPress API as the backend. I want to store my contact form entries in WordPress so I created a custom post type ...
user8463989's user avatar
1 vote
0 answers
37 views

WordPress API for search

I have a search form for users on my website. I have a custom field called 'location' which is a country dropdown. If I type in a user's name and select a country from the dropdown I see this in the ...
user8463989's user avatar
1 vote
0 answers
129 views

Use the backbone.js client to save custom post type meta

So I have this small piece of code that renders an array of IDs: const selected = this.$data.list.selected; function get_ids(input, field) { const output = []; for (let i=0; i < input....
Tripp's user avatar
  • 13
0 votes
1 answer
74 views

Are there events pub/sub for external application to subscribe to file/pdf uploads by wordpress admin

I have a scenario where a wp admin wants an external application to listen and detect when a pdf has been uploaded to a directory within wordpress. Ex: a new terms and condition (T&C) document is ...
rlcrews's user avatar
  • 103
0 votes
0 answers
224 views

Escape commas in REST API

Sending metadata through the REST API like this, is creating multiple entries because of the commas meta: { plugin_rule_what: 'discount_percentage', plugin_rule_applies_multiple_options:'product_22119,...
Stefan S's user avatar
  • 101
5 votes
1 answer
263 views

Are there server performance benefits to fetching only specific fields when querying the REST API?

I understand that having less data being downloaded improves the experience to the end user, but my question is related to the actual server performance, would the response be faster? I am fetching ...
AndreVitorio's user avatar
0 votes
1 answer
70 views

How can I spin up a new website for a registered user automatically?

We have created a bunch of custom plugins at our agency, and the whole packaged website is like a 'product' at hand. Is there a way to scale this in a way that we can give out a free trial, where when ...
thedamntrips's user avatar
0 votes
1 answer
834 views

register/login api

I have been looking all over google and all I can find is fairly old plugins that appear outdated in assisting with an API registration/login. Basically, I have a mobile app that needs to get data ...
Waterfall's user avatar
  • 105
1 vote
0 answers
1k views

WordPress REST API in Integromat: How to overcome “Sorry, you are not allowed to list users / edit this…”

I am attempting to connect Integromat to my WordPress install. I have successfully enabled visibility of custom post types in Integromat by registering my custom post types with show_in_rest. (And, ...
Robert Andrews's user avatar
0 votes
0 answers
751 views

CallBack URL for payment gateway redirecting to homepage instead of executing callback function

I am working on a payment plugin for Woocommerce which requires that I set the URL to redirect after payment. I set this as home_url('/?').'wc-api=WC_Payment_Gateway'. The payment gateway appends ...
Adewuyi Dare's user avatar

1
2 3 4 5