@@ -15,20 +15,20 @@ |
||
15 | 15 | { |
16 | 16 | public function __construct() |
17 | 17 | { |
18 | - add_action('wp_default_scripts', [$this, 'dequeueJQueryMigrate']); |
|
18 | + add_action('wp_default_scripts', [ $this, 'dequeueJQueryMigrate' ]); |
|
19 | 19 | |
20 | 20 | if (defined('ICL_LANGUAGE_CODE')) { |
21 | 21 | // DO NOT LOAD WPML LANG SWITCHER CSS |
22 | 22 | define('ICL_DONT_LOAD_LANGUAGE_SELECTOR_CSS', true); |
23 | - add_action('wp_head', [$this, 'dequeueSitepressJs'], 11); |
|
23 | + add_action('wp_head', [ $this, 'dequeueSitepressJs' ], 11); |
|
24 | 24 | } |
25 | 25 | } |
26 | 26 | |
27 | 27 | public function dequeueJQueryMigrate($scripts) |
28 | 28 | { |
29 | - if (!is_admin() && !empty($scripts->registered['jquery'])) { |
|
30 | - $jquery_dependencies = $scripts->registered['jquery']->deps; |
|
31 | - $scripts->registered['jquery']->deps = array_diff($jquery_dependencies, ['jquery-migrate']); |
|
29 | + if (!is_admin() && !empty($scripts->registered[ 'jquery' ])) { |
|
30 | + $jquery_dependencies = $scripts->registered[ 'jquery' ]->deps; |
|
31 | + $scripts->registered[ 'jquery' ]->deps = array_diff($jquery_dependencies, [ 'jquery-migrate' ]); |
|
32 | 32 | } |
33 | 33 | } |
34 | 34 |