| @@ -1040,21 +1040,24 @@ | ||
| 1040 | 1040 | } |
| 1041 | 1041 | $quick_sidebar_allowed_blocks = get_option( 'srfm_quick_sidebar_allowed_blocks' ); |
| 1042 | 1042 | $quick_sidebar_allowed_blocks = ! empty( $quick_sidebar_allowed_blocks ) && is_array( $quick_sidebar_allowed_blocks ) ? $quick_sidebar_allowed_blocks : $default_allowed_quick_sidebar_blocks; |
| 1043 | 1043 | $srfm_ajax_nonce = wp_create_nonce( 'srfm_ajax_nonce' ); |
| 1044 | - wp_enqueue_script( SRFM_SLUG . '-quick-action-siderbar', SRFM_URL . 'assets/build/quickActionSidebar.js', [], SRFM_VER, true ); | |
| 1045 | - wp_localize_script( | |
| 1046 | - SRFM_SLUG . '-quick-action-siderbar', | |
| 1047 | - SRFM_SLUG . '_quick_sidebar_blocks', | |
| 1048 | - [ | |
| 1049 | - 'allowed_blocks' => $quick_sidebar_allowed_blocks, | |
| 1050 | - 'srfm_enable_quick_action_sidebar' => $srfm_enable_quick_action_sidebar, | |
| 1051 | - 'srfm_ajax_nonce' => $srfm_ajax_nonce, | |
| 1052 | - 'srfm_ajax_url' => admin_url( 'admin-ajax.php' ), | |
| 1053 | - ] | |
| 1054 | - ); | |
| 1055 | 1044 | |
| 1056 | - $script_translations_handlers[] = SRFM_SLUG . '-quick-action-siderbar'; | |
| 1045 | + if ( Helper::is_sureforms_admin_page() ) { | |
| 1046 | + wp_enqueue_script( SRFM_SLUG . '-quick-action-siderbar', SRFM_URL . 'assets/build/quickActionSidebar.js', [], SRFM_VER, true ); | |
| 1047 | + wp_localize_script( | |
| 1048 | + SRFM_SLUG . '-quick-action-siderbar', | |
| 1049 | + SRFM_SLUG . '_quick_sidebar_blocks', | |
| 1050 | + [ | |
| 1051 | + 'allowed_blocks' => $quick_sidebar_allowed_blocks, | |
| 1052 | + 'srfm_enable_quick_action_sidebar' => $srfm_enable_quick_action_sidebar, | |
| 1053 | + 'srfm_ajax_nonce' => $srfm_ajax_nonce, | |
| 1054 | + 'srfm_ajax_url' => admin_url( 'admin-ajax.php' ), | |
| 1055 | + ] | |
| 1056 | + ); | |
| 1057 | + | |
| 1058 | + $script_translations_handlers[] = SRFM_SLUG . '-quick-action-siderbar'; | |
| 1059 | + } | |
| 1057 | 1060 | |
| 1058 | 1061 | /** |
| 1059 | 1062 | * Enqueuing SureTriggers Integration script. |
| 1060 | 1063 | * This script loads suretriggers iframe in Intergations tab. |