register route 404
-
hi,
I had a problem with registering a custom route from the docs
http://example.com/wp-json/myplugin/v2/author/id=1
register_rest_route(‘myplugin/v2′,’/author/(?P<id>[\d]+)’, array(
‘methods’ => ‘GET’,
‘callback’ => array($this, ‘my_awesome_func’),
‘args’ => array(
‘id’ => array(
‘validate_callback’ => ‘is_numeric’
),
),
) );it returns
{
“code”: “rest_no_route”,
“message”: “No route was found matching the URL and request method”,
“data”: {
“status”: 404
}
}while doing so
http://example.com/wp-json/myplugin/v2/author/
register_rest_route(‘myplugin/v2′,’/author’, ….)returns
“Testing from post type post”
May i know whats causing it?
WP 4.3.1
wp-rest-api Version 2.0-beta7
The topic ‘register route 404’ is closed to new replies.