PluginProbe
Code Engine – PHP Snippets, AI Functions & Automation for WordPress / 0.3.7
Code Engine – PHP Snippets, AI Functions & Automation for WordPress v0.3.7
0.5.7 0.5.6 0.5.5 0.5.4 0.5.3 0.5.2 0.5.1 0.5.0 0.4.9 0.4.8 0.4.7 0.4.6 trunk 0.0.1 0.0.2 0.2.8 0.2.9 0.3.0 0.3.1 0.3.2 0.3.3 0.3.4 0.3.5 0.3.6 0.3.7 All 33 releases
← All changes | classes/admin.php +14 -5 0.2.90.3.7 View file →
@@ -10,12 +10,21 @@
10 10 if ( is_admin() ) {
11 11 add_action( 'admin_menu', array( $this, 'app_menu' ) );
12 12
13 13 // Load the scripts only if they are needed by the current screen
14 - $page = isset( $_GET["page"] ) ? sanitize_text_field( $_GET["page"] ) : null;
15 - $is_mwcode_screen = in_array( $page, [ 'mwcode_settings' ] );
16 - $is_meowapps_dashboard = $page === 'meowapps-main-menu';
17 - if ( $is_meowapps_dashboard || $is_mwcode_screen ) {
14 + // $page = isset( $_GET["page"] ) ? sanitize_text_field( $_GET["page"] ) : null;
15 + // $is_mwcode_screen = in_array( $page, [ 'mwcode_settings' ] );
16 + // $is_meowapps_dashboard = $page === 'meowapps-main-menu';
17 +
18 +
19 + // if ( $is_meowapps_dashboard || $is_mwcode_screen ) {
20 + // add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
21 + // }
22 +
23 + $can_access_settings = $this->core->can_access_settings();
24 + $can_access_features = $this->core->can_access_features();
25 +
26 + if ( $can_access_settings || $can_access_features ) {
18 27 add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
19 28 }
20 29 }
21 30 }
@@ -28,9 +37,9 @@
28 37 wp_register_script( 'mwcode_snippet_vault-vendor', MWCODE_URL . 'app/vendor.js',
29 38 ['wp-element', 'wp-i18n'], $cache_buster
30 39 );
31 40 wp_register_script( 'mwcode_snippet_vault', MWCODE_URL . 'app/index.js',
32 - ['mwcode_snippet_vault-vendor', 'wp-i18n'], $cache_buster
41 + ['mwcode_snippet_vault-vendor', 'wp-i18n', 'wp-blocks', 'wp-block-editor', 'wp-components'], $cache_buster
33 42 );
34 43 wp_set_script_translations( 'mwcode_snippet_vault', 'code-engine' );
35 44 wp_enqueue_script('mwcode_snippet_vault' );
36 45