Custom Endpoint shows 404
-
Hi,
I am stuck on creating custom endpoints. I followed this tutorial to create custom endpoints. But, it always returns 404.
https://developer.ww.wp.xz.cn/rest-api/extending-the-rest-api/adding-custom-endpoints/I added code below to function.php
add_action('rest_api_init', function() { register_rest_route('awesome/v1', '/awesomeparams', array( 'methods' => 'GET', 'callback' => 'get_awesome_params', 'args' => array(), 'permission_callback' => function () { return true; } )); }); function get_awesome_params( $data ) { return "aaaa"; }When I trying to access: http://smap.cas.mcmaster.ca/wp-json/awesome/v1/awesomeparams
It shows 404:
404 errorI also tried to flush the permalinks by going to WordPress admin -> Settings -> Permalinks and click save.
Can I get some help?
Thanks a lot!The page I need help with: [log in to see the link]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Custom Endpoint shows 404’ is closed to new replies.