wordpress cors policy no 'access-control-allow-origin' code example
Example 1: access-control-allow-origin htaccess
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin *
</IfModule>
Example 2: access-control-allow-origin htaccess
Header set Access-Control-Allow-Origin *
Example 3: wordpress Access-Control-Allow-Origin
function add_cors_http_header(){
header("Access-Control-Allow-Origin: *");
}
add_action('init','add_cors_http_header');