• 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 instead of /wp-json/portfolio/v1/clients/201

    register_rest_route ('portfolio/v1', '/clients/(?P<slug>\d+)/', array(
            'methods' => 'GET',
            'callback' => 'get_industry'
        ) );

    https://ww.wp.xz.cn/plugins/rest-api/

The topic ‘Custom Endpoints’ is closed to new replies.