Skip to content

Instantly share code, notes, and snippets.

@Oceas
Last active July 20, 2020 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Oceas/f74526d040636b071cc97cb6d646f5d1 to your computer and use it in GitHub Desktop.
Save Oceas/f74526d040636b071cc97cb6d646f5d1 to your computer and use it in GitHub Desktop.
/**
* Returns Hello World.
*
* @param object $data Options for the function.
* @author Scott Anderson <scott.anderson@webdevstudios.com>
* @return string
*/
function hello_world( object $data ) {
return 'Hello World';
}
add_action( 'rest_api_init', function () {
register_rest_route( 'myepiscopal', '/hello_world/', array(
'methods' => 'GET',
'callback' => 'hello_world',
) );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment