Custom Endpoints
-
Does the rest api support custom endpoints as letters or only as integers? For example could an endpoint pass a slug?
so like:
/wp-json/portfolio/v1/clients/client-name insteadof/wp-json/portfolio/v1/clients/201register_rest_route ('portfolio/v1', '/clients/(?P<slug>\d+)/', array( 'methods' => 'GET', 'callback' => 'get_industry' ) );
The topic ‘Custom Endpoints’ is closed to new replies.