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 [endpoints]

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

1
vote
2answers
1k views

WooCommerce: Can't use wc_get_products for custom REST API endpoints

I'm trying to create some custom REST API endpoints which get products with some special conditions, for example one endpoint for featured products. I tried to use the wc_get_products function like ...
0
votes
2answers
345 views

How to use endpoint, but remove/rewrite endpoint base?

I've been messing around with rewrites and query_var to generate some listings, for example: ~/my-page/?my_var=1 ~/my-page/?my_var=2 ~/my-page/?my_var=3 After perusing StackExchange and the ...
1
vote
1answer
121 views

Enpoint Not Found in Rewrite Tag Permalink

I'm trying to make an XML feed show nice and pretty permalinks rather than showing query strings. The problem is I can't get my /products/ endpoint to show up when trying to process my custom rewrite ...
0
votes
1answer
101 views

Can't get POST data in API endpoint callback

I have this: add_action( 'rest_api_init', function () { register_rest_route('my-project/v1/form', '/post', array( 'methods' => 'POST', 'callback' => 'post_form' ) ); }); I called ...
0
votes
1answer
19 views

POST request not going through?

I'm still trying to see clearly in some aspects of the API. I have a custom route add_action( 'rest_api_init', function () { register_rest_route('my-project/v1/', '/form/post/', array( '...
0
votes
1answer
436 views

If YITH Wishlist page is set to the WooCommerce my-account endpoint, the endpoints stop working all together. Any solution?

When using YITH to display the wishlist in the my-account endpoint of WooCommerce, the wishlist works fine, but the endpoints stop working. If we change the page to anything else other than the my-...
0
votes
1answer
302 views

Get The latest post from a category

I am using below code to get the latest post from a category www.mysite.com/wp-json/mynamespace/v1/latest-posts?category=it but an error is showing <?php /** * * ...
0
votes
1answer
109 views

How to get custom or filtered endpoints in WordPress API?

I am using WordPress API to show posts. How can I get custom or filtered endpoints in WordPress API? I want only the following items: Post title Post content Post Date Post categories Post featured ...
0
votes
1answer
151 views

Rewrite Endpoint Url without ? before endpoint

Created Custom Post type called members, don't need a members permalink, but need to link to member patents, if exists for member (which I got figured out). The problem I'm facing is the creation of ...
0
votes
1answer
569 views

How to use a RewriteRule to change endpoint url

I'm using woocommerce and wordpress. I would like to know how to use a RewriteRule to change my url from: /my-account/edit-address/billing to /account/edit-address/billing and load the endpoint page ...
0
votes
1answer
561 views

Endpoint Callback Display for Custom Plugin

I am building a plugin which allows admins to add staff members to a database. I have created a function in my plugin class file... cp_libstaff_frontend_display() ...which displays a table of every ...
-1
votes
1answer
2k views

Using Wordpress.com API to retrieve featured images

I'm using the wordpress.com API to access a blog's content: https://public-api.wordpress.com/wp/v2/sites/MYSITENUMBER/pages It works great, I can access all the text content I need, however, I ...
-1
votes
1answer
295 views

wordpress url rewrite Query Var to Static url

i have urls like these: http://animup.net/manga/bara-no-maria/ and have some url parameters http://animup.net/manga/bara-no-maria/?chp=1 http://animup.net/manga/bara-no-maria/?chp=2 http://animup....
6
votes
0answers
410 views

Custom Taxonomy Endpoint Pagination using paginate_links()

The Setup I have 2 taxonomies and 1 post type: Post Type: products Hierarchical Taxonomy: product_cat Nonhierarchical Taxonomy: product_type The product-category has a defined endpoint: ...
3
votes
0answers
691 views

Create a php callback/endpoint for an OAuth script

I am attempting an OAuth call to a 3rd party service but having issues with my callback script. I have a file oauth.php that is within my plugin directory. First question, do I need to go to the url ...
3
votes
0answers
247 views

Endpoint on Specific Page Slug

I have created an endpoint inside of my plugin: add_rewrite_endpoint( 'libstaff', EP_PAGES ); Now I would like to have the endpoint work for one page only based on its slug. In this case, I want it ...
3
votes
0answers
228 views

How make a multi language routes, with rewrite rules or rewrite endpoints?

I want to know a concept of making a multi language routing system for WP. That is the best practice, to make this routing system with add_rewrite_rules for pages post archive etc in part, or to use ...
2
votes
0answers
43 views

Removing “category” from URLs then “add_endpoint()” won't work…

For example, the original URL would be http://localhost/category/sub_category/. What I want is http://localhost/sub_category/, furthermore, I want to add an endpoint to the URL which looks like http:/...
2
votes
0answers
146 views

URL endpoint with HTML

I'm using WordPress endpoints to render another template on a post page. How can I add .html to the end of the URL that using the endpoint? Example: Normal URL: example.com/angry-birds Normal URL ...
1
vote
0answers
31 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 ...
1
vote
0answers
49 views

Manage custom post type in woocommerce /my-account/ page

I am hope for your help I have a custom post-type on my site - "Campaigns", I want to make that the user can on the page /my-account/campaigns was able to see the list of his posts, delete / edit ...
1
vote
0answers
115 views

add_rewrite_endpoint returns 404 on archives

My endpoint works on all kind of single pages and homepage, but it returns 404 in archive pages, either categories or custom taxonomes. I have reflushed rewrites but I don't get it work. This is my ...
1
vote
0answers
36 views

A case for Hierarchical Custom Posts

So I have 3 Custom Posts created with the Types plugin (the plugin should be irrelevant, anyway): 'Hotels', 'Rooms' and 'Webcams'. These last two are hierarchical, with 'Hotels' as their parent, set ...
1
vote
0answers
23 views

Rewrite Endpoints not Indexing with google

I don't know if anyone else has found this, but I've created some Endpoints for Authors to now have several pages, but Google isn't seeing any of them. It seems to see the parent url, but not any of ...
1
vote
0answers
721 views

add_rewrite_endpoint() and Custom Post Type Archive

I've got a custom post type. Let's call it books. I'm adding a new rewrite endpoint called pages. I want the url /books/pages/2/ to work but I don't see any rewrite rules generated by WordPress for ...
1
vote
0answers
300 views

Help writing custom function with rewrite endpoint that generates a page from dynamic content

I'm creating a WordPress plugin that will pull content from an API and display it dynamically on a WordPress blog like it's native content. An example of this content would be company locations. I ...
0
votes
0answers
22 views

AJAX call recieving a 400 bad request when array lenght is to long

I have a select dropdown where users can choose multiple options that get's sent to a custom Rest-API endpoint and returns values based on their selection(s). The dropdown is dynamically populated ...
0
votes
0answers
169 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
34 views

Rest API Custom Endpoint with percent % character always returning 404

I have an endpoint like this:- function foo_hook() { register_rest_route( 'sample_namespace/v1', '/author/(?P<author_name>[a-zA-Z0-9-_\%]+)', array( 'methods' => 'GET', 'callback' => '...
0
votes
0answers
13 views

Debug info from request handler

I'm adding custom request handler using add_action and register_rest_root. Sometimes it's hanging and I'm stuck without any output. I would like to use something like echo "Label"; to debug my code. ...
0
votes
0answers
729 views

Custom Rest API namespace and endpoints are responding with 404 & 503 errors

I am new to WordPress plugin development. I was developing a plugin for WordPress that would be used to create mobile apps for WordPress Bloggers. The whole source code of the plugin is at:- https://...
0
votes
0answers
102 views

Multiple Permalink Patterns for one page

Disclaimer: I've had a look at quite a few similar questions and haven't found any that answer my question. If you think otherwise, kindly reply. :) Alright, so I have one page: /classifieds/ What I'...