Make WordPress Core

Ticket #12293: frame-breakout.php

File frame-breakout.php, 436 bytes (added by ryan, 15 years ago)
Line 
1<?php
2
3function wp_frame_breakout() {
4        echo <<<EOF
5<script type="text/javascript">
6if (window.top !== window.self) {
7    window.top.location.href = window.self.location.href; }
8</script>
9EOF;
10}
11
12function wp_frame_breakout_disable() {
13        remove_action('admin_print_scripts', 'wp_frame_breakout');
14}
15
16add_action('admin_print_scripts', 'wp_frame_breakout');
17
18add_action('media_upload-iframe', 'wp_frame_breakout_disable');
19
20?>