-
-
Save laxmariappan/6e535961133370a86117833ed0a78afd to your computer and use it in GitHub Desktop.
Custom route to check email notification status.
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 | |
/** | |
* Custom route to check email notification status. | |
* | |
* @return void | |
* @since 1.0 | |
* @author Lax Mariappan <lax@webdevstudios.com> | |
*/ | |
function gnotice_rest_init() { | |
$namespace = 'api-gnotice/v1'; | |
$route = 'check-email-response'; | |
register_rest_route( | |
$namespace, | |
$route, | |
array( | |
'methods' => \WP_REST_Server::READABLE, | |
'callback' => 'get_email_notification', | |
'permission_callback' => 'permission_callback' => function() { return current_user_can('edit_posts'); }, | |
) | |
); | |
} | |
add_action( 'rest_api_init', 'gnotice_rest_init' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment