Skip to content

Instantly share code, notes, and snippets.

@leotsem
Forked from ocean90/plugin.php
Created November 15, 2013 16:07
Show Gist options
  • Save leotsem/7486827 to your computer and use it in GitHub Desktop.
Save leotsem/7486827 to your computer and use it in GitHub Desktop.
/**
* Add a X-XSS-Protection = 0 header for post previews to allow
* Webkit browsers to render iframe and flash objects.
* @see: http://core.trac.wordpress.org/ticket/20148
*
* @param $headers array Already added header items.
* @param $object WP The query variables.
*
* @return array
*/
function send_no_xss_protection_header( $headers, $object ) {
$headers['X-XSS-Protection'] = 0;
return $headers;
}
add_filter( 'wp_headers', 'send_no_xss_protection_header', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment