| @@ -90,10 +90,10 @@ | ||
| 90 | 90 | $version = isset( $script['version'] ) ? $script['version'] : SUBSCRPT_VERSION; |
| 91 | 91 | |
| 92 | 92 | wp_register_script( $handle, $script['src'], $deps, $version, $in_footer ); |
| 93 | 93 | |
| 94 | - // Register script translations for scripts that use wp-i18n. | |
| 95 | - if ( 'sdevs_subscrpt_cart_block' === $handle || in_array( 'wp-i18n', (array) $deps, true ) ) { | |
| 94 | + // Register script translations for scripts that use wp-i18n (e.g., block assets). | |
| 95 | + if ( function_exists( 'wp_set_script_translations' ) && 'sdevs_subscrpt_cart_block' === $handle ) { | |
| 96 | 96 | wp_set_script_translations( $handle, 'subscription', SUBSCRPT_PATH . '/languages' ); |
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | } |
| @@ -145,9 +145,9 @@ | ||
| 145 | 145 | |
| 146 | 146 | $scripts = array( |
| 147 | 147 | 'sdevs_subscription_admin' => array( |
| 148 | 148 | 'src' => $plugin_js_assets_path . 'admin.js', |
| 149 | - 'deps' => array( 'jquery', 'wp-i18n' ), | |
| 149 | + 'deps' => array( 'jquery' ), | |
| 150 | 150 | 'in_footer' => true, |
| 151 | 151 | ), |
| 152 | 152 | 'subscrpt_admin_components' => array( |
| 153 | 153 | 'src' => false, |