Answers for "wordpress create custom api endpoint"

PHP
0

wp custom rest endpoint

<?php
add_action( 'rest_api_init', function () {
  register_rest_route( 'myplugin/v1', '/author/(?P<id>\d+)', array(
    'methods' => 'GET',
    'callback' => 'my_awesome_func',
  ) );
} );
Posted by: Guest on January-13-2021

Code answers related to "wordpress create custom api endpoint"

Browse Popular Code Answers by Language