Skip to content

Instantly share code, notes, and snippets.

@mjangda
Created June 20, 2012 09:17
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjangda/2958980 to your computer and use it in GitHub Desktop.
Save mjangda/2958980 to your computer and use it in GitHub Desktop.
Adding additional origins to the WordPress Origin API
<?php
add_filter( 'allowed_http_origins', 'my_add_origins' );
function my_add_origins( $origins ) {
$origins[] = 'http://www.example.com'; // this will add www.example.com to the list of allowed origins when send_origin_headers() is called
return $origins;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment