recentpopularlog in

rest

« earlier   
REST State Machine Revisited | Nordic APIs |
What does it mean to design REST APIs? Asbjørn Ulsberg of Payex revisits his presentation from a past Platform Summit, reiterating his ideas on what it means to truly follow REST design.
rest 
yesterday by pks
json - Get WP Navigation Menu from REST API V2 - WordPress Development Stack Exchange
Menus are currently not available in the WP Rest. So what you need to do is register your own custom endpoint and then just call that route from your application that needs it.

So you would include something like this (in your functions.php, plugin, wherever):

function get_menu() {
# Change 'menu' to your own navigation slug.
return wp_get_nav_menu_items('menu');
}

add_action( 'rest_api_init', function () {
register_rest_route( 'myroutes', '/menu', array(
'methods' => 'GET',
'callback' => 'get_menu',
) );
} );
wpapi2  wordpress  api  REST  webdev  decoupledcms 
yesterday by dirtystylus

Copy this bookmark:





to read