fahimmurshed

allowed_http_origins() only works in theme functions.php

Aug 27th, 2020
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.25 KB | None | 0 0
  1. // Ref https://wordpress.stackexchange.com/questions/342767/allowed-http-origins-only-works-in-theme-functions-php
  2. add_action( 'send_headers', 'add_cors_http_header' );
  3.  
  4. function add_cors_http_header()
  5. {
  6.     header("Access-Control-Allow-Origin: *");
  7. }
Add Comment
Please, Sign In to add comment