add_action('rest_api_init', function () {
register_rest_route('custom/v1', '/ping', [
'methods' => 'GET',
'callback' => fn() => 'pong'
]);
});
Why it matters
Lightweight APIs for headless or automation use.
Daily micro-tips for C#, SQL, performance, and scalable backend engineering.
add_action('rest_api_init', function () {
register_rest_route('custom/v1', '/ping', [
'methods' => 'GET',
'callback' => fn() => 'pong'
]);
});
Why it matters
Lightweight APIs for headless or automation use.