• Resolved Ravi Shakya

    (@ravisakya)


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

    How can i do this ?

    Route => ‘/author/(?P<id>\d+)’;
    To => ‘/latitude/(?P<id>\d+)/longitude/(?P<id>\d+)’;

    I want to pass two variables latitude and longitude for custom query. Is this possible ??

    https://www.ads-software.com/plugins/rest-api/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding multiples parameter to the custom url.’ is closed to new replies.