Skip to content

Instantly share code, notes, and snippets.

@ariona
Last active October 13, 2020 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ariona/3cc16b572c91fb6f55c6fc5fa1d7d7b8 to your computer and use it in GitHub Desktop.
Save ariona/3cc16b572c91fb6f55c6fc5fa1d7d7b8 to your computer and use it in GitHub Desktop.
Fix CORS issue on WP REST API
<?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