federated-wordpress-customi.../rest-api/get_dns_records_test.php
Ross Trottier 48b2d50861 beginning of dns tool
link extensions for admin
2024-06-22 09:54:23 -06:00

24 lines
520 B
PHP

<?php
add_action('rest_api_init', 'federated_route_get_dns');
function federated_route_get_dns(){
//register routes here
register_rest_route(
'federated-rest/v1',
'get-dns',
array(
'methods' => 'GET',
'callback' => 'federated_get_dns',
'permissions_callback' => 'check_federated_permissions'
)
);
}
function federated_get_dns($request){
$hostname = $request['hostname'];
$dns = dns_get_record($hostname);
return $dns;
}