With redirection own WP REST API stopped work
-
Hello,
I’ve created some own routes and with Redirection plugin everything is redirected from POST/DELETE to GET.
Using Basic Auth and some own solutions (routes/endpoints…)
With Redirection OFF below code works fine, when Redirection Plugin is working all incoming API calls are redirected to GETExisted redirections just redirects:
/name/ to /something-name/add_action(‘rest_api_init’, function () {
register_rest_route(‘wp/v2’, ‘notice’, array(
‘methods’ => ‘POST’,
‘callback’ => ‘addFunc’
));
register_rest_route(‘wp/v2’, ‘notice/(?P<id>\d+)’, array(
‘methods’ => ‘POST’,
‘callback’ => ‘updateFunc’
));
register_rest_route(‘wp/v2’, ‘notice/(?P<id>\d+)’, array(
‘methods’ => ‘DELETE’,
‘callback’ => ‘deleteFunc’
));
});regards,
Przemek
The topic ‘With redirection own WP REST API stopped work’ is closed to new replies.