Eu folosesc asta:
Cod PHP:
<?php
/*
Plugin Name: Break Out Of Frames
Plugin URI: [url]http://www.g-loaded.eu/2006/01/05/break-out-of-frames-wordpress-plugin/[/url]
Description: Avoid being framed by some other web site.
Version: 0.3
Author: GNot
Author URI: [url]http://www.g-loaded.eu/[/url]
*/
/*
License: GPL
Compatibility: All
Installation:
Place the break-out-of-frames.php file in your /wp-content/plugins/ directory
and activate through the administration panel.
Special Info:
This plugin does not use the is_preview() function at the moment due to some issues.
*/
/* Copyright George Notaras ([url]http://www.g-loaded.eu/[/url])
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* Changelog
* Fri Jan 26 2007 - v0.3
- The is_preview() WP function works ok now, so it is used in the plugin.
- Updated plugin homepage URL.
* Wed Nov 1 2006 - v0.2
- Plugin info update
* Thu Jan 5 2006 - v0.1
- Initial release
*/
function break_out_of_frames()
{
// if ( !isset($_SERVER['HTTP_REFERER']) || $_SERVER['REQUEST_URI'] == '/' || substr($_SERVER['HTTP_REFERER'], strlen(get_bloginfo('url')), 36) != '/wp-admin/post.php?action=edit&post=' ) {
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');
?>