-1๐
โ
I solved it by changing a line in wp-includes/rest-api.php file,
in rest_send_cors_headers() function:
header( 'Access-Control-Allow-Origin: *');
Source:stackexchange.com