Last active
October 13, 2020 21:59
-
-
Save ariona/3cc16b572c91fb6f55c6fc5fa1d7d7b8 to your computer and use it in GitHub Desktop.
Fix CORS issue on WP REST API
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 | |
// .... | |
add_action('rest_api_init', function() { | |
remove_filter('rest_pre_serve_request', 'rest_send_cors_headers'); | |
}, 15); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment