Skip to main content

Questions tagged [endpoints]

Custom additions to permalinks for any kind of type (archives, posts, root).

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

REST API Plugin Update call back not updating the plugin

I am working on a custom CRM which includes keeping an eye on my clients WordPress sites so I have created some custom REST API endpoints to collect different types of data like the installed plugins &...
Eoin H's user avatar
  • 131
0 votes
0 answers
190 views

How do i set up ajax nonce

Follow the doc, I tried to set up X-WP-NONCE before ajax sent data to custom route, but it show wpApiSettings.nonce not defined. If don't set beforeSend, on the back end still can pass the nonce ...
Basco's user avatar
  • 1
0 votes
0 answers
54 views

WooCommerce Order Sync via Custom REST API Endpoint Failing

I have a WooCommerce website with a specialized plugin that syncs orders to a delivery company. This plugin adds a button next to each order in the orders table, which, when clicked, triggers a sync. ...
TheSwiss's user avatar
0 votes
1 answer
20 views

How do I add multiple custom menu Woo-commerce my account page?

How do I add multiple custom menu Woo-commerce my account page? this code works but how do i show content for each my custom menus? function pa_custom_endpoint() { foreach(pa_custom_endpoint_keys()...
Behzad's user avatar
  • 1
0 votes
1 answer
69 views

Custom EndPoint not working when strip child category in URL

I have created a custom endpoint for Download page with Permalink setting: /%category%/%postname%/ The URL as below: domain.com/top-category/child-category/post-slug/download function themes_download(...
Vietrick's user avatar
0 votes
1 answer
485 views

Delete row from table using custom endpoint via API

I would like to delete a row from a table in the database using a custom endpoint via the API. Using an example in the WordPress REST API Handbook, I put together the following code and placed it in ...
John Keidel's user avatar
0 votes
1 answer
519 views

Filter out posts based on a certain post_meta on the WordPress REST API

So I'm going to explain this the best way possible, and see if someone might be able to help me out. Website 1 (Posts located here): Let's say that our WordPress REST API endpoint is: https://example-...
Tripp's user avatar
  • 13
0 votes
1 answer
967 views

Can't retrieve body params from PUT endpoint using formdata

I have one endpoint to create players, which is a PUT request to a certain route. While I was sending parameters via JSON, it was working fine, but now I need to upload a picture with data, so I ...
Bruno Polo's user avatar
1 vote
1 answer
203 views

Exclude posts w/ specific post_meta on Rest API endpoint

So WordPress offers the default Rest API endpoint, which is: https://example.com/wp-json/wp/v2/posts which pulls in all the posts. Is there a way to configure and modify the existing /wp/v2/posts ...
Sema's user avatar
  • 11
1 vote
0 answers
212 views

WP Remote Request not returning all of content via request

EDIT: I think I discovered the issue, the endpoint is truncating the content response, does anyone know how to send over all of the data without it being truncated? So I stumbled across some ...
Test2's user avatar
  • 21
1 vote
0 answers
327 views

Custom WP rest api endpoint only working on non https?

I'm googling like an hour for a possible solution while im trying to create my first custom wordpress rest api endpoint. If i call the endpoint by postman it just works, but if i try with jquery, it ...
mademyday's user avatar
0 votes
0 answers
754 views

Rest API Paginate until all posts are imported

So I wanted to see if someone might be able to help me with this, so below I will explain what I've done: I am using wp_remote_get to grab the posts from another website with the arguments page and ...
Test2's user avatar
  • 21
0 votes
1 answer
371 views

Custom endpoint filtering post by custom taxonomies

I am trying to create a custom endpoint by custom taxonomies, I have already created another for the categories and it works well, however there is something I cannot solve with this function ...
Jorge Amaya's user avatar
0 votes
1 answer
527 views

Is it possible to create dynamic endpoint URLs?

I want to create an archive endpoint page that will have a dynamic slug, based on the taxonomy term slug. e.g. If the taxonomy is Food and the current term is Onion, I want the endpoint slug to look ...
Edegist's user avatar
  • 133
1 vote
1 answer
485 views

Add Rewrite Endpoint to CPT Archive

I have a Custom Post Type with a hierarchical taxonomy archive and want to add an endpoint page called "infopage" to each term in the archive. e.g. domain.com/tax-term-1/infopage or domain....
Edegist's user avatar
  • 133
1 vote
1 answer
313 views

Create multiple rewrite endpoints for custom taxonomy archive

I am trying to create custom end point for the custom taxonomy - 'species' I am trying to use urls like https://example.com/dogs/shop/ https://example.com/cats/shop/ https://example.com/dogs/services/...
user7459842's user avatar
0 votes
1 answer
547 views

REST public POST giving 403 forbidden nginx

I have created public rest endpoint with POST method and when I try ajax or use insomnia always response with 403 forbidden nginx. Why isn't this working and how could I resolve my problem? Route: ...
Patryk Chowratowicz 'Zszywacz''s user avatar
0 votes
1 answer
3k views

How to send multipart form data to WordPress endpoint

I built custom React/Gatsby multipart form with file upload and I want to send all form data to WordPress endpoint, upload files to specific folder and display all of the data in the WordPress backend....
Frostbourn's user avatar
0 votes
1 answer
395 views

Custom Endpoint For Specific Custom Post Type

I register a new post type register_post_type('movie', array( 'labels' => array( 'name' => __('Movies'), 'singular_name' => __('Movie'), ...
Abhijit's user avatar
1 vote
1 answer
3k views

How to force Authentication on REST API for Password protected page using custom table and fetch() without Plugin

I am implementing the REST API with fetch() promises as requests on a Password protected page with a custom table without using a plugin (only using the WP REST API that has been merged into WordPress ...
Jürgen Fink's user avatar
0 votes
1 answer
2k views

howTo let wordpress endpoint return html-page

i want let WordPress endpoint return a HTML-page. my plugin actually returns Howdy!! if i read web-browser at http://localhost/wordpress/wp-json/a0plugin/v1/testing i want get a HTML-page instead. my ...
SL5net's user avatar
  • 105
0 votes
2 answers
2k views

JSON - Create rest api endpoint for Advanced Custom Fields

I using plugin advanced custom fields to show recommended posts in my sidebar (posts that authors select as recommended using radio buttons (yes or no)). And it is all working well. Now, i will need ...
Dragnet Pro's user avatar
0 votes
1 answer
244 views

php code for outputting a custom page in my account

I am trying to figure this out for weeks now. I added some custom endpoints to my woocommerce my-account page. All but one are linked with a shortcode and work fine. One should link to a normal ...
PascaleK's user avatar
3 votes
1 answer
826 views

how to create endpoint for downloading pdf files?

I would like the logged-in user to be able to download the PDF file, but not to see the real path to the file. Additionally, in this PDF file, I enter information about the user name and date of ...
patryk siuta's user avatar
6 votes
1 answer
3k views

Custom endpoint that returns an xml

I need to create an endpoint that when called returns an XML with the products of the store. I have the XML generated, but I don't know how to make the endpoint return it in XML format, because now it ...
pmj's user avatar
  • 63
2 votes
1 answer
253 views

Continue execution after WP REST API response

I am trying to extend the Wordpress REST API with an endpoint that takes Zoom webhooks. Zoom requires a response within 3 seconds or will blacklist your endpoint address, but the processing that I ...
Ari Cooper-Davis's user avatar
0 votes
0 answers
71 views

How to add field to custom post type endpoint

I have an endpoint in this address: example.com/wp-json/wp/v2/myendpoint I want to add a field to the endpoint with these codes: add_action( 'rest_api_init', 'create_api_posts_meta_field' ); ...
Sadegh's user avatar
  • 177
1 vote
1 answer
1k views

Custom Rest API POST endpoint with conditionally required parameters

I've spent the last 6 hours trying to figure this out, I'm likely being dumb. I'm trying to create a POST endpoint that has parameters that are required based on the value of another parameter. ...
Toby Osborne's user avatar
0 votes
1 answer
1k views

Do I need to create an endpoint?

Turns out I'm trying to integrate witei's CRM into a website. According to the witei documentation, I must indicate a url (webhook), where I want to receive the information of the properties that has ...
myhappycoding's user avatar
0 votes
0 answers
552 views

What's the right way to validate JSON data coming from an AJAX POST request?

I'm building a little plugin with a send button: when clicked, the button calls (from the admin area) a rest api endpoint, passing JSON data through AJAX. Everything works very well and the callback ...
Life after Guest's user avatar
0 votes
1 answer
602 views

Get UserInfo from Wordpress

I am building a website and trying to pull the data from Wordpress using the WP rest api. On wordpress, the WooCommerce plugin has been added so the user contain more info and I have added additional ...
Seb's user avatar
  • 109
0 votes
0 answers
38 views

WordPress - replicate same globals, query vars and query for an alternate endpoint

We are building a hybrid mobile app for a website. The app will display a minimal version of the webpage, for example if the website displays post title, post content, sidebar, widgets, etc, then the ...
Siddharth Thevaril's user avatar
0 votes
1 answer
682 views

custom endpoints on Custom Post Type return 404 page not found

I am trying to add custom end point url to custom post type posts. After much searching I have added the add_rewrite_endpoints to functions.php function psf_game_endpoints() { ...
Destiny2Gamer's user avatar
3 votes
0 answers
359 views

How to force JWT auth for default GET endpoints of Wordpress rest api?

The default GET endpoints (for e.g. http://scintec.net/wp-json/wp/v2/posts/) of the Wordpress Rest api are public and can be accessed by anyone. I am currently interacting with a Wordpress Rest api ...
Navjot Singh's user avatar
1 vote
0 answers
1k views

Wordpress Rest API custom endpoint for RSS feed

I know how to register custom endpoints for Wordpress REST API and actually use it to output podcasts from my website like this: register_rest_route( 'myradio/v1', '/podcasts/(?P<id>\d+)', ...
geraldo's user avatar
  • 145
0 votes
1 answer
229 views

Multiple URL rewrite rules and get every prams

I am creating a messaging system where I have 4 sections (1)inbox (2)sent (3)draft (4)unread so I decide to go with WordPress add rewrite rules I have already added one rewrite rule section. ...
Bhautik's user avatar
  • 207
0 votes
1 answer
682 views

Custom account page that accepts a query parameter

I am trying to add a new account submenu page that takes a query parameter. I have the following which works: add_action('init', function() { add_rewrite_endpoint('scheduled-order-create', ...
chrispytoes's user avatar
1 vote
0 answers
207 views

Custom endpoint to get all custom taxonomy terms

I'm trying to build a custom endpoint to get all terms from custom taxonomy the taxonomy name is cats I'm using this code function wl_cats() { $args = [ 'numberposts' => ...
BabyDriver's user avatar
1 vote
1 answer
38 views

Where to add one custom end point and its function?

I just need to register one custom end point and its function (simple code). Where should I add the code in the sources files of WP?
Darius Mann's user avatar
1 vote
0 answers
375 views

Using WP-API and SSE not authenticating user ID

I am using the wp-api to create a custom endpoint for my data: add_action( 'rest_api_init', function() { register_rest_route( 'mb/v1', '/sse/', array( 'methods' => 'get', ...
markb's user avatar
  • 299
2 votes
0 answers
246 views

How to handle Gutenberg wp.data async errors?

When using wp.data.select('core').getEntityRecords(...), there is a special selector for loading states wp.data.select('core/data').isResolving(...). But what about actual errors -- backend validation ...
Capi Etheriel's user avatar
0 votes
1 answer
1k 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 ...
Sean's user avatar
  • 647
1 vote
1 answer
3k 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 ...
Sean's user avatar
  • 647
1 vote
1 answer
31 views

Is there anyway to format my EndPoint URL in WordPress?

I have wrote an endpoint in WordPress and it works just fine. The problem is with the URL. The current format of the URL request must be like this: https://iotkidsiq.com/wp-json/zaindob/v1/sync_order/...
Ahmed Dawood Salman's user avatar
0 votes
1 answer
1k views

Implementing a URL Shortener

I want to create a URL shortener where I use a REST API endpoint request to get a shortened url, e.g.: mywebsite.com/wp-json/wl/v1/shorten?url=url-to-shorten.com Where I get a response with a ...
Condor's user avatar
  • 101
1 vote
1 answer
317 views

WooCommerce Endpoints content

I have a custom plugin that is integrated with woocommerce. I want to display listing records in the user's profile and have successfully done so. Creating the end points. refreshing the permalinks. ...
Debbie Kurth's user avatar
0 votes
2 answers
2k views

Is this a correct usage of ob_start() in my WordPress project?

I have extended WooCommerce to create a custom endpoint. This endpoint, points to a template that has a form to save user meta data. When the form is submitted I want it to redirect to another URL. ...
NickC's user avatar
  • 33
0 votes
0 answers
864 views

How can I secure my custom rest api endpoint or add under a already existing rest group

Creating a custom REST Endpoint I search a way to secure the route with JWT or integrate my endpoint under Woocommerce rest routes which already has an authentication logic. The perfect solution for ...
fefe's user avatar
  • 874
0 votes
2 answers
2k views

Need to forward Data from WooCommerce Webhook sent to same site Wordpress REST API custom endpoint

I created a Wordpress REST API custom endpoint to be used as a Webhook URL in WooCommerce in order to convert the received data and then send it to a third party system, but the endpoint apparently is ...
Adalberto Hernandez Vega's user avatar
1 vote
1 answer
2k views

Creating an endpoint in wordpress

I'm writing a plugin that will allow some of my installs to talk to each other and share specific information. I wish to specify an endpoint such that example.com/path/here is where the other site can ...
Matthew Brown aka Lord Matt's user avatar