PluginProbe ʕ •ᴥ•ʔ
WPCode – Insert Headers and Footers + Custom Code Snippets – WordPress Code Manager / 2.3.6
WPCode – Insert Headers and Footers + Custom Code Snippets – WordPress Code Manager v2.3.6
2.3.6 trunk 1.1 1.2 1.3 1.3.1 1.3.2 1.3.3 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.5.0 1.6.0 1.6.1 1.6.2 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.13.1 2.0.2 2.0.3 2.0.4 2.0.4.1 2.0.4.2 2.0.4.3 2.0.4.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.8.1 2.0.9 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.2 2.1.3 2.1.3.1 2.1.4 2.1.4.1 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 2.2.3 2.2.3.1 2.2.4 2.2.4.1 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 2.3.1 2.3.2 2.3.2.1 2.3.3 2.3.4 2.3.5
insert-headers-and-footers / includes / lite / admin / admin-scripts.php
insert-headers-and-footers / includes / lite / admin Last commit date
admin-scripts.php 2 years ago class-wpcode-admin-page-loader-lite.php 9 months ago class-wpcode-connect.php 2 years ago class-wpcode-metabox-snippets-lite.php 1 year ago class-wpcode-usage-tracking-lite.php 3 years ago notices.php 1 year ago
admin-scripts.php
72 lines
1 <?php
2 /**
3 * Load lite-specific scripts here.
4 *
5 * @package WPCode
6 */
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit;
10 }
11
12 add_action( 'admin_enqueue_scripts', 'wpcode_admin_scripts_global_lite' );
13 add_action( 'admin_head', 'wpcode_listen_for_deploy_message' );
14
15 /**
16 * Load version-specific global scripts.
17 *
18 * @return void
19 */
20 function wpcode_admin_scripts_global_lite() {
21 // Don't load global admin scripts if headers & footers mode is enabled.
22 if ( wpcode()->settings->get_option( 'headers_footers_mode' ) ) {
23 return;
24 }
25 wpcode_admin_scripts_global();
26 }
27
28 /**
29 * This is loaded after the plugin is activated and if the installation process was initiated
30 * from the WPCode Library site it will redirect the user to the appropriate page to continue
31 * that process.
32 *
33 * @return void
34 */
35 function wpcode_listen_for_deploy_message() {
36 // Load this only in the plugins list.
37 $screen = get_current_screen();
38 $screens = array(
39 'plugins',
40 'plugin-install',
41 );
42 if ( ! isset( $screen->id ) || ! in_array( $screen->id, $screens, true ) ) {
43 return;
44 }
45 $click_page = add_query_arg(
46 array(
47 'page' => 'wpcode-click',
48 ),
49 admin_url( 'admin.php' )
50 )
51 ?>
52 <script>
53 if ( window.opener ) {
54 window.opener.postMessage(
55 'wpcode-plugin-installed',
56 '<?php echo esc_url( wpcode()->library_auth->library_url ); ?>'
57 );
58 }
59 window.addEventListener(
60 'message',
61 ( event ) => {
62 if ( !event.isTrusted || '<?php echo esc_url( wpcode()->library_auth->library_url ); ?>' !== event.origin || 'wpcode-show-connect' !== event.data ) {
63 return;
64 }
65 window.location.href = '<?php echo esc_url( $click_page ); ?>&message=wpcode-deploy';
66 },
67 false
68 );
69 </script>
70 <?php
71 }
72