PluginProbe
PixCodes / trunk
PixCodes vtrunk
2.3.9 trunk 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8
← All changes | shortcodes.php +16 -15 2.3.4trunk View file →
@@ -24,8 +24,9 @@
24 24 protected $name;
25 25 protected $backend_assets;
26 26 protected $frontend_assets;
27 27 protected $load_frontend_scripts;
28 + protected $assets;
28 29 //we use this to get the prefix for the meta data from the theme - usually it's short theme name
29 30 protected $meta_prefix;
30 31
31 32 public function __construct() {
@@ -108,14 +109,14 @@
108 109 $types = $this->backend_assets;
109 110
110 111 foreach ( $types as $type => $assets ) {
111 112 foreach ( $assets as $key => $asset ) {
112 - $path = WPGRADE_SHORTCODES_URL . $asset['path'];
113 - if ( $type == 'js' ) {
114 - wp_enqueue_script( $asset['name'], $path, $asset['deps'] );
115 - } elseif ( $type == 'css' ) {
116 - wp_enqueue_style( $asset['name'], $path, $asset['deps'] );
117 - }
113 + $path = WPGRADE_SHORTCODES_URL . $asset['path'];
114 + if ( $type == 'js' ) {
115 + wp_enqueue_script( $asset['name'], $path, $asset['deps'], '2.3.9', true );
116 + } elseif ( $type == 'css' ) {
117 + wp_enqueue_style( $asset['name'], $path, $asset['deps'], '2.3.9' );
118 + }
118 119 }
119 120 }
120 121 }
121 122
@@ -129,14 +130,14 @@
129 130 $types = $this->frontend_assets;
130 131
131 132 foreach ( $types as $type => $assets ) {
132 133 foreach ( $assets as $key => $asset ) {
133 - $path = WPGRADE_SHORTCODES_URL . $asset['path'];
134 - if ( $type == 'js' ) {
135 - wp_enqueue_script( $asset['name'], $path, $asset['deps'] );
136 - } elseif ( $type == 'css' ) {
137 - wp_enqueue_style( $asset['name'], $path, $asset['deps'] );
138 - }
134 + $path = WPGRADE_SHORTCODES_URL . $asset['path'];
135 + if ( $type == 'js' ) {
136 + wp_enqueue_script( $asset['name'], $path, $asset['deps'], '2.3.9', true );
137 + } elseif ( $type == 'css' ) {
138 + wp_enqueue_style( $asset['name'], $path, $asset['deps'], '2.3.9' );
139 + }
139 140 }
140 141 }
141 142 }
142 143 }
@@ -152,17 +153,17 @@
152 153 $file_name = $param['type'] . '.php';
153 154 $file_path = WPGRADE_SHORTCODES_PATH . 'params/' . $file_name;
154 155
155 156 if ( ! file_exists( $file_path ) ) {
156 - echo '<span class="error">Inexistent param</span>';
157 + return '<span class="error">' . esc_html__( 'Inexistent param', 'pixcodes' ) . '</span>';
157 158 }
158 159 ob_start();
159 160
160 161 include( $file_path );
161 162
162 - echo ob_get_clean();
163 + return ob_get_clean();
163 164 }
164 165
165 166 }
166 167
167 168 global $wpgrade_shortcodes;
168 -$wpgrade_shortcodes = new WpGradeShortcode();
169 +$wpgrade_shortcodes = new WpGradeShortcode();