PluginProbe
Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts / 2.2.7
Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts v2.2.7
2.7.7 2.7.6 2.7.5 2.7.4 trunk 1.3 2.0.4 2.0.6 2.1.91 2.2.4 2.2.7 2.2.9 2.3.1 2.3.10 2.4.10 2.4.2 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 2.6.0 2.6.1 2.7.0 All 28 releases
← All changes | includes/shortcodes/shortcode-js.php +3 -8 2.4.82.2.7 View file →
@@ -34,18 +34,14 @@
34 34 if ( ! $snippet || empty( $snippet_meta ) ) {
35 35 return;
36 36 }
37 37
38 - $attrs = $this->filterAttributes( $attr, $id );
38 + $attr = $this->filterAttributes( $attr, $id );
39 39
40 40 // Let users pass arbitrary variables, through shortcode attributes.
41 - // @since 2.4.0
42 - $vars = "";
43 - foreach ( $attrs as $var => $value ) {
44 - $vars .= PHP_EOL."var {$var} = \"{$value}\";";
45 - }
41 + // @since 2.0.5
42 + extract( $attr, EXTR_SKIP );
46 43
47 -
48 44 $is_activate = $this->getSnippetActivate( $snippet_meta );
49 45 $snippet_content = $this->getSnippetContent( $snippet, $snippet_meta, $id );
50 46 $snippet_scope = $this->getSnippetScope( $snippet_meta );
51 47 $is_condition = WINP_Plugin::app()->getExecuteObject()->checkCondition( $id );
@@ -53,9 +49,8 @@
53 49 if ( ! $is_activate || empty( $snippet_content ) || $snippet_scope != 'shortcode' || ! $is_condition ) {
54 50 return;
55 51 }
56 52
57 - echo "<script type='text/javascript'>{$vars}</script>"; //print attributes
58 53 echo WINP_Execute_Snippet::getJsCssSnippetData( $id );
59 54 }
60 55
61 56 }