How would I add custom tables/endpoints to the WP REST API?
I eventualy worked out a solution for my restaurants table, which sits alongside the wp_* tables in my WP database. Hope this helps add_action( ‘rest_api_init’, function () { register_rest_route( ‘restos/v1’, ‘/all’, array( ‘methods’ => ‘GET’, ‘callback’ => ‘handle_get_all’, ‘permission_callback’ => function () { return current_user_can( ‘edit_others_posts’ ); } ) ); } ); function handle_get_all( $data … Read more