Skip to content

Instantly share code, notes, and snippets.

@murshed
Last active March 2, 2022 15:31
Show Gist options
  • Save murshed/c16536d0707d53f0c1d1d6d2af6d7c26 to your computer and use it in GitHub Desktop.
Save murshed/c16536d0707d53f0c1d1d6d2af6d7c26 to your computer and use it in GitHub Desktop.
Cross-Origin Resource Sharing
// Ref https://wordpress.stackexchange.com/questions/342767/allowed-http-origins-only-works-in-theme-functions-php
add_action( 'send_headers', 'add_cors_http_header' );
function add_cors_http_header()
{
header("Access-Control-Allow-Origin: *");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment