WP_Route
WP_Route copied to clipboard
A simple class for binding complex routes to functions methods or WP_AJAX actions.
## Problem: Defined route: `WP_Route::get('flights', 'callbackFn');` Any of the following request URIs will match with the above route definition and ***'callbackFn'*** get fired: ***"/flight"***, ***"/anytext"***, ***"/tttttttt"***, ***"eeee"*** ...etc ## Fix:...
We discovered that when you register a handler for a path this plugin invokes it for all paths that have euqal amount of segments. Ie: you register `/bar/{foo}` but the...
Sorry if it is out topic. I'm struggling with reponses. I'm able to use : ``` wp_send_json($output); ``` But, if I echo something, it goes over the head and the...
As stated in other issues this routing class simply doesn't work. The routing logic isn't actually implemented. No check is made to see if the requested URL matches any of...
Hi! I was just giving this a try today and noticed something quite odd - route handlers were being called when the request uri did not match the route. This...
handle function to match nested routes and allow variables through. ignores query string for simplicity, so that would need to be handled within each route callable if needed
$this isn't available in static method
Hi there! My API path looks like this: `/api/app/:action/:subaction`. How would i do this with your code? I tried this with `WP_Route::get('/api/app/action_name', 'action_function');` but it just gives me the error,...
I have included WP_Route.php and then added WP_Route::get('/wbl_search', array($this, 'do_search')); However any request to a folder path/to/product/?test=true is running do_search?