Created
May 18, 2020 14:12
-
-
Save joedooley/42634b7295ab1278228e86468305f04b to your computer and use it in GitHub Desktop.
Enable CORS hack. Do not use in PROD!!!!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Front to the WordPress application. This file doesn't do anything, but loads | |
* wp-blog-header.php which does and tells WordPress to load the theme. | |
* | |
* @package WordPress | |
*/ | |
header('Access-Control-Allow-Origin: *'); | |
header('Access-Control-Allow-Methods: GET, POST, PATCH, PUT, DELETE, OPTIONS'); | |
header('Access-Control-Allow-Headers: Origin, Content-Type, X-Auth-Token Authorization'); | |
/** | |
* Tells WordPress to load the WordPress theme and output it. | |
* | |
* @var bool | |
*/ | |
define('WP_USE_THEMES', true); | |
/** Loads the WordPress Environment and Template */ | |
require dirname( __FILE__ ) . '/cms/wp-blog-header.php'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This should only be used if your debugging CORS issues in a local development environment.