Last active
January 26, 2016 22:55
-
-
Save martijn94/b0ef65436892d279dccd to your computer and use it in GitHub Desktop.
Register WP REST API route
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
<?php | |
add_action( 'rest_api_init', 'wpc_register_wp_api_endpoints' ); | |
function wpc_register_wp_api_endpoints() { | |
register_rest_route( 'somename', '/search', array( | |
'methods' => 'GET', | |
'callback' => 'wpc_somename_search_callback', | |
)); | |
} | |
function wpc_somename_search_callback( $request_data ) { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment