Last active
February 12, 2019 00:21
-
-
Save wplit/ec5bce9bbf4f67202c37ad526aafb5aa to your computer and use it in GitHub Desktop.
Fix Gutenberg messing up on staging sites (Request header field X-WP-Nonce is not allowed by Access-Control-Allow-Headers in preflight response.)
This file contains 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
//Filter the WP Rest API URL. | |
add_filter('rest_url', function($url) { | |
$url = str_replace(home_url(), site_url(), $url); | |
return $url; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment