PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 4.3.2
Adminify – White Label, Admin Menu Editor, Login Customizer v4.3.2
4.3.2 4.3.1 4.3.0 4.2.26 4.2.25 4.2.24 4.2.23 4.2.22 4.2.21 4.2.20 4.2.19 4.2.18 4.2.17 4.2.16 4.2.15 4.2.14 4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 All 165 releases
← All changes | Inc/Admin/Frames/Frames.php +22 -0 4.2.214.3.2 View file →
@@ -61,8 +61,30 @@
61 61
62 62 echo '<script>parent.location.reload();</script>';
63 63 }
64 64
65 + /**
66 + * Break out of the Adminify UI iframe, decided by the browser.
67 + *
68 + * Same job as custom_plugin_change_reload(), for requests that could not
69 + * be classified server-side because the environment strips Fetch Metadata
70 + * headers (see Utils::has_fetch_metadata()). The script checks the frame
71 + * it actually runs in, so a genuine top-level load is left alone.
72 + *
73 + * @param string $actual_link URL to send the parent window to.
74 + * @return void
75 + */
76 + public static function maybe_break_out_of_frame( $actual_link ) {
77 + $url = wp_json_encode(
78 + esc_url_raw( $actual_link ),
79 + JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT
80 + );
81 +
82 + echo '<script>(function(){var f;try{f=window.frameElement;}catch(e){return;}'
83 + . 'if(!f||f.id!=="frame-adminify-app--iframe")return;'
84 + . 'parent.location.replace(' . $url . ');})();</script>';
85 + }
86 +
65 87 public function load_scripts()
66 88 {
67 89 wp_enqueue_style('frame-adminify--frame', PXLBSADMINIFY_ASSETS . 'admin/css/frame' . Utils::assets_ext('.css'), [], PXLBSADMINIFY_VER);
68 90 }