PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / 2.0.2
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! v2.0.2
3.7.5 3.7.4 3.7.3 3.7.2 1-final 3.7.1 3.7.0 3.6.8 3.6.7 3.6.6 3.6.5 3.6.4 3.6.3 3.6.2 3.6.1 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.10 All 111 releases
← All changes | includes/Utils/Enqueue.php +2 -13 3.6.42.0.2 View file →
@@ -22,9 +22,9 @@
22 22 $this->call_wp_func( 'wp_register', $handle, $config );
23 23 }
24 24
25 25 public function localize( $handle, $name, $args ){
26 - wp_add_inline_script( $handle, 'var ' . $name . ' = ' . wp_json_encode( $args ) . ';', 'before' );
26 + wp_localize_script( $handle, $name, $args );
27 27 }
28 28
29 29 private function call_wp_func( $action, $handle, $config ) {
30 30 call_user_func( $action . '_' . $config['type'], $handle, $config['url'], $config['dependencies'], $config['version'], $config['args'] );
@@ -40,26 +40,15 @@
40 40 $url = $this->asset_url( $filename );
41 41 $version = $this->version;
42 42 $asset_config_path = $this->dist_path( $basename . '.asset.php' );
43 43
44 - if ( ! $is_js && ! file_exists( $asset_config_path ) ) {
45 - $js_basename = str_replace( 'css/', 'js/', $basename );
46 - $js_asset_path = $this->dist_path( $js_basename . '.asset.php' );
47 - if ( file_exists( $js_asset_path ) ) {
48 - $asset_config_path = $js_asset_path;
49 - }
50 - }
51 -
52 44 if ( file_exists( $asset_config_path ) ) {
53 45 $asset_config = require $asset_config_path;
54 46
55 47 if ( $is_js ) {
56 - $dependencies = array_unique( array_merge( $asset_config['dependencies'], $dependencies, ['regenerator-runtime'] ) );
48 + $dependencies = array_unique( array_merge( $asset_config['dependencies'], $dependencies ) );
57 49 }
58 50 $version = $asset_config['version'];
59 - }
60 - else if ((defined('TEMPLATELY_DEV') && TEMPLATELY_DEV) || (defined('WP_DEBUG') && WP_DEBUG)){
61 - $version = time();
62 51 }
63 52
64 53 return [
65 54 'url' => $url,