PluginProbe
WP Coder – Insert & Manage Code Snippets / 3.0.4
WP Coder – Insert & Manage Code Snippets v3.0.4
4.5.1 1.1 2.3.1 2.3.2 2.4.1 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.1 3.1.1 3.2 3.2.1 3.3 3.4 3.5 3.5.1 All 39 releases
← All changes | classes/Publisher/EnqueueScript.php +14 -6 3.0.23.0.4 View file →
@@ -16,17 +16,12 @@
16 16 $js = wp_specialchars_decode( $result->js_code, ENT_QUOTES );
17 17
18 18 self::include_scripts( $result );
19 19
20 - if ( ! empty( $js ) && ! empty( $param['inline_js'] ) ) {
21 - self::print_style( $js, $param, $result );
22 - }
23 -
24 20 if ( ! empty( $js ) && empty( $param['inline_js'] ) ) {
25 21 self::include_script( $result, $param );
26 22 }
27 23
28 -
29 24 add_filter( 'script_loader_tag', [ __CLASS__, 'add_attribute' ], 20, 2 );
30 25 }
31 26
32 27 public static function add_attribute( $tag, $handle ) {
@@ -38,12 +33,25 @@
38 33
39 34 return $tag;
40 35 }
41 36
42 - private static function print_style( $js, $param, $result ): void {
37 + public static function inline( $result ): void {
38 +
43 39 if ( is_admin() ) {
44 40 return;
45 41 }
42 +
43 + $param = maybe_unserialize( $result->param );
44 + $js = wp_specialchars_decode( $result->js_code, ENT_QUOTES );
45 +
46 + if ( empty( $param['inline_js'] ) ) {
47 + return;
48 + }
49 +
50 + if ( empty( $js ) ) {
51 + return;
52 + }
53 +
46 54
47 55 $minified = ! empty( $param['minified_js'] ) ? $param['minified_js'] : 'obfuscate';
48 56
49 57 if ( $minified === 'obfuscate' ) {