-
-
Save noyb34/5401086 to your computer and use it in GitHub Desktop.
This function snippet helps break out frames, so your pages are served only from the original domain not some douchebag's Google adsense site
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
// Break Out of Frames for WordPress | |
function break_out_of_frames() { | |
if (!is_preview()) { | |
echo "\n<script type=\"text/javascript\">"; | |
echo "\n<!--"; | |
echo "\nif (parent.frames.length > 0) { parent.location.href = location.href; }"; | |
echo "\n-->"; | |
echo "\n</script>\n\n"; | |
} | |
} | |
add_action('wp_head', 'break_out_of_frames'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment