23 lines
492 B
PHP
23 lines
492 B
PHP
<?php
|
|
/*
|
|
Plugin Name: Simple Status
|
|
Description: Provides a custom endpoint for health checks.
|
|
Version: 1.0
|
|
Author: Colin
|
|
*/
|
|
|
|
function simple_status_endpoint() {
|
|
// Perform any necessary checks here
|
|
$status = array('status' => 'ok');
|
|
wp_send_json($status);
|
|
}
|
|
|
|
// Register the custom endpoint
|
|
add_action('rest_api_init', function () {
|
|
register_rest_route('simple/v1', '/status', array(
|
|
'methods' => 'GET',
|
|
'callback' => 'simple_status_endpoint',
|
|
));
|
|
});
|
|
?>
|