Created
June 9, 2018 05:09
-
-
Save wunderdojo/034c47fbf0ab11eeb6274eae6a71bad4 to your computer and use it in GitHub Desktop.
Sample API Endpoint
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
register_rest_route( MSAPIPATH, '/accounts', | |
[ | |
'methods' => \WP_REST_Server::READABLE, | |
'callback' => [ | |
'MS\Controllers\Accounts_API_Controller', 'api_route_get_accounts' | |
], | |
'permission_callback' => function () { | |
return current_user_can( 'ms-manage-accounts' ); | |
} | |
] | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment