Answers for "wp php custom queries to an api"

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

Browse Popular Code Answers by Language