You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was just trying to create a custom route for my application and I noticed that the method 'registerRoute' only allows a named parameter to live at the end of the endpoint structure. For example, the following route works just fine.
The route above still produces the same final url structure as the first example I listed above.
I end up getting this https://youdomain.com/wp-json/gf/v2/entries/77 instead of https://youdomain.com/wp-json/gf/v2/entries/77/notifications.
This happens to be the structure of a few of the routes created by the gravity forms rest api plugin.
However, this endpoint structure happens to be quite common amongst many other rest api plugins as well.
I don't know how to get the trailing slug of the url to be added to the end of the path. Is this currently supported and I'm just missing something obvious or would this need to be a new feature? Any help would be much appreciated.
The text was updated successfully, but these errors were encountered:
Hey there,
I was just trying to create a custom route for my application and I noticed that the method 'registerRoute' only allows a named parameter to live at the end of the endpoint structure. For example, the following route works just fine.
WP.registerRoute('gf/v2', "/entries/(?P<id>\\d+)");
The above route will create a final url resembling something like
https://youdomain.com/wp-json/gf/v2/entries/77
However, the following use of registerRoute does not work.
WP.registerRoute('gf/v2', "/entries/(?P<id>\\d+)/notifications");
The route above still produces the same final url structure as the first example I listed above.
I end up getting this
https://youdomain.com/wp-json/gf/v2/entries/77
instead ofhttps://youdomain.com/wp-json/gf/v2/entries/77/notifications
.This happens to be the structure of a few of the routes created by the gravity forms rest api plugin.
However, this endpoint structure happens to be quite common amongst many other rest api plugins as well.
I don't know how to get the trailing slug of the url to be added to the end of the path. Is this currently supported and I'm just missing something obvious or would this need to be a new feature? Any help would be much appreciated.
The text was updated successfully, but these errors were encountered: