Solution for "wp rest endpoints"

<?php add_action( 'rest_api_init', function () {   register_rest_route( 'myplugin/v1', '/author/(?P<id>\d+)', array(     'methods' => 'GET',     'callback' => 'my_awesome_func',   ) ); } );

wp custom rest endpoint

Similar codes for "wp rest endpoints"


Latest 'PHP' questions

Added before "wp rest endpoints"