-
-
Save Oceas/706abe4c39f4d81b0a6976c97c721025 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Returns name field in url parameter. | |
* | |
* @param object $args Options for the function. | |
* @author Scott Anderson <scott.anderson@webdevstudios.com> | |
* @return string | |
*/ | |
function say_name( object $args ) { | |
return $args['name']; | |
} | |
add_action( 'rest_api_init', function () { | |
register_rest_route( 'myepiscopal', '/say_name/', array( | |
'methods' => 'GET', | |
'callback' => 'say_name', | |
) ); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment