servers[0]->url = str_replace("localhost", $swaggerUiInstance->getHost(), $config->servers[0]->url); $config->servers[1]->url = str_replace("localhost", $swaggerUiInstance->getHost(), $config->servers[1]->url); wp_send_json($config); }, 1); } }