Disable REST API สำหรับ WordPress

function restrict_rest_api_to_localhost() {
  $data = array();
  $data['name'] = 'Tropical Properties Real Estate';
  echo json_encode($data);
  die();
}
add_action( 'rest_api_init', 'restrict_rest_api_to_localhost', 1 );

Leave a Reply

Your email address will not be published. Required fields are marked *