Skip to content

Instantly share code, notes, and snippets.

@Zenger
Created January 28, 2015 07:26
Show Gist options
  • Save Zenger/f516840db1538f743fb8 to your computer and use it in GitHub Desktop.
Save Zenger/f516840db1538f743fb8 to your computer and use it in GitHub Desktop.
<?php
/* Plugin Name: X-Frame-Options
Description: Simple X-Frame-Options Manager
Author: Zenger
Author URI: http://1theme.com/
*/
$setting = "http://themeforest.net/";
if ( version_compare(PHP_VERSION, '5.3.0', '>=') ) {
function sxfom_remove()
{
header_remove("X-FRAME-OPTIONS");
header_remove("X-Frame-Options");
}
add_action('send_headers' , 'sxfom_remove');
header_remove("X-FRAME-OPTIONS");
/* if ($setting == "same")
{
@header("X-FRAME-OPTIONS", "SAMEORIGIN");
}
else if ($setting == "deny")
{
@header("X-FRAME-OPTIONS", "DENY");
}
else
{
@header("X-FRAME-OPTIONS", "Allow-From SAMEORIGIN,$same");
} */
}
//@header("X-FRAME-OPTIONS", "Allow-From http://themeforest.net/");
//header_remove("X-FRAME-OPTIONS");
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment