@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | 'public' => true, |
244 | 244 | ), 'objects' ); |
245 | 245 | $post_types = array_combine( array_keys( $post_types ), wp_list_pluck( $post_types, 'label' ) ); |
246 | - unset( $post_types[ 'attachment' ] ); |
|
246 | + unset( $post_types[ 'attachment' ] ); |
|
247 | 247 | |
248 | 248 | /** |
249 | 249 | * Set which post types are allowed |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | $post_types = get_post_types( array( |
271 | 271 | 'public' => true, |
272 | 272 | ), 'names' ); |
273 | - unset( $post_types[ 'attachment' ] ); |
|
273 | + unset( $post_types[ 'attachment' ] ); |
|
274 | 274 | |
275 | 275 | /** |
276 | 276 | * Set which post types are allowed |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | */ |
383 | 383 | if ( !function_exists( 'lasso_user_can' ) ): |
384 | 384 | function lasso_user_can( $action = '', $postid = 0 ) { |
385 | - $result = false; |
|
385 | + $result = false; |
|
386 | 386 | if ( empty( $action ) ) |
387 | 387 | $action = 'edit_posts'; |
388 | 388 | |
@@ -397,17 +397,17 @@ discard block |
||
397 | 397 | $allowed_post_types = array_diff($allowed_post_types,array('page')); |
398 | 398 | } |
399 | 399 | |
400 | - if (!empty($allowed_post_types) && !empty($postid)) { |
|
400 | + if (!empty($allowed_post_types) && !empty($postid)) { |
|
401 | 401 | $type = get_post_type( $postid ); |
402 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
402 | + $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
403 | 403 | |
404 | - if ( in_array( $type, $allowed_post_types ) ) { |
|
404 | + if ( in_array( $type, $allowed_post_types ) ) { |
|
405 | 405 | $result = true; |
406 | - } |
|
407 | - } else { |
|
408 | - //we are not checking against a post, return true |
|
406 | + } |
|
407 | + } else { |
|
408 | + //we are not checking against a post, return true |
|
409 | 409 | $result = true; |
410 | - } |
|
410 | + } |
|
411 | 411 | } else { |
412 | 412 | $result = false; |
413 | 413 | } |
@@ -13,6 +13,11 @@ discard block |
||
13 | 13 | * @since 1.0 |
14 | 14 | */ |
15 | 15 | if( !function_exists('lasso_editor_get_option')): |
16 | + |
|
17 | + /** |
|
18 | + * @param string $option |
|
19 | + * @param string $section |
|
20 | + */ |
|
16 | 21 | function lasso_editor_get_option( $option, $section, $default = '' ) { |
17 | 22 | |
18 | 23 | if ( empty( $option ) ) |
@@ -216,7 +221,7 @@ discard block |
||
216 | 221 | * Return an array of categories for autocomplete |
217 | 222 | * |
218 | 223 | * @since 0.9.3 |
219 | - * @return array all categoiries |
|
224 | + * @return null|string all categoiries |
|
220 | 225 | */ |
221 | 226 | function lasso_get_objects( $taxonomy = 'category' ) { |
222 | 227 | |
@@ -309,7 +314,7 @@ discard block |
||
309 | 314 | * Used internally as a callback to build a tab or content area for modal addons |
310 | 315 | * |
311 | 316 | * @param $tab object |
312 | -* @param $type string tab or content |
|
317 | +* @param string $type string tab or content |
|
313 | 318 | * @uses lasso_modal_addons() |
314 | 319 | * @since 0.9.4 |
315 | 320 | */ |
@@ -15,8 +15,9 @@ discard block |
||
15 | 15 | if( !function_exists('lasso_editor_get_option')): |
16 | 16 | function lasso_editor_get_option( $option, $section, $default = '' ) { |
17 | 17 | |
18 | - if ( empty( $option ) ) |
|
19 | - return; |
|
18 | + if ( empty( $option ) ) { |
|
19 | + return; |
|
20 | + } |
|
20 | 21 | |
21 | 22 | if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
22 | 23 | |
@@ -44,11 +45,12 @@ discard block |
||
44 | 45 | |
45 | 46 | $q = new wp_query( array( 'post_type' => 'ai_galleries', 'post_status' => 'publish' ) ); |
46 | 47 | |
47 | - if ( $q->have_posts() ) |
|
48 | - return true; |
|
49 | - else |
|
50 | - return false; |
|
51 | -} |
|
48 | + if ( $q->have_posts() ) { |
|
49 | + return true; |
|
50 | + } else { |
|
51 | + return false; |
|
52 | + } |
|
53 | + } |
|
52 | 54 | |
53 | 55 | /** |
54 | 56 | * Return a CSS class of an automatically supported theme |
@@ -194,13 +196,15 @@ discard block |
||
194 | 196 | */ |
195 | 197 | function lasso_get_post_objects( $postid = '', $taxonomy = 'category') { |
196 | 198 | |
197 | - if ( empty( $postid ) ) |
|
198 | - $postid = get_the_ID(); |
|
199 | + if ( empty( $postid ) ) { |
|
200 | + $postid = get_the_ID(); |
|
201 | + } |
|
199 | 202 | |
200 | 203 | $objects = 'category' == $taxonomy ? get_the_category( $postid ) : get_the_tags( $postid ); |
201 | 204 | |
202 | - if ( empty( $objects) ) |
|
203 | - return; |
|
205 | + if ( empty( $objects) ) { |
|
206 | + return; |
|
207 | + } |
|
204 | 208 | |
205 | 209 | $out = ''; |
206 | 210 | foreach( $objects as $object ) { |
@@ -222,8 +226,9 @@ discard block |
||
222 | 226 | |
223 | 227 | $objects = 'category' == $taxonomy ? get_categories(array('hide_empty' => 0)) : get_tags(array('hide_empty' => 0)); |
224 | 228 | |
225 | - if ( empty( $objects) ) |
|
226 | - return; |
|
229 | + if ( empty( $objects) ) { |
|
230 | + return; |
|
231 | + } |
|
227 | 232 | |
228 | 233 | $out = ""; |
229 | 234 | foreach( $objects as $object ) { |
@@ -345,8 +350,9 @@ discard block |
||
345 | 350 | */ |
346 | 351 | function lasso_clean_string( $string = '' ) { |
347 | 352 | |
348 | - if ( empty( $string ) ) |
|
349 | - return; |
|
353 | + if ( empty( $string ) ) { |
|
354 | + return; |
|
355 | + } |
|
350 | 356 | |
351 | 357 | return sanitize_text_field( strtolower( preg_replace('/[\s_]/', '-', $string ) ) ); |
352 | 358 | } |
@@ -385,11 +391,13 @@ discard block |
||
385 | 391 | if ( !function_exists( 'lasso_user_can' ) ): |
386 | 392 | function lasso_user_can( $action = '', $postid = 0 ) { |
387 | 393 | $result = false; |
388 | - if ( empty( $action ) ) |
|
389 | - $action = 'edit_posts'; |
|
394 | + if ( empty( $action ) ) { |
|
395 | + $action = 'edit_posts'; |
|
396 | + } |
|
390 | 397 | |
391 | - if ( empty( $postid ) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') |
|
392 | - $postid = get_the_ID(); |
|
398 | + if ( empty( $postid ) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') { |
|
399 | + $postid = get_the_ID(); |
|
400 | + } |
|
393 | 401 | |
394 | 402 | if ( is_user_logged_in() && current_user_can( $action, $postid ) ) { |
395 | 403 | // check against post types: |
@@ -12,22 +12,22 @@ discard block |
||
12 | 12 | * @return the option value |
13 | 13 | * @since 1.0 |
14 | 14 | */ |
15 | -if( !function_exists('lasso_editor_get_option')): |
|
16 | - function lasso_editor_get_option( $option, $section, $default = '' ) { |
|
15 | +if (!function_exists('lasso_editor_get_option')): |
|
16 | + function lasso_editor_get_option($option, $section, $default = '') { |
|
17 | 17 | |
18 | - if ( empty( $option ) ) |
|
18 | + if (empty($option)) |
|
19 | 19 | return; |
20 | 20 | |
21 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
21 | + if (function_exists('is_multisite') && is_multisite()) { |
|
22 | 22 | |
23 | - $options = get_site_option( $section ); |
|
23 | + $options = get_site_option($section); |
|
24 | 24 | |
25 | 25 | } else { |
26 | 26 | |
27 | - $options = get_option( $section ); |
|
27 | + $options = get_option($section); |
|
28 | 28 | } |
29 | 29 | |
30 | - if ( isset( $options[$option] ) ) { |
|
30 | + if (isset($options[$option])) { |
|
31 | 31 | return $options[$option]; |
32 | 32 | } |
33 | 33 | |
@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | */ |
43 | 43 | function lasso_editor_galleries_exist() { |
44 | 44 | |
45 | - $q = new wp_query( array( 'post_type' => 'ai_galleries', 'post_status' => 'publish' ) ); |
|
45 | + $q = new wp_query(array('post_type' => 'ai_galleries', 'post_status' => 'publish')); |
|
46 | 46 | |
47 | - if ( $q->have_posts() ) |
|
47 | + if ($q->have_posts()) |
|
48 | 48 | return true; |
49 | 49 | else |
50 | 50 | return false; |
@@ -59,9 +59,9 @@ discard block |
||
59 | 59 | function lasso_get_supported_theme_class() { |
60 | 60 | |
61 | 61 | $name = wp_get_theme()->get('Name'); |
62 | - $slug = lasso_clean_string( $name ); |
|
62 | + $slug = lasso_clean_string($name); |
|
63 | 63 | |
64 | - switch ( $slug ) { |
|
64 | + switch ($slug) { |
|
65 | 65 | case 'aesop-story-theme': // aesop |
66 | 66 | $out = '.aesop-entry-content'; |
67 | 67 | break; |
@@ -110,16 +110,16 @@ discard block |
||
110 | 110 | |
111 | 111 | } |
112 | 112 | |
113 | - return apply_filters('lasso_content_class', !empty( $out ) ? $out : false); |
|
113 | + return apply_filters('lasso_content_class', !empty($out) ? $out : false); |
|
114 | 114 | //return !empty( $out ) ? $out : false; |
115 | 115 | } |
116 | 116 | |
117 | 117 | function lasso_get_supported_theme_title_class() { |
118 | 118 | |
119 | 119 | $name = wp_get_theme()->get('Name'); |
120 | - $slug = lasso_clean_string( $name ); |
|
120 | + $slug = lasso_clean_string($name); |
|
121 | 121 | |
122 | - switch ( $slug ) { |
|
122 | + switch ($slug) { |
|
123 | 123 | |
124 | 124 | case 'aesop-story-theme': // aesop |
125 | 125 | $out = '.aesop-entry-title'; |
@@ -147,16 +147,16 @@ discard block |
||
147 | 147 | break; |
148 | 148 | } |
149 | 149 | |
150 | - return apply_filters('lasso_title_class', !empty( $out ) ? $out : false); |
|
150 | + return apply_filters('lasso_title_class', !empty($out) ? $out : false); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | //since 0.9.9.6 |
154 | 154 | function lasso_get_supported_theme_featured_image_class() { |
155 | 155 | |
156 | 156 | $name = wp_get_theme()->get('Name'); |
157 | - $slug = lasso_clean_string( $name ); |
|
157 | + $slug = lasso_clean_string($name); |
|
158 | 158 | |
159 | - return apply_filters('lasso_featured_image_class', !empty( $out ) ? $out : false); |
|
159 | + return apply_filters('lasso_featured_image_class', !empty($out) ? $out : false); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | * @since 0.8.7 |
168 | 168 | * @return string of comma separated classes |
169 | 169 | */ |
170 | -function lasso_supported_no_save(){ |
|
170 | +function lasso_supported_no_save() { |
|
171 | 171 | |
172 | 172 | return apply_filters('lasso_dont_save', '.lasso--ignore,.sharedaddy,.us_wrapper,.meta,.edit-link,.ssba,.addtoany_share_save_container,.mashsb-container,.heateor_sss_sharing_container,.nc_socialPanel, .jp-relatedposts, .fb-comments'); |
173 | 173 | } |
@@ -181,8 +181,8 @@ discard block |
||
181 | 181 | * |
182 | 182 | * @return array|mixed|object|string|void |
183 | 183 | */ |
184 | -function lasso_sanitize_data( $data ) { |
|
185 | - return \lasso\sanatize::do_sanitize( $data ); |
|
184 | +function lasso_sanitize_data($data) { |
|
185 | + return \lasso\sanatize::do_sanitize($data); |
|
186 | 186 | |
187 | 187 | } |
188 | 188 | |
@@ -192,18 +192,18 @@ discard block |
||
192 | 192 | * @since 0.9.3 |
193 | 193 | * @return string of comma delimited category slugs |
194 | 194 | */ |
195 | -function lasso_get_post_objects( $postid = '', $taxonomy = 'category') { |
|
195 | +function lasso_get_post_objects($postid = '', $taxonomy = 'category') { |
|
196 | 196 | |
197 | - if ( empty( $postid ) ) |
|
197 | + if (empty($postid)) |
|
198 | 198 | $postid = get_the_ID(); |
199 | 199 | |
200 | - $objects = 'category' == $taxonomy ? get_the_category( $postid ) : get_the_tags( $postid ); |
|
200 | + $objects = 'category' == $taxonomy ? get_the_category($postid) : get_the_tags($postid); |
|
201 | 201 | |
202 | - if ( empty( $objects) ) |
|
202 | + if (empty($objects)) |
|
203 | 203 | return; |
204 | 204 | |
205 | 205 | $out = ''; |
206 | - foreach( $objects as $object ) { |
|
206 | + foreach ($objects as $object) { |
|
207 | 207 | //$out .= $object->slug.', '; |
208 | 208 | $out .= $object->name.','; |
209 | 209 | } |
@@ -218,15 +218,15 @@ discard block |
||
218 | 218 | * @since 0.9.3 |
219 | 219 | * @return array all categoiries |
220 | 220 | */ |
221 | -function lasso_get_objects( $taxonomy = 'category' ) { |
|
221 | +function lasso_get_objects($taxonomy = 'category') { |
|
222 | 222 | |
223 | 223 | $objects = 'category' == $taxonomy ? get_categories(array('hide_empty' => 0)) : get_tags(array('hide_empty' => 0)); |
224 | 224 | |
225 | - if ( empty( $objects) ) |
|
225 | + if (empty($objects)) |
|
226 | 226 | return; |
227 | 227 | |
228 | 228 | $out = ""; |
229 | - foreach( $objects as $object ) { |
|
229 | + foreach ($objects as $object) { |
|
230 | 230 | $out .= $object->name.','; |
231 | 231 | } |
232 | 232 | |
@@ -241,11 +241,11 @@ discard block |
||
241 | 241 | * @since 0.9.4 |
242 | 242 | */ |
243 | 243 | function lasso_post_types_names() { |
244 | - $post_types = get_post_types( array( |
|
244 | + $post_types = get_post_types(array( |
|
245 | 245 | 'public' => true, |
246 | - ), 'objects' ); |
|
247 | - $post_types = array_combine( array_keys( $post_types ), wp_list_pluck( $post_types, 'label' ) ); |
|
248 | - unset( $post_types[ 'attachment' ] ); |
|
246 | + ), 'objects'); |
|
247 | + $post_types = array_combine(array_keys($post_types), wp_list_pluck($post_types, 'label')); |
|
248 | + unset($post_types['attachment']); |
|
249 | 249 | |
250 | 250 | /** |
251 | 251 | * Set which post types are allowed |
@@ -254,14 +254,14 @@ discard block |
||
254 | 254 | * |
255 | 255 | * @param array $allowed_post_types Array of names (not labels) of allowed post types. Must be registered. |
256 | 256 | */ |
257 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( 'post', 'page') ); |
|
258 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
257 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array('post', 'page')); |
|
258 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
259 | 259 | if (!current_user_can('edit_pages')) { |
260 | - $allowed_post_types = array_diff($allowed_post_types,array('page')); |
|
260 | + $allowed_post_types = array_diff($allowed_post_types, array('page')); |
|
261 | 261 | } |
262 | - foreach( $post_types as $name => $label ) { |
|
263 | - if ( ! in_array( $name, $allowed_post_types ) ) { |
|
264 | - unset( $post_types[ $name ] ); |
|
262 | + foreach ($post_types as $name => $label) { |
|
263 | + if (!in_array($name, $allowed_post_types)) { |
|
264 | + unset($post_types[$name]); |
|
265 | 265 | } |
266 | 266 | } |
267 | 267 | return $post_types; |
@@ -269,10 +269,10 @@ discard block |
||
269 | 269 | |
270 | 270 | |
271 | 271 | function lasso_post_types() { |
272 | - $post_types = get_post_types( array( |
|
272 | + $post_types = get_post_types(array( |
|
273 | 273 | 'public' => true, |
274 | - ), 'names' ); |
|
275 | - unset( $post_types[ 'attachment' ] ); |
|
274 | + ), 'names'); |
|
275 | + unset($post_types['attachment']); |
|
276 | 276 | |
277 | 277 | /** |
278 | 278 | * Set which post types are allowed |
@@ -281,11 +281,11 @@ discard block |
||
281 | 281 | * |
282 | 282 | * @param array $allowed_post_types Array of names (not labels) of allowed post types. Must be registered. |
283 | 283 | */ |
284 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( 'post') ); |
|
285 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
286 | - foreach( $post_types as $name => $label ) { |
|
287 | - if ( ! in_array( $name, $allowed_post_types ) ) { |
|
288 | - unset( $post_types[ $name ] ); |
|
284 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array('post')); |
|
285 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
286 | + foreach ($post_types as $name => $label) { |
|
287 | + if (!in_array($name, $allowed_post_types)) { |
|
288 | + unset($post_types[$name]); |
|
289 | 289 | } |
290 | 290 | } |
291 | 291 | return $post_types; |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | global $wp_post_types; |
296 | 296 | $post_types = lasso_post_types(); |
297 | 297 | $rest_base = array(); |
298 | - foreach ( $post_types as $post_type) { |
|
298 | + foreach ($post_types as $post_type) { |
|
299 | 299 | $rest_base[$post_type] = $wp_post_types[$post_type]->rest_base; |
300 | 300 | } |
301 | 301 | |
@@ -313,22 +313,22 @@ discard block |
||
313 | 313 | * @uses lasso_modal_addons() |
314 | 314 | * @since 0.9.4 |
315 | 315 | */ |
316 | -function lasso_modal_addons_content( $tab = '', $type ){ |
|
316 | +function lasso_modal_addons_content($tab = '', $type) { |
|
317 | 317 | |
318 | - $name = lasso_clean_string( $tab['name'] ); |
|
318 | + $name = lasso_clean_string($tab['name']); |
|
319 | 319 | |
320 | - if ( 'tab' == $type ) { |
|
320 | + if ('tab' == $type) { |
|
321 | 321 | |
322 | - $out = sprintf( '<li data-addon-name="%s">%s</li>', $name, $tab['name'] ); |
|
322 | + $out = sprintf('<li data-addon-name="%s">%s</li>', $name, $tab['name']); |
|
323 | 323 | |
324 | - } else if ( 'content' == $type ){ |
|
324 | + } else if ('content' == $type) { |
|
325 | 325 | |
326 | - $content = isset( $tab['content'] ) && is_callable( $tab['content'] ) ? call_user_func( $tab['content'] ) : false; |
|
327 | - $options = isset( $tab['options'] ) && is_callable( $tab['options'] ) ? call_user_func( $tab['options'] ) : false; |
|
326 | + $content = isset($tab['content']) && is_callable($tab['content']) ? call_user_func($tab['content']) : false; |
|
327 | + $options = isset($tab['options']) && is_callable($tab['options']) ? call_user_func($tab['options']) : false; |
|
328 | 328 | |
329 | - $out = sprintf( '<div class="lasso--modal__content not-visible" data-addon-content="%s"> |
|
329 | + $out = sprintf('<div class="lasso--modal__content not-visible" data-addon-content="%s"> |
|
330 | 330 | %s%s |
331 | - </div>', $name, $content, lasso_option_form( $name, $options ) ); |
|
331 | + </div>', $name, $content, lasso_option_form($name, $options)); |
|
332 | 332 | |
333 | 333 | } |
334 | 334 | |
@@ -343,12 +343,12 @@ discard block |
||
343 | 343 | * |
344 | 344 | * @return void|string |
345 | 345 | */ |
346 | -function lasso_clean_string( $string = '' ) { |
|
346 | +function lasso_clean_string($string = '') { |
|
347 | 347 | |
348 | - if ( empty( $string ) ) |
|
348 | + if (empty($string)) |
|
349 | 349 | return; |
350 | 350 | |
351 | - return sanitize_text_field( strtolower( preg_replace('/[\s_]/', '-', $string ) ) ); |
|
351 | + return sanitize_text_field(strtolower(preg_replace('/[\s_]/', '-', $string))); |
|
352 | 352 | } |
353 | 353 | |
354 | 354 | /** |
@@ -361,13 +361,13 @@ discard block |
||
361 | 361 | * |
362 | 362 | * @return void|string |
363 | 363 | */ |
364 | -function lasso_unclean_string( $string = '' ) { |
|
364 | +function lasso_unclean_string($string = '') { |
|
365 | 365 | |
366 | - if ( empty( $string ) ) { |
|
366 | + if (empty($string)) { |
|
367 | 367 | return; |
368 | 368 | } |
369 | 369 | |
370 | - return sanitize_text_field( strtolower( str_replace( '-', '_', $string ) ) ); |
|
370 | + return sanitize_text_field(strtolower(str_replace('-', '_', $string))); |
|
371 | 371 | } |
372 | 372 | |
373 | 373 | |
@@ -382,39 +382,39 @@ discard block |
||
382 | 382 | * @param unknown $postid int the id of the post object to check against |
383 | 383 | * @since 0.9.9.7 added filter 'lasso_user_can_filter' |
384 | 384 | */ |
385 | -if ( !function_exists( 'lasso_user_can' ) ): |
|
386 | - function lasso_user_can( $action = '', $postid = 0 ) { |
|
385 | +if (!function_exists('lasso_user_can')): |
|
386 | + function lasso_user_can($action = '', $postid = 0) { |
|
387 | 387 | $result = false; |
388 | - if ( empty( $action ) ) |
|
388 | + if (empty($action)) |
|
389 | 389 | $action = 'edit_posts'; |
390 | 390 | |
391 | - if ( empty( $postid ) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') |
|
391 | + if (empty($postid) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') |
|
392 | 392 | $postid = get_the_ID(); |
393 | 393 | |
394 | - if ( is_user_logged_in() && current_user_can( $action, $postid ) ) { |
|
394 | + if (is_user_logged_in() && current_user_can($action, $postid)) { |
|
395 | 395 | // check against post types: |
396 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( 'post', 'page') ); |
|
396 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array('post', 'page')); |
|
397 | 397 | |
398 | 398 | if (!current_user_can('edit_pages')) { |
399 | - $allowed_post_types = array_diff($allowed_post_types,array('page')); |
|
399 | + $allowed_post_types = array_diff($allowed_post_types, array('page')); |
|
400 | 400 | } |
401 | 401 | |
402 | 402 | if (!empty($allowed_post_types) && !empty($postid)) { |
403 | - $type = get_post_type( $postid ); |
|
404 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
403 | + $type = get_post_type($postid); |
|
404 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
405 | 405 | |
406 | - if ( in_array( $type, $allowed_post_types ) ) { |
|
407 | - $result = true; |
|
406 | + if (in_array($type, $allowed_post_types)) { |
|
407 | + $result = true; |
|
408 | 408 | } |
409 | 409 | } else { |
410 | 410 | //we are not checking against a post, return true |
411 | - $result = true; |
|
411 | + $result = true; |
|
412 | 412 | } |
413 | 413 | } else { |
414 | 414 | $result = false; |
415 | 415 | } |
416 | 416 | |
417 | - return apply_filters( 'lasso_user_can_filter', $result, $action, $postid); |
|
417 | + return apply_filters('lasso_user_can_filter', $result, $action, $postid); |
|
418 | 418 | } |
419 | 419 | endif; |
420 | 420 | |
@@ -423,25 +423,25 @@ discard block |
||
423 | 423 | * |
424 | 424 | * @since 0.9.5 |
425 | 425 | */ |
426 | -if ( !function_exists('lasso_editor_empty_results') ): |
|
426 | +if (!function_exists('lasso_editor_empty_results')): |
|
427 | 427 | |
428 | - function lasso_editor_empty_results( $type = 'posts' ){ |
|
428 | + function lasso_editor_empty_results($type = 'posts') { |
|
429 | 429 | |
430 | - if ( 'posts' == $type ) { |
|
430 | + if ('posts' == $type) { |
|
431 | 431 | |
432 | - $string = apply_filters('lasso_empty_state_message', __('No posts to show', 'lasso') ); |
|
432 | + $string = apply_filters('lasso_empty_state_message', __('No posts to show', 'lasso')); |
|
433 | 433 | $icon = 'lasso-icon-file-text2'; |
434 | 434 | $button = false; |
435 | 435 | |
436 | - } elseif ( 'revision' == $type ) { |
|
436 | + } elseif ('revision' == $type) { |
|
437 | 437 | |
438 | - $string = apply_filters('lasso_empty_state_message', __('No revisions found', 'lasso') ); |
|
438 | + $string = apply_filters('lasso_empty_state_message', __('No revisions found', 'lasso')); |
|
439 | 439 | $icon = 'lasso-icon-history'; |
440 | - $button = sprintf('<a href="#" class="lasso--btn-secondary" id="lasso--close-modal">%s</a>', __('Close','lasso') ); |
|
440 | + $button = sprintf('<a href="#" class="lasso--btn-secondary" id="lasso--close-modal">%s</a>', __('Close', 'lasso')); |
|
441 | 441 | |
442 | 442 | } |
443 | 443 | |
444 | - return sprintf('<div id="lasso--empty-state" class="lasso--empty-state"><i class="lasso--empty-state-icon lasso-icon %s"></i><p>%s</p>%s</div>', $icon, $string, $button ); |
|
444 | + return sprintf('<div id="lasso--empty-state" class="lasso--empty-state"><i class="lasso--empty-state-icon lasso-icon %s"></i><p>%s</p>%s</div>', $icon, $string, $button); |
|
445 | 445 | } |
446 | 446 | |
447 | 447 | endif; |
@@ -45,8 +45,9 @@ discard block |
||
45 | 45 | function process_settings() { |
46 | 46 | |
47 | 47 | // bail out if current user isn't and administrator and they are not logged in |
48 | - if ( !current_user_can( 'manage_options' ) || !is_user_logged_in() ) |
|
49 | - return; |
|
48 | + if ( !current_user_can( 'manage_options' ) || !is_user_logged_in() ) { |
|
49 | + return; |
|
50 | + } |
|
50 | 51 | |
51 | 52 | if ( isset( $_POST['action'] ) && 'lasso-editor-settings' == $_POST['action'] && check_admin_referer( 'nonce', 'lasso_editor_settings' ) ) { |
52 | 53 | |
@@ -86,8 +87,9 @@ discard block |
||
86 | 87 | */ |
87 | 88 | function lasso_editor_settings_form() { |
88 | 89 | |
89 | - if ( !is_user_logged_in() ) |
|
90 | - return; |
|
90 | + if ( !is_user_logged_in() ) { |
|
91 | + return; |
|
92 | + } |
|
91 | 93 | |
92 | 94 | $article_object = lasso_editor_get_option( 'article_class', 'lasso_editor' ); |
93 | 95 | $featImgClass = lasso_editor_get_option( 'featimg_class', 'lasso_editor' ); |
@@ -137,7 +139,9 @@ discard block |
||
137 | 139 | $post_types = get_post_types( $args, 'objects' ); |
138 | 140 | |
139 | 141 | foreach ( $post_types as $post_type ) { |
140 | - if ($post_type->name == 'attachment') continue; |
|
142 | + if ($post_type->name == 'attachment') { |
|
143 | + continue; |
|
144 | + } |
|
141 | 145 | $checked =""; |
142 | 146 | if ( in_array( $post_type->name, $allowed_post_types ) ) { |
143 | 147 | $checked = 'checked="checked"'; |
@@ -9,9 +9,9 @@ discard block |
||
9 | 9 | |
10 | 10 | function __construct() { |
11 | 11 | |
12 | - add_action( 'admin_menu', array( $this, 'menu' ) ); |
|
13 | - add_action( 'network_admin_menu', array( $this, 'menu' ) ); |
|
14 | - add_action( 'wp_ajax_lasso-editor-settings', array( $this, 'process_settings' ) ); |
|
12 | + add_action('admin_menu', array($this, 'menu')); |
|
13 | + add_action('network_admin_menu', array($this, 'menu')); |
|
14 | + add_action('wp_ajax_lasso-editor-settings', array($this, 'process_settings')); |
|
15 | 15 | |
16 | 16 | } |
17 | 17 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | function menu() { |
24 | 24 | |
25 | 25 | // CHANGED Removed condition. |
26 | - add_submenu_page( 'lasso-editor', __( 'Settings', 'lasso' ), __( 'Settings', 'lasso' ), 'manage_options', 'lasso-editor-settings', array( $this, 'settings' ) ); |
|
26 | + add_submenu_page('lasso-editor', __('Settings', 'lasso'), __('Settings', 'lasso'), 'manage_options', 'lasso-editor-settings', array($this, 'settings')); |
|
27 | 27 | |
28 | 28 | } |
29 | 29 | |
@@ -45,26 +45,26 @@ discard block |
||
45 | 45 | function process_settings() { |
46 | 46 | |
47 | 47 | // bail out if current user isn't and administrator and they are not logged in |
48 | - if ( !current_user_can( 'manage_options' ) || !is_user_logged_in() ) |
|
48 | + if (!current_user_can('manage_options') || !is_user_logged_in()) |
|
49 | 49 | return; |
50 | 50 | |
51 | - if ( isset( $_POST['action'] ) && 'lasso-editor-settings' == $_POST['action'] && check_admin_referer( 'nonce', 'lasso_editor_settings' ) ) { |
|
51 | + if (isset($_POST['action']) && 'lasso-editor-settings' == $_POST['action'] && check_admin_referer('nonce', 'lasso_editor_settings')) { |
|
52 | 52 | |
53 | - $options = isset( $_POST['lasso_editor'] ) ? $_POST['lasso_editor'] : false; |
|
53 | + $options = isset($_POST['lasso_editor']) ? $_POST['lasso_editor'] : false; |
|
54 | 54 | |
55 | 55 | $arr = $options['allowed_post_types']; |
56 | - $options = array_map( 'sanitize_text_field', $options ); |
|
57 | - $options['allowed_post_types'] = array_keys( $arr); |
|
56 | + $options = array_map('sanitize_text_field', $options); |
|
57 | + $options['allowed_post_types'] = array_keys($arr); |
|
58 | 58 | |
59 | 59 | |
60 | 60 | |
61 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
61 | + if (function_exists('is_multisite') && is_multisite()) { |
|
62 | 62 | |
63 | - update_site_option( 'lasso_editor', $options ); |
|
63 | + update_site_option('lasso_editor', $options); |
|
64 | 64 | |
65 | 65 | } else { |
66 | 66 | |
67 | - update_option( 'lasso_editor', $options ); |
|
67 | + update_option('lasso_editor', $options); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | wp_send_json_success(); |
@@ -86,65 +86,65 @@ discard block |
||
86 | 86 | */ |
87 | 87 | function lasso_editor_settings_form() { |
88 | 88 | |
89 | - if ( !is_user_logged_in() ) |
|
89 | + if (!is_user_logged_in()) |
|
90 | 90 | return; |
91 | 91 | |
92 | - $article_object = lasso_editor_get_option( 'article_class', 'lasso_editor' ); |
|
93 | - $featImgClass = lasso_editor_get_option( 'featimg_class', 'lasso_editor' ); |
|
94 | - $titleClass = lasso_editor_get_option( 'title_class', 'lasso_editor' ); |
|
95 | - |
|
96 | - $post_new_disabled = lasso_editor_get_option( 'post_adding_disabled', 'lasso_editor' ); |
|
97 | - $save_to_post_disabled = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' ); |
|
98 | - $post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' ); |
|
99 | - $allow_change_date = lasso_editor_get_option( 'allow_change_date', 'lasso_editor' ); |
|
100 | - $shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' ); |
|
101 | - $enable_autosave = lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ); |
|
102 | - |
|
103 | - $toolbar_headings = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' ); |
|
104 | - $toolbar_headings_h4 = lasso_editor_get_option( 'toolbar_headings_h4', 'lasso_editor' ); |
|
105 | - $toolbar_show_color = lasso_editor_get_option( 'toolbar_show_color', 'lasso_editor' ); |
|
106 | - $toolbar_show_alignment = lasso_editor_get_option( 'toolbar_show_alignment', 'lasso_editor' ); |
|
92 | + $article_object = lasso_editor_get_option('article_class', 'lasso_editor'); |
|
93 | + $featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor'); |
|
94 | + $titleClass = lasso_editor_get_option('title_class', 'lasso_editor'); |
|
95 | + |
|
96 | + $post_new_disabled = lasso_editor_get_option('post_adding_disabled', 'lasso_editor'); |
|
97 | + $save_to_post_disabled = lasso_editor_get_option('post_save_disabled', 'lasso_editor'); |
|
98 | + $post_settings_disabled = lasso_editor_get_option('post_settings_disabled', 'lasso_editor'); |
|
99 | + $allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor'); |
|
100 | + $shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor'); |
|
101 | + $enable_autosave = lasso_editor_get_option('enable_autosave', 'lasso_editor'); |
|
102 | + |
|
103 | + $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
104 | + $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
105 | + $toolbar_show_color = lasso_editor_get_option('toolbar_show_color', 'lasso_editor'); |
|
106 | + $toolbar_show_alignment = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor'); |
|
107 | 107 | |
108 | - $objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor'); |
|
109 | - $objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor'); |
|
108 | + $objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor'); |
|
109 | + $objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor'); |
|
110 | 110 | $disable_tour = lasso_editor_get_option('disable_tour', 'lasso_editor'); |
111 | 111 | $show_ignored_items = lasso_editor_get_option('show_ignored_items', 'lasso_editor'); |
112 | 112 | $save_using_rest_disabled = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor'); |
113 | 113 | |
114 | - $default_post_types = apply_filters( 'lasso_allowed_post_types', array( 'post', 'page')); |
|
115 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', $default_post_types); |
|
114 | + $default_post_types = apply_filters('lasso_allowed_post_types', array('post', 'page')); |
|
115 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', $default_post_types); |
|
116 | 116 | |
117 | - $bold_tag = lasso_editor_get_option( 'bold_tag', 'lasso_editor', "b"); |
|
118 | - $i_tag = lasso_editor_get_option( 'i_tag', 'lasso_editor', "i"); |
|
117 | + $bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor', "b"); |
|
118 | + $i_tag = lasso_editor_get_option('i_tag', 'lasso_editor', "i"); |
|
119 | 119 | |
120 | 120 | ?> |
121 | 121 | <div class="wrap"> |
122 | 122 | |
123 | - <h2><?php _e( 'Editus Settings', 'lasso' );?></h2> |
|
123 | + <h2><?php _e('Editus Settings', 'lasso'); ?></h2> |
|
124 | 124 | |
125 | 125 | <form id="lasso-editor-settings-form" class="lasso--form-settings" method="post" enctype="multipart/form-data"> |
126 | 126 | |
127 | - <?php do_action('lasso_settings_before');?> |
|
127 | + <?php do_action('lasso_settings_before'); ?> |
|
128 | 128 | |
129 | 129 | |
130 | 130 | |
131 | - <h3><?php _e( 'Enable for:', 'lasso' );?></h3> |
|
131 | + <h3><?php _e('Enable for:', 'lasso'); ?></h3> |
|
132 | 132 | <div class="lasso-editor-settings--option-wrap"> |
133 | 133 | <div class="lasso-editor-settings--option-inner"> |
134 | 134 | |
135 | - <span class="lasso--setting-description"><?php _e( 'Enable Editus for the following post types.', 'lasso' );?></span> |
|
135 | + <span class="lasso--setting-description"><?php _e('Enable Editus for the following post types.', 'lasso'); ?></span> |
|
136 | 136 | <?php |
137 | 137 | $args = array( |
138 | 138 | 'public' => true |
139 | 139 | ); |
140 | 140 | |
141 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
142 | - $post_types = get_post_types( $args, 'objects' ); |
|
141 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
142 | + $post_types = get_post_types($args, 'objects'); |
|
143 | 143 | |
144 | - foreach ( $post_types as $post_type ) { |
|
144 | + foreach ($post_types as $post_type) { |
|
145 | 145 | if ($post_type->name == 'attachment') continue; |
146 | - $checked =""; |
|
147 | - if ( in_array( $post_type->name, $allowed_post_types ) ) { |
|
146 | + $checked = ""; |
|
147 | + if (in_array($post_type->name, $allowed_post_types)) { |
|
148 | 148 | $checked = 'checked="checked"'; |
149 | 149 | } |
150 | 150 | echo '<label><input type="checkbox" '.$checked.' name="lasso_editor[allowed_post_types]['.$post_type->name.']" id="lasso_editor[allowed_post_types]['.$post_type->name.']" >'.$post_type->name.'</label>'; |
@@ -154,69 +154,69 @@ discard block |
||
154 | 154 | </div> |
155 | 155 | |
156 | 156 | |
157 | - <h3><?php _e( 'Internal Settings', 'lasso' );?></h3> |
|
157 | + <h3><?php _e('Internal Settings', 'lasso'); ?></h3> |
|
158 | 158 | <div class="lasso-editor-settings--option-wrap"> |
159 | 159 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
160 | - <label><?php _e( 'Article Class', 'lasso' );?></label> |
|
161 | - <span class="lasso--setting-description"><?php _e( 'Provide the CSS class (including the preceding dot) of container that holds the post. This should be the first parent container class that holds the_content.', 'lasso' );?></span> |
|
162 | - <input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr( $article_object );?>" placeholder=".entry-content"> |
|
160 | + <label><?php _e('Article Class', 'lasso'); ?></label> |
|
161 | + <span class="lasso--setting-description"><?php _e('Provide the CSS class (including the preceding dot) of container that holds the post. This should be the first parent container class that holds the_content.', 'lasso'); ?></span> |
|
162 | + <input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr($article_object); ?>" placeholder=".entry-content"> |
|
163 | 163 | </div> |
164 | 164 | |
165 | 165 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
166 | - <label><?php _e( 'Featured Image Class', 'lasso' );?></label> |
|
167 | - <span class="lasso--setting-description"><?php _e( 'Provide the CSS class that uses a featured image as a background image. This currently only supports themes that have the featured image set as background image.', 'lasso' );?></span> |
|
168 | - <input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr( $featImgClass );?>" placeholder=".entry-content"> |
|
166 | + <label><?php _e('Featured Image Class', 'lasso'); ?></label> |
|
167 | + <span class="lasso--setting-description"><?php _e('Provide the CSS class that uses a featured image as a background image. This currently only supports themes that have the featured image set as background image.', 'lasso'); ?></span> |
|
168 | + <input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr($featImgClass); ?>" placeholder=".entry-content"> |
|
169 | 169 | </div> |
170 | 170 | |
171 | 171 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
172 | - <label><?php _e( 'Article Title Class', 'lasso' );?></label> |
|
173 | - <span class="lasso--setting-description"><?php _e( 'Provide the CSS class for the post title. This will enable you to update the title of the post by clicking and typing.', 'lasso' );?></span> |
|
174 | - <input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr( $titleClass );?>" placeholder=".entry-content"> |
|
172 | + <label><?php _e('Article Title Class', 'lasso'); ?></label> |
|
173 | + <span class="lasso--setting-description"><?php _e('Provide the CSS class for the post title. This will enable you to update the title of the post by clicking and typing.', 'lasso'); ?></span> |
|
174 | + <input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr($titleClass); ?>" placeholder=".entry-content"> |
|
175 | 175 | </div> |
176 | 176 | |
177 | 177 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
178 | - <label><?php _e( 'Ignored Items to Save', 'lasso' );?></label> |
|
179 | - <span class="lasso--setting-description"><?php _e( 'If your post container holds additional markup, list the css class names (comma separated, including the dot) of those items. When you enter the editor, Editus will remove (NOT delete) these items so that it does not save them as HTML.', 'lasso' );?></span> |
|
180 | - <textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNoSave );?></textarea> |
|
178 | + <label><?php _e('Ignored Items to Save', 'lasso'); ?></label> |
|
179 | + <span class="lasso--setting-description"><?php _e('If your post container holds additional markup, list the css class names (comma separated, including the dot) of those items. When you enter the editor, Editus will remove (NOT delete) these items so that it does not save them as HTML.', 'lasso'); ?></span> |
|
180 | + <textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr($objectsNoSave); ?></textarea> |
|
181 | 181 | </div> |
182 | 182 | |
183 | 183 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
184 | - <label><?php _e( 'Read Only Items', 'lasso' );?></label> |
|
185 | - <span class="lasso--setting-description"><?php _e( 'If your post has items that should not be editable, list the css class names (comma separated, including the dot) of those items.', 'lasso' );?></span> |
|
186 | - <textarea name="lasso_editor[non_editable]" id="lasso_editor[non_editable]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNonEditable );?></textarea> |
|
184 | + <label><?php _e('Read Only Items', 'lasso'); ?></label> |
|
185 | + <span class="lasso--setting-description"><?php _e('If your post has items that should not be editable, list the css class names (comma separated, including the dot) of those items.', 'lasso'); ?></span> |
|
186 | + <textarea name="lasso_editor[non_editable]" id="lasso_editor[non_editable]" placeholder=".classname, .another-class"><?php echo esc_attr($objectsNonEditable); ?></textarea> |
|
187 | 187 | </div> |
188 | 188 | |
189 | 189 | <div class="lasso-editor-settings--option-inner" > |
190 | - <input type="checkbox" class="checkbox" name="lasso_editor[show_ignored_items]" id="lasso_editor[show_ignored_items]" <?php echo checked( $show_ignored_items, 'on' );?> > |
|
191 | - <label for="lasso_editor[show_ignored_items]"> <?php _e( 'Show Ignored Items', 'lasso' );?></label> |
|
192 | - <span class="lasso--setting-description"><?php _e( 'By default the ignored items are hidden. Check this to show ignored items while keeping them uneditable.', 'lasso' );?></span> |
|
190 | + <input type="checkbox" class="checkbox" name="lasso_editor[show_ignored_items]" id="lasso_editor[show_ignored_items]" <?php echo checked($show_ignored_items, 'on'); ?> > |
|
191 | + <label for="lasso_editor[show_ignored_items]"> <?php _e('Show Ignored Items', 'lasso'); ?></label> |
|
192 | + <span class="lasso--setting-description"><?php _e('By default the ignored items are hidden. Check this to show ignored items while keeping them uneditable.', 'lasso'); ?></span> |
|
193 | 193 | </div> |
194 | 194 | </div> |
195 | 195 | |
196 | - <h3><?php _e( 'Editor UI', 'lasso' );?></h3> |
|
196 | + <h3><?php _e('Editor UI', 'lasso'); ?></h3> |
|
197 | 197 | <div class="lasso-editor-settings--option-wrap"> |
198 | 198 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
199 | - <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked( $toolbar_headings, 'on' );?> > |
|
200 | - <label for="lasso_editor[toolbar_headings]"><?php _e( 'Enable H2 and H3 Buttons', 'lasso' );?></label> |
|
201 | - <span class="lasso--setting-description"><?php _e( 'Show the buttons to set H2 and H3 settings.', 'lasso' );?></span> |
|
199 | + <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked($toolbar_headings, 'on'); ?> > |
|
200 | + <label for="lasso_editor[toolbar_headings]"><?php _e('Enable H2 and H3 Buttons', 'lasso'); ?></label> |
|
201 | + <span class="lasso--setting-description"><?php _e('Show the buttons to set H2 and H3 settings.', 'lasso'); ?></span> |
|
202 | 202 | |
203 | 203 | </div> |
204 | 204 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
205 | - <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings_h4]" id="lasso_editor[toolbar_headings_h4]" <?php echo checked( $toolbar_headings_h4, 'on' );?> > |
|
206 | - <label for="lasso_editor[toolbar_headings_h4]"><?php _e( 'Enable H4/H5/H6 Buttons', 'lasso' );?></label> |
|
207 | - <span class="lasso--setting-description"><?php _e( 'Show the buttons to set H4/H5/H6 settings.', 'lasso' );?></span> |
|
205 | + <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings_h4]" id="lasso_editor[toolbar_headings_h4]" <?php echo checked($toolbar_headings_h4, 'on'); ?> > |
|
206 | + <label for="lasso_editor[toolbar_headings_h4]"><?php _e('Enable H4/H5/H6 Buttons', 'lasso'); ?></label> |
|
207 | + <span class="lasso--setting-description"><?php _e('Show the buttons to set H4/H5/H6 settings.', 'lasso'); ?></span> |
|
208 | 208 | |
209 | 209 | </div> |
210 | 210 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
211 | - <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_color]" id="lasso_editor[toolbar_show_color]" <?php echo checked( $toolbar_show_color, 'on' );?> > |
|
212 | - <label for="lasso_editor[toolbar_show_color]"><?php _e( 'Enable Text Color Buttons', 'lasso' );?></label> |
|
213 | - <span class="lasso--setting-description"><?php _e( 'Show the buttons to set text colors.', 'lasso' );?></span> |
|
211 | + <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_color]" id="lasso_editor[toolbar_show_color]" <?php echo checked($toolbar_show_color, 'on'); ?> > |
|
212 | + <label for="lasso_editor[toolbar_show_color]"><?php _e('Enable Text Color Buttons', 'lasso'); ?></label> |
|
213 | + <span class="lasso--setting-description"><?php _e('Show the buttons to set text colors.', 'lasso'); ?></span> |
|
214 | 214 | |
215 | 215 | </div> |
216 | 216 | <div class="lasso-editor-settings--option-inner"> |
217 | - <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_alignment]" id="lasso_editor[toolbar_show_alignment]" <?php echo checked( $toolbar_show_alignment, 'on' );?> > |
|
218 | - <label for="lasso_editor[toolbar_show_alignment]"><?php _e( 'Enable Text Align Buttons', 'lasso' );?></label> |
|
219 | - <span class="lasso--setting-description"><?php _e( 'Show the buttons to set text alignment.', 'lasso' );?></span> |
|
217 | + <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_alignment]" id="lasso_editor[toolbar_show_alignment]" <?php echo checked($toolbar_show_alignment, 'on'); ?> > |
|
218 | + <label for="lasso_editor[toolbar_show_alignment]"><?php _e('Enable Text Align Buttons', 'lasso'); ?></label> |
|
219 | + <span class="lasso--setting-description"><?php _e('Show the buttons to set text alignment.', 'lasso'); ?></span> |
|
220 | 220 | |
221 | 221 | </div> |
222 | 222 | </div> |
@@ -225,74 +225,74 @@ discard block |
||
225 | 225 | |
226 | 226 | |
227 | 227 | |
228 | - <h3><?php _e( 'Post Settings UI', 'lasso' );?></h3> |
|
228 | + <h3><?php _e('Post Settings UI', 'lasso'); ?></h3> |
|
229 | 229 | <div class="lasso-editor-settings--option-wrap" > |
230 | 230 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
231 | - <input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked( $post_settings_disabled, 'on' );?> > |
|
232 | - <label for="lasso_editor[post_settings_disabled]"> <?php _e( 'Disable Post Settings', 'lasso' );?></label> |
|
233 | - <span class="lasso--setting-description"><?php _e( 'Check this to disable users from being able to edit post settings from the front-end.', 'lasso' );?></span> |
|
231 | + <input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked($post_settings_disabled, 'on'); ?> > |
|
232 | + <label for="lasso_editor[post_settings_disabled]"> <?php _e('Disable Post Settings', 'lasso'); ?></label> |
|
233 | + <span class="lasso--setting-description"><?php _e('Check this to disable users from being able to edit post settings from the front-end.', 'lasso'); ?></span> |
|
234 | 234 | </div> |
235 | 235 | |
236 | 236 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
237 | - <input type="checkbox" class="checkbox" name="lasso_editor[allow_change_date]" id="lasso_editor[allow_change_date]" <?php echo checked( $allow_change_date, 'on' );?> > |
|
238 | - <label for="lasso_editor[allow_change_date]"> <?php _e( 'Allow Changing Post Date', 'lasso' );?></label> |
|
239 | - <span class="lasso--setting-description"><?php _e( 'Add the date selector to change the post\'s date to the Post Setting dialog', 'lasso' );?></span> |
|
237 | + <input type="checkbox" class="checkbox" name="lasso_editor[allow_change_date]" id="lasso_editor[allow_change_date]" <?php echo checked($allow_change_date, 'on'); ?> > |
|
238 | + <label for="lasso_editor[allow_change_date]"> <?php _e('Allow Changing Post Date', 'lasso'); ?></label> |
|
239 | + <span class="lasso--setting-description"><?php _e('Add the date selector to change the post\'s date to the Post Setting dialog', 'lasso'); ?></span> |
|
240 | 240 | </div> |
241 | 241 | |
242 | 242 | <div class="lasso-editor-settings--option-inner" > |
243 | - <input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked( $post_new_disabled, 'on' );?> > |
|
244 | - <label for="lasso_editor[post_adding_disabled]"><?php _e( 'Disable Post Adding', 'lasso' );?></label> |
|
245 | - <span class="lasso--setting-description"><?php _e( 'Check this box to disable users from being able to add new posts from the front-end.', 'lasso' );?></span> |
|
243 | + <input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked($post_new_disabled, 'on'); ?> > |
|
244 | + <label for="lasso_editor[post_adding_disabled]"><?php _e('Disable Post Adding', 'lasso'); ?></label> |
|
245 | + <span class="lasso--setting-description"><?php _e('Check this box to disable users from being able to add new posts from the front-end.', 'lasso'); ?></span> |
|
246 | 246 | </div> |
247 | 247 | </div> |
248 | 248 | |
249 | - <h3><?php _e( 'Misc', 'lasso' );?></h3> |
|
249 | + <h3><?php _e('Misc', 'lasso'); ?></h3> |
|
250 | 250 | <div class="lasso-editor-settings--option-wrap"> |
251 | 251 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
252 | - <input type="checkbox" class="checkbox" name="lasso_editor[disable_tour]" id="lasso_editor[disable_tour]" <?php echo checked( $disable_tour, 'on' );?> > |
|
253 | - <label for="lasso_editor[disable_tour]"> <?php _e( 'Do Not Show Tour Dialog', 'lasso' );?></label> |
|
254 | - <span class="lasso--setting-description"><?php _e( 'Check this box to disable the tour dialog box for all users.', 'lasso' );?></span> |
|
252 | + <input type="checkbox" class="checkbox" name="lasso_editor[disable_tour]" id="lasso_editor[disable_tour]" <?php echo checked($disable_tour, 'on'); ?> > |
|
253 | + <label for="lasso_editor[disable_tour]"> <?php _e('Do Not Show Tour Dialog', 'lasso'); ?></label> |
|
254 | + <span class="lasso--setting-description"><?php _e('Check this box to disable the tour dialog box for all users.', 'lasso'); ?></span> |
|
255 | 255 | </div> |
256 | 256 | |
257 | 257 | <div class="lasso-editor-settings--option-inner" > |
258 | - <label for="lasso_editor[bold_tag]"> <?php _e( '"Bold" Tag', 'lasso' );?></label> |
|
259 | - <span class="lasso--setting-description"><?php _e( 'Choose the HTML tag used for the "Bold" style.', 'lasso' );?></span> |
|
260 | - <input type="radio" name="lasso_editor[bold_tag]" value='b' <?php echo checked( $bold_tag, 'b' );?>> b |
|
261 | - <input type="radio" name="lasso_editor[bold_tag]" value="strong" <?php echo checked( $bold_tag, 'strong' );?>> strong |
|
258 | + <label for="lasso_editor[bold_tag]"> <?php _e('"Bold" Tag', 'lasso'); ?></label> |
|
259 | + <span class="lasso--setting-description"><?php _e('Choose the HTML tag used for the "Bold" style.', 'lasso'); ?></span> |
|
260 | + <input type="radio" name="lasso_editor[bold_tag]" value='b' <?php echo checked($bold_tag, 'b'); ?>> b |
|
261 | + <input type="radio" name="lasso_editor[bold_tag]" value="strong" <?php echo checked($bold_tag, 'strong'); ?>> strong |
|
262 | 262 | </div> |
263 | 263 | <div class="lasso-editor-settings--option-inner" > |
264 | - <label for="lasso_editor[i_tag]"> <?php _e( '"Italic" Tag', 'lasso' );?></label> |
|
265 | - <span class="lasso--setting-description"><?php _e( 'Choose the HTML tag used for the "Italic" style.', 'lasso' );?></span> |
|
266 | - <input type="radio" name="lasso_editor[i_tag]" value='i' <?php echo checked( $i_tag, 'i' );?>> i |
|
267 | - <input type="radio" name="lasso_editor[i_tag]" value="em" <?php echo checked( $i_tag, 'em' );?>> em |
|
264 | + <label for="lasso_editor[i_tag]"> <?php _e('"Italic" Tag', 'lasso'); ?></label> |
|
265 | + <span class="lasso--setting-description"><?php _e('Choose the HTML tag used for the "Italic" style.', 'lasso'); ?></span> |
|
266 | + <input type="radio" name="lasso_editor[i_tag]" value='i' <?php echo checked($i_tag, 'i'); ?>> i |
|
267 | + <input type="radio" name="lasso_editor[i_tag]" value="em" <?php echo checked($i_tag, 'em'); ?>> em |
|
268 | 268 | </div> |
269 | 269 | </div> |
270 | 270 | |
271 | - <h3><?php _e( 'Advanced', 'lasso' );?></h3> |
|
271 | + <h3><?php _e('Advanced', 'lasso'); ?></h3> |
|
272 | 272 | <div class="lasso-editor-settings--option-wrap "> |
273 | 273 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
274 | - <input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked( $shortcodify_disabled, 'on' );?> > |
|
275 | - <label for="lasso_editor[shortcodify_disabled]"><?php _e( 'Disable Aesop Component Conversion', 'lasso' );?></label> |
|
276 | - <span class="lasso--setting-description"><?php _e( 'Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso' );?></span> |
|
274 | + <input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked($shortcodify_disabled, 'on'); ?> > |
|
275 | + <label for="lasso_editor[shortcodify_disabled]"><?php _e('Disable Aesop Component Conversion', 'lasso'); ?></label> |
|
276 | + <span class="lasso--setting-description"><?php _e('Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso'); ?></span> |
|
277 | 277 | </div> |
278 | 278 | |
279 | 279 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
280 | - <input type="checkbox" class="checkbox" name="lasso_editor[enable_autosave]" id="lasso_editor[enable_autosave]" <?php echo checked( $enable_autosave, 'on' );?> > |
|
281 | - <label for="lasso_editor[enable_autosave]"><?php _e( 'Enable Auto Save', 'lasso' );?></label> |
|
282 | - <span class="lasso--setting-description"><?php _e( 'Check this box to enable auto save.', 'lasso' );?></span> |
|
280 | + <input type="checkbox" class="checkbox" name="lasso_editor[enable_autosave]" id="lasso_editor[enable_autosave]" <?php echo checked($enable_autosave, 'on'); ?> > |
|
281 | + <label for="lasso_editor[enable_autosave]"><?php _e('Enable Auto Save', 'lasso'); ?></label> |
|
282 | + <span class="lasso--setting-description"><?php _e('Check this box to enable auto save.', 'lasso'); ?></span> |
|
283 | 283 | </div> |
284 | 284 | |
285 | 285 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
286 | - <input type="checkbox" class="checkbox" name="lasso_editor[post_save_disabled]" id="lasso_editor[post_save_disabled]" <?php echo checked( $save_to_post_disabled, 'on' );?> > |
|
287 | - <label for="lasso_editor[post_save_disabled]"><?php _e( 'Disable Post Saving', 'lasso' );?></label> |
|
288 | - <span class="lasso--setting-description"><?php _e( 'By default the editor will update the database with the post or page it is being used on. Check this box to disable this. If you check this box, it is assumed that you will be using the provided filters to save your own content.', 'lasso' );?></span> |
|
286 | + <input type="checkbox" class="checkbox" name="lasso_editor[post_save_disabled]" id="lasso_editor[post_save_disabled]" <?php echo checked($save_to_post_disabled, 'on'); ?> > |
|
287 | + <label for="lasso_editor[post_save_disabled]"><?php _e('Disable Post Saving', 'lasso'); ?></label> |
|
288 | + <span class="lasso--setting-description"><?php _e('By default the editor will update the database with the post or page it is being used on. Check this box to disable this. If you check this box, it is assumed that you will be using the provided filters to save your own content.', 'lasso'); ?></span> |
|
289 | 289 | |
290 | 290 | </div> |
291 | 291 | |
292 | 292 | <div class="lasso-editor-settings--option-inner"> |
293 | - <input type="checkbox" class="checkbox" name="lasso_editor[save_using_rest_disabled]" id="lasso_editor[save_using_rest_disabled]" <?php echo checked( $save_using_rest_disabled, 'on' );?> > |
|
294 | - <label for="lasso_editor[save_using_rest_disabled]"><?php _e( "Don't Use REST API to Save", 'lasso' );?></label> |
|
295 | - <span class="lasso--setting-description"><?php _e( 'By default the editor will use REST API to save posts. Check this box to use custom AJAX calls instead.', 'lasso' );?></span> |
|
293 | + <input type="checkbox" class="checkbox" name="lasso_editor[save_using_rest_disabled]" id="lasso_editor[save_using_rest_disabled]" <?php echo checked($save_using_rest_disabled, 'on'); ?> > |
|
294 | + <label for="lasso_editor[save_using_rest_disabled]"><?php _e("Don't Use REST API to Save", 'lasso'); ?></label> |
|
295 | + <span class="lasso--setting-description"><?php _e('By default the editor will use REST API to save posts. Check this box to use custom AJAX calls instead.', 'lasso'); ?></span> |
|
296 | 296 | |
297 | 297 | </div> |
298 | 298 | </div> |
@@ -302,11 +302,11 @@ discard block |
||
302 | 302 | |
303 | 303 | <div class="lasso-editor-settings--submit"> |
304 | 304 | <input type="hidden" name="action" value="lasso-editor-settings" /> |
305 | - <input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save Settings', 'lasso' );?>" /> |
|
306 | - <?php wp_nonce_field( 'nonce', 'lasso_editor_settings' ); ?> |
|
305 | + <input type="submit" class="button-primary" value="<?php esc_attr_e('Save Settings', 'lasso'); ?>" /> |
|
306 | + <?php wp_nonce_field('nonce', 'lasso_editor_settings'); ?> |
|
307 | 307 | </div> |
308 | 308 | |
309 | - <?php do_action('lasso_settings_after');?> |
|
309 | + <?php do_action('lasso_settings_after'); ?> |
|
310 | 310 | </form> |
311 | 311 | |
312 | 312 | </div><?php |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | add_filter('register_post_type_args', 'lasso_show_in_rest', 10, 2); |
49 | 49 | function lasso_show_in_rest($args, $post_type){ |
50 | 50 | |
51 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( ) ); |
|
51 | + $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( ) ); |
|
52 | 52 | $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
53 | 53 | if (in_array( $post_type,$allowed_post_types)) { |
54 | 54 | $args['show_in_rest'] = true; |
@@ -57,6 +57,6 @@ discard block |
||
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
60 | - return $args; |
|
60 | + return $args; |
|
61 | 61 | } |
62 | 62 |
@@ -61,6 +61,10 @@ |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | |
64 | +/** |
|
65 | + * @param string $option |
|
66 | + * @param string $section |
|
67 | + */ |
|
64 | 68 | function lasso_editor_get_option( $option, $section, $default = '' ) { |
65 | 69 | |
66 | 70 | if ( empty( $option ) ) |
@@ -63,8 +63,9 @@ |
||
63 | 63 | |
64 | 64 | function lasso_editor_get_option( $option, $section, $default = '' ) { |
65 | 65 | |
66 | - if ( empty( $option ) ) |
|
67 | - return; |
|
66 | + if ( empty( $option ) ) { |
|
67 | + return; |
|
68 | + } |
|
68 | 69 | |
69 | 70 | if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
70 | 71 |
@@ -18,27 +18,27 @@ discard block |
||
18 | 18 | */ |
19 | 19 | |
20 | 20 | // If this file is called directly, abort. |
21 | -if ( ! defined( 'WPINC' ) ) { |
|
21 | +if (!defined('WPINC')) { |
|
22 | 22 | die; |
23 | 23 | } |
24 | 24 | |
25 | 25 | // Set some constants |
26 | -define( 'LASSO_VERSION', '0.9.17.3' ); |
|
27 | -define( 'LASSO_DIR', plugin_dir_path( __FILE__ ) ); |
|
28 | -define( 'LASSO_URL', plugins_url( '', __FILE__ ) ); |
|
29 | -define( 'LASSO_FILE', __FILE__ ); |
|
26 | +define('LASSO_VERSION', '0.9.17.3'); |
|
27 | +define('LASSO_DIR', plugin_dir_path(__FILE__)); |
|
28 | +define('LASSO_URL', plugins_url('', __FILE__)); |
|
29 | +define('LASSO_FILE', __FILE__); |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * Load plugin if PHP version is 5.4 or later. |
33 | 33 | */ |
34 | -if ( version_compare( PHP_VERSION, '5.4.0', '>=' ) ) { |
|
34 | +if (version_compare(PHP_VERSION, '5.4.0', '>=')) { |
|
35 | 35 | |
36 | - include_once( LASSO_DIR . '/bootstrap.php' ); |
|
36 | + include_once(LASSO_DIR.'/bootstrap.php'); |
|
37 | 37 | |
38 | 38 | } else { |
39 | 39 | |
40 | 40 | add_action('admin_head', 'lasso_fail_notice'); |
41 | - function lasso_fail_notice(){ |
|
41 | + function lasso_fail_notice() { |
|
42 | 42 | |
43 | 43 | printf('<div class="error"><p>Lasso requires PHP 5.4 or higher.</p></div>'); |
44 | 44 | |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | add_filter('register_post_type_args', 'lasso_show_in_rest', 10, 2); |
49 | -function lasso_show_in_rest($args, $post_type){ |
|
49 | +function lasso_show_in_rest($args, $post_type) { |
|
50 | 50 | |
51 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( ) ); |
|
52 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
53 | - if (in_array( $post_type,$allowed_post_types)) { |
|
51 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array( )); |
|
52 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
53 | + if (in_array($post_type, $allowed_post_types)) { |
|
54 | 54 | $args['show_in_rest'] = true; |
55 | 55 | if ($post_type != 'post' && $post_type != 'page') { |
56 | 56 | $args['rest_base'] = $post_type; |
@@ -61,21 +61,21 @@ discard block |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | |
64 | -function lasso_editor_get_option( $option, $section, $default = '' ) { |
|
64 | +function lasso_editor_get_option($option, $section, $default = '') { |
|
65 | 65 | |
66 | - if ( empty( $option ) ) |
|
66 | + if (empty($option)) |
|
67 | 67 | return; |
68 | 68 | |
69 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
69 | + if (function_exists('is_multisite') && is_multisite()) { |
|
70 | 70 | |
71 | - $options = get_site_option( $section ); |
|
71 | + $options = get_site_option($section); |
|
72 | 72 | |
73 | 73 | } else { |
74 | 74 | |
75 | - $options = get_option( $section ); |
|
75 | + $options = get_option($section); |
|
76 | 76 | } |
77 | 77 | |
78 | - if ( isset( $options[$option] ) ) { |
|
78 | + if (isset($options[$option])) { |
|
79 | 79 | return $options[$option]; |
80 | 80 | } |
81 | 81 |
@@ -279,6 +279,9 @@ |
||
279 | 279 | endif; |
280 | 280 | |
281 | 281 | // helper function to retrieve one id for default option |
282 | +/** |
|
283 | + * @param string $type |
|
284 | + */ |
|
282 | 285 | function editus_get_one_id($type) |
283 | 286 | { |
284 | 287 | $args = array( 'posts_per_page' => 1, 'post_type' => $type ); |
@@ -16,80 +16,80 @@ discard block |
||
16 | 16 | |
17 | 17 | $array = array( |
18 | 18 | 'quote' => array( |
19 | - 'name' => __('Quote','lasso'), |
|
19 | + 'name' => __('Quote', 'lasso'), |
|
20 | 20 | 'content' => lasso_quote_component(), |
21 | 21 | ), |
22 | 22 | 'image' => array( |
23 | - 'name' => __('Image','lasso'), |
|
23 | + 'name' => __('Image', 'lasso'), |
|
24 | 24 | 'content' => lasso_image_component(), |
25 | 25 | ), |
26 | 26 | 'parallax' => array( |
27 | - 'name' => __('Parallax','lasso'), |
|
27 | + 'name' => __('Parallax', 'lasso'), |
|
28 | 28 | 'content' => lasso_parallax_component(), |
29 | 29 | ), |
30 | 30 | 'audio' => array( |
31 | - 'name' => __('Audio','lasso'), |
|
31 | + 'name' => __('Audio', 'lasso'), |
|
32 | 32 | 'content' => lasso_audio_component(), |
33 | 33 | ), |
34 | 34 | 'content' => array( |
35 | - 'name' => __('Content','lasso'), |
|
35 | + 'name' => __('Content', 'lasso'), |
|
36 | 36 | 'content' => lasso_content_component(), |
37 | 37 | ), |
38 | 38 | 'character' => array( |
39 | - 'name' => __('Character','lasso'), |
|
39 | + 'name' => __('Character', 'lasso'), |
|
40 | 40 | 'content' => lasso_character_component(), |
41 | 41 | ), |
42 | 42 | 'collection' => array( |
43 | - 'name' => __('Collection','lasso'), |
|
43 | + 'name' => __('Collection', 'lasso'), |
|
44 | 44 | 'content' => lasso_collections_component(), |
45 | 45 | ), |
46 | 46 | 'document' => array( |
47 | - 'name' => __('Document','lasso'), |
|
47 | + 'name' => __('Document', 'lasso'), |
|
48 | 48 | 'content' => lasso_document_component(), |
49 | 49 | ), |
50 | 50 | 'gallery' => array( |
51 | - 'name' => __('Gallery','lasso'), |
|
51 | + 'name' => __('Gallery', 'lasso'), |
|
52 | 52 | 'content' => lasso_gallery_component(), |
53 | 53 | ), |
54 | 54 | 'chapter' => array( |
55 | - 'name' => __('Chapter','lasso'), |
|
55 | + 'name' => __('Chapter', 'lasso'), |
|
56 | 56 | 'content' => lasso_heading_component(), |
57 | 57 | ), |
58 | 58 | 'map' => array( |
59 | - 'name' => __('Map','lasso'), |
|
59 | + 'name' => __('Map', 'lasso'), |
|
60 | 60 | 'content' => lasso_map_component(), |
61 | 61 | ), |
62 | 62 | 'timeline_stop' => array( |
63 | - 'name' => __('Timeline','lasso'), |
|
63 | + 'name' => __('Timeline', 'lasso'), |
|
64 | 64 | 'content' => lasso_timeline_component(), |
65 | 65 | ), |
66 | 66 | 'video' => array( |
67 | - 'name' => __('Video','lasso'), |
|
67 | + 'name' => __('Video', 'lasso'), |
|
68 | 68 | 'content' => lasso_video_component(), |
69 | 69 | ), |
70 | 70 | 'wpimg' => array( |
71 | - 'name' => __('WordPress Image','lasso'), |
|
71 | + 'name' => __('WordPress Image', 'lasso'), |
|
72 | 72 | 'content' => lasso_wp_image(), |
73 | 73 | ), |
74 | 74 | 'wpquote' => array( |
75 | - 'name' => __('WordPress Quote','lasso'), |
|
75 | + 'name' => __('WordPress Quote', 'lasso'), |
|
76 | 76 | 'content' => lasso_wp_quote(), |
77 | 77 | ), |
78 | 78 | 'gallery_pop' => array( |
79 | - 'name' => __('Gallery Pop','lasso'), |
|
79 | + 'name' => __('Gallery Pop', 'lasso'), |
|
80 | 80 | 'content' => lasso_gallery_pop_component(), |
81 | 81 | ), |
82 | 82 | 'events' => array( |
83 | - 'name' => __('Events','lasso'), |
|
83 | + 'name' => __('Events', 'lasso'), |
|
84 | 84 | 'content' => lasso_event_component(), |
85 | 85 | ), |
86 | 86 | 'wpvideo' => array( |
87 | - 'name' => __('WordPress Image','lasso'), |
|
87 | + 'name' => __('WordPress Image', 'lasso'), |
|
88 | 88 | 'content' => lasso_wp_video(), |
89 | 89 | ), |
90 | 90 | ); |
91 | 91 | |
92 | - return apply_filters( 'lasso_components', $array ); |
|
92 | + return apply_filters('lasso_components', $array); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | /** |
@@ -115,132 +115,132 @@ discard block |
||
115 | 115 | */ |
116 | 116 | |
117 | 117 | // 1 |
118 | -if ( !function_exists( 'lasso_quote_component' ) ): |
|
118 | +if (!function_exists('lasso_quote_component')): |
|
119 | 119 | function lasso_quote_component() { |
120 | 120 | |
121 | - return do_shortcode( '[aesop_quote quote="The Universe is made of stories, not of atoms."]' ); |
|
121 | + return do_shortcode('[aesop_quote quote="The Universe is made of stories, not of atoms."]'); |
|
122 | 122 | } |
123 | 123 | endif; |
124 | 124 | |
125 | 125 | // 2 |
126 | -if ( !function_exists( 'lasso_image_component' ) ): |
|
126 | +if (!function_exists('lasso_image_component')): |
|
127 | 127 | function lasso_image_component() { |
128 | 128 | |
129 | - return do_shortcode( '[aesop_image img="'.LASSO_URL.'/public/assets/img/empty-img.png" align="center" imgwidth="800px"]' ); |
|
129 | + return do_shortcode('[aesop_image img="'.LASSO_URL.'/public/assets/img/empty-img.png" align="center" imgwidth="800px"]'); |
|
130 | 130 | } |
131 | 131 | endif; |
132 | 132 | |
133 | 133 | // 3 |
134 | -if ( !function_exists( 'lasso_parallax_component' ) ): |
|
134 | +if (!function_exists('lasso_parallax_component')): |
|
135 | 135 | function lasso_parallax_component() { |
136 | 136 | |
137 | - return do_shortcode( '[aesop_parallax img="'.LASSO_URL.'/public/assets/img/empty-img.png"]' ); |
|
137 | + return do_shortcode('[aesop_parallax img="'.LASSO_URL.'/public/assets/img/empty-img.png"]'); |
|
138 | 138 | } |
139 | 139 | endif; |
140 | 140 | |
141 | 141 | // 4 |
142 | -if ( !function_exists( 'lasso_audio_component' ) ): |
|
142 | +if (!function_exists('lasso_audio_component')): |
|
143 | 143 | function lasso_audio_component() { |
144 | 144 | |
145 | - return do_shortcode( '[aesop_audio src="http://users.skynet.be/fa046054/home/P22/track06.mp3"]' ); |
|
145 | + return do_shortcode('[aesop_audio src="http://users.skynet.be/fa046054/home/P22/track06.mp3"]'); |
|
146 | 146 | |
147 | 147 | } |
148 | 148 | endif; |
149 | 149 | |
150 | 150 | // 5 |
151 | -if ( !function_exists( 'lasso_content_component' ) ): |
|
151 | +if (!function_exists('lasso_content_component')): |
|
152 | 152 | function lasso_content_component() { |
153 | 153 | |
154 | - return do_shortcode( '[aesop_content]Start typing here...[/aesop_content]' ); |
|
154 | + return do_shortcode('[aesop_content]Start typing here...[/aesop_content]'); |
|
155 | 155 | } |
156 | 156 | endif; |
157 | 157 | |
158 | 158 | // 6 |
159 | -if ( !function_exists( 'lasso_character_component' ) ): |
|
159 | +if (!function_exists('lasso_character_component')): |
|
160 | 160 | function lasso_character_component() { |
161 | 161 | |
162 | - return do_shortcode( '[aesop_character img="'.LASSO_URL.'/public/assets/img/empty-img.png" name="Joes Apartment" width="150px"]' ); |
|
162 | + return do_shortcode('[aesop_character img="'.LASSO_URL.'/public/assets/img/empty-img.png" name="Joes Apartment" width="150px"]'); |
|
163 | 163 | |
164 | 164 | } |
165 | 165 | endif; |
166 | 166 | |
167 | 167 | // 7 |
168 | -if ( !function_exists( 'lasso_collections_component' ) ): |
|
168 | +if (!function_exists('lasso_collections_component')): |
|
169 | 169 | function lasso_collections_component() { |
170 | 170 | |
171 | - return do_shortcode( '[aesop_collection]' ); |
|
171 | + return do_shortcode('[aesop_collection]'); |
|
172 | 172 | } |
173 | 173 | endif; |
174 | 174 | |
175 | 175 | // 8 |
176 | -if ( !function_exists( 'lasso_document_component' ) ): |
|
176 | +if (!function_exists('lasso_document_component')): |
|
177 | 177 | function lasso_document_component() { |
178 | 178 | |
179 | - return do_shortcode( '[aesop_document src="'.LASSO_URL.'/public/assets/img/empty-img.png" ]' ); |
|
179 | + return do_shortcode('[aesop_document src="'.LASSO_URL.'/public/assets/img/empty-img.png" ]'); |
|
180 | 180 | |
181 | 181 | } |
182 | 182 | endif; |
183 | 183 | |
184 | 184 | // 9 |
185 | -if ( !function_exists( 'lasso_gallery_component' ) ): |
|
185 | +if (!function_exists('lasso_gallery_component')): |
|
186 | 186 | function lasso_gallery_component() { |
187 | 187 | |
188 | - return do_shortcode( '[aesop_gallery]' ); |
|
188 | + return do_shortcode('[aesop_gallery]'); |
|
189 | 189 | |
190 | 190 | } |
191 | 191 | endif; |
192 | 192 | |
193 | 193 | // 10 |
194 | -if ( !function_exists( 'lasso_heading_component' ) ): |
|
194 | +if (!function_exists('lasso_heading_component')): |
|
195 | 195 | function lasso_heading_component() { |
196 | 196 | |
197 | - return do_shortcode( '[aesop_chapter title="Chapter One" img="'.LASSO_URL.'/public/assets/img/empty-img.png" full="on"]' ); |
|
197 | + return do_shortcode('[aesop_chapter title="Chapter One" img="'.LASSO_URL.'/public/assets/img/empty-img.png" full="on"]'); |
|
198 | 198 | } |
199 | 199 | endif; |
200 | 200 | |
201 | 201 | // 11 |
202 | -if ( !function_exists( 'lasso_map_component' ) ): |
|
202 | +if (!function_exists('lasso_map_component')): |
|
203 | 203 | function lasso_map_component() { |
204 | 204 | |
205 | 205 | return '<form id="lasso--map-form" class="aesop-component aesop-map-component lasso--map-drag-holder" enctype="multipart/form-data"> |
206 | 206 | '.lasso_map_form_footer().' |
207 | - '.do_shortcode( '[aesop_map sticky="off"]' ).' |
|
207 | + '.do_shortcode('[aesop_map sticky="off"]').' |
|
208 | 208 | </form>'; |
209 | 209 | |
210 | 210 | } |
211 | 211 | endif; |
212 | 212 | |
213 | 213 | // 12 |
214 | -if ( !function_exists( 'lasso_timeline_component' ) ): |
|
214 | +if (!function_exists('lasso_timeline_component')): |
|
215 | 215 | function lasso_timeline_component() { |
216 | 216 | |
217 | - return do_shortcode( '[aesop_timeline_stop num="Title" title="2014"]' ); |
|
217 | + return do_shortcode('[aesop_timeline_stop num="Title" title="2014"]'); |
|
218 | 218 | |
219 | 219 | } |
220 | 220 | endif; |
221 | 221 | |
222 | 222 | // 13 |
223 | -if ( !function_exists( 'lasso_video_component' ) ): |
|
223 | +if (!function_exists('lasso_video_component')): |
|
224 | 224 | function lasso_video_component() { |
225 | 225 | |
226 | - return do_shortcode( '[aesop_video src="vimeo" id="59940289" width="100%" align="center"]' ); |
|
226 | + return do_shortcode('[aesop_video src="vimeo" id="59940289" width="100%" align="center"]'); |
|
227 | 227 | |
228 | 228 | } |
229 | 229 | endif; |
230 | 230 | |
231 | 231 | // 14 - since 0.9.1 |
232 | -if ( !function_exists('lasso_wp_image') ): |
|
232 | +if (!function_exists('lasso_wp_image')): |
|
233 | 233 | |
234 | - function lasso_wp_image(){ |
|
234 | + function lasso_wp_image() { |
|
235 | 235 | return '<div data-component-type="wpimg" class="lasso--wpimg__wrap lasso-component"><img class="wp-image-0" src="'.LASSO_URL.'/public/assets/img/empty-img.png"></div>'; |
236 | 236 | } |
237 | 237 | |
238 | 238 | endif; |
239 | 239 | |
240 | 240 | // 15 - since 0.9.2 |
241 | -if ( !function_exists('lasso_wp_quote') ): |
|
241 | +if (!function_exists('lasso_wp_quote')): |
|
242 | 242 | |
243 | - function lasso_wp_quote(){ |
|
243 | + function lasso_wp_quote() { |
|
244 | 244 | return '<blockquote data-component-type="wpquote" class="lasso--wpquote lasso-component"><p>The universe is made of stories.</p></blockquote>'; |
245 | 245 | } |
246 | 246 | |
@@ -248,15 +248,15 @@ discard block |
||
248 | 248 | |
249 | 249 | // 16 gallery pop added but not fully supported as of 0.9.9.11 |
250 | 250 | |
251 | -if ( !function_exists( 'lasso_gallery_pop_component' ) ): |
|
251 | +if (!function_exists('lasso_gallery_pop_component')): |
|
252 | 252 | function lasso_gallery_pop_component() { |
253 | - return do_shortcode( '[aesop_gallery_pop]' ); |
|
253 | + return do_shortcode('[aesop_gallery_pop]'); |
|
254 | 254 | } |
255 | 255 | endif; |
256 | 256 | |
257 | 257 | // 17 - work in progress |
258 | 258 | |
259 | -if ( !function_exists( 'lasso_event_component' ) ): |
|
259 | +if (!function_exists('lasso_event_component')): |
|
260 | 260 | function lasso_event_component() { |
261 | 261 | $id = editus_get_one_id('aesop_events'); |
262 | 262 | return '<div data-component-type="events" class="aesop-component lasso-component"><p>Aesop Event: After setting the event, save and reload the page.</p></div>'; |
@@ -264,9 +264,9 @@ discard block |
||
264 | 264 | endif; |
265 | 265 | |
266 | 266 | // 18 - work in progress |
267 | -if ( !function_exists('lasso_wp_video') ): |
|
267 | +if (!function_exists('lasso_wp_video')): |
|
268 | 268 | |
269 | - function lasso_wp_video(){ |
|
269 | + function lasso_wp_video() { |
|
270 | 270 | return '<div data-component-type="wpvideo" class="lasso--wpvideo__wrap lasso-component"><video class="wp-video-0"></video>'; |
271 | 271 | } |
272 | 272 | |
@@ -275,10 +275,10 @@ discard block |
||
275 | 275 | // helper function to retrieve one id for default option |
276 | 276 | function editus_get_one_id($type) |
277 | 277 | { |
278 | - $args = array( 'posts_per_page' => 1, 'post_type' => $type ); |
|
279 | - $posts = get_posts( $args ); |
|
280 | - if ( $posts ) { |
|
281 | - foreach ( $posts as $post ) { |
|
278 | + $args = array('posts_per_page' => 1, 'post_type' => $type); |
|
279 | + $posts = get_posts($args); |
|
280 | + if ($posts) { |
|
281 | + foreach ($posts as $post) { |
|
282 | 282 | return $post->ID; |
283 | 283 | } |
284 | 284 | } |
@@ -109,8 +109,9 @@ discard block |
||
109 | 109 | |
110 | 110 | ob_start(); |
111 | 111 | |
112 | - if ( !lasso_user_can() ) |
|
113 | - return; |
|
112 | + if ( !lasso_user_can() ) { |
|
113 | + return; |
|
114 | + } |
|
114 | 115 | |
115 | 116 | // let users add custom css classes |
116 | 117 | $custom_classes = apply_filters( 'lasso_sidebar_classes', '' ); |
@@ -133,8 +134,9 @@ discard block |
||
133 | 134 | |
134 | 135 | ob_start(); |
135 | 136 | |
136 | - if ( !lasso_user_can() ) |
|
137 | - return; |
|
137 | + if ( !lasso_user_can() ) { |
|
138 | + return; |
|
139 | + } |
|
138 | 140 | |
139 | 141 | $is_mobile = wp_is_mobile(); |
140 | 142 | |
@@ -208,8 +210,11 @@ discard block |
||
208 | 210 | <?php if ( class_exists ('Aesop_Events') ) { ?> |
209 | 211 | <li data-type="events" title="<?php esc_attr_e( 'Event', 'lasso' );?>" class="lasso-toolbar--component__event"></li> |
210 | 212 | <?php }?> |
211 | - <?php else: ?> |
|
212 | - <li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li> |
|
213 | + <?php else { |
|
214 | + : ?> |
|
215 | + <li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' ); |
|
216 | +} |
|
217 | +?>" class="image lasso-toolbar--component__image"></li> |
|
213 | 218 | <li data-type="wpquote" title="<?php esc_attr_e( 'WordPress Quote', 'lasso' );?>" class="quote lasso-toolbar--component__quote"></li> |
214 | 219 | <!--li data-type="wpvideo" title="<?php esc_attr_e( 'WordPress Video', 'lasso' );?>" class="video lasso-toolbar--component__video"></li--> |
215 | 220 | <?php endif; ?> |
@@ -277,8 +282,9 @@ discard block |
||
277 | 282 | |
278 | 283 | ob_start(); |
279 | 284 | |
280 | - if ( !lasso_user_can() ) |
|
281 | - return; |
|
285 | + if ( !lasso_user_can() ) { |
|
286 | + return; |
|
287 | + } |
|
282 | 288 | |
283 | 289 | // let users add custom css classes |
284 | 290 | $custom_classes = apply_filters( 'lasso_component_classes', '' ); |
@@ -304,8 +310,9 @@ discard block |
||
304 | 310 | |
305 | 311 | ob_start(); |
306 | 312 | |
307 | - if ( !lasso_user_can() ) |
|
308 | - return; |
|
313 | + if ( !lasso_user_can() ) { |
|
314 | + return; |
|
315 | + } |
|
309 | 316 | |
310 | 317 | // has post thumbnail |
311 | 318 | $has_thumbnail = has_post_thumbnail( get_the_ID() ) ? 'class="lasso--featImg--has-thumb"' : false; |
@@ -333,8 +340,9 @@ discard block |
||
333 | 340 | |
334 | 341 | ob_start(); |
335 | 342 | |
336 | - if ( !lasso_user_can() ) |
|
337 | - return; |
|
343 | + if ( !lasso_user_can() ) { |
|
344 | + return; |
|
345 | + } |
|
338 | 346 | |
339 | 347 | global $post; |
340 | 348 | |
@@ -480,8 +488,9 @@ discard block |
||
480 | 488 | |
481 | 489 | ob_start(); |
482 | 490 | |
483 | - if ( !lasso_user_can('edit_posts') ) |
|
484 | - return; |
|
491 | + if ( !lasso_user_can('edit_posts') ) { |
|
492 | + return; |
|
493 | + } |
|
485 | 494 | |
486 | 495 | $status = get_post_status( get_the_ID() ); |
487 | 496 | |
@@ -613,8 +622,9 @@ discard block |
||
613 | 622 | |
614 | 623 | ob_start(); |
615 | 624 | |
616 | - if ( !lasso_user_can() ) |
|
617 | - return; |
|
625 | + if ( !lasso_user_can() ) { |
|
626 | + return; |
|
627 | + } |
|
618 | 628 | |
619 | 629 | // let users add custom css classes |
620 | 630 | $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
@@ -634,8 +644,9 @@ discard block |
||
634 | 644 | |
635 | 645 | ob_start(); |
636 | 646 | |
637 | - if ( !lasso_user_can() ) |
|
638 | - return; |
|
647 | + if ( !lasso_user_can() ) { |
|
648 | + return; |
|
649 | + } |
|
639 | 650 | |
640 | 651 | // let users add custom css classes |
641 | 652 | $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
@@ -706,8 +717,9 @@ discard block |
||
706 | 717 | |
707 | 718 | $blob = array(); |
708 | 719 | |
709 | - if ( empty( $codes ) ) |
|
710 | - return; |
|
720 | + if ( empty( $codes ) ) { |
|
721 | + return; |
|
722 | + } |
|
711 | 723 | |
712 | 724 | foreach ( $codes as $slug => $shortcode ) { |
713 | 725 | $return = ''; |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
152 | 152 | |
153 | 153 | // mobile styles |
154 | - $mobile_class = $is_mobile ? 'lasso-mobile' : false; |
|
154 | + $mobile_class = $is_mobile ? 'lasso-mobile' : false; |
|
155 | 155 | $mobile_style =$is_mobile ? 'style="bottom:0px;"' : null; |
156 | 156 | |
157 | 157 | //show color |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | </div> |
431 | 431 | <?php |
432 | 432 | if ($allow_change_date) { |
433 | - $dateformat = get_option( 'date_format' ); |
|
433 | + $dateformat = get_option( 'date_format' ); |
|
434 | 434 | ?> |
435 | 435 | <label><?php _e( 'Post Date', 'lasso' ); ?></label> |
436 | 436 | <input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/> |
@@ -567,8 +567,8 @@ discard block |
||
567 | 567 | global $post; |
568 | 568 | |
569 | 569 | global $wp_post_types; |
570 | - $labels = &$wp_post_types['post']->labels; |
|
571 | - $labels->name = 'Articles'; |
|
570 | + $labels = &$wp_post_types['post']->labels; |
|
571 | + $labels->name = 'Articles'; |
|
572 | 572 | |
573 | 573 | ob_start(); |
574 | 574 |
@@ -12,32 +12,32 @@ discard block |
||
12 | 12 | * |
13 | 13 | * @since 1.0 |
14 | 14 | */ |
15 | -add_action( 'wp_footer', 'lasso_editor_controls' ); |
|
15 | +add_action('wp_footer', 'lasso_editor_controls'); |
|
16 | 16 | function lasso_editor_controls() { |
17 | 17 | |
18 | 18 | global $post; |
19 | 19 | |
20 | - if ( lasso_user_can('edit_posts') ) { |
|
20 | + if (lasso_user_can('edit_posts')) { |
|
21 | 21 | |
22 | - $status = get_post_status( get_the_ID() ); |
|
22 | + $status = get_post_status(get_the_ID()); |
|
23 | 23 | |
24 | 24 | // let users add custom css classes |
25 | - $custom_classes = apply_filters( 'lasso_control_classes', '' ); |
|
25 | + $custom_classes = apply_filters('lasso_control_classes', ''); |
|
26 | 26 | |
27 | 27 | $post_access_class = ''; |
28 | - $post_new_disabled = lasso_editor_get_option( 'post_adding_disabled', 'lasso_editor' ); |
|
29 | - $post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' ); |
|
30 | - $shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' ); |
|
28 | + $post_new_disabled = lasso_editor_get_option('post_adding_disabled', 'lasso_editor'); |
|
29 | + $post_settings_disabled = lasso_editor_get_option('post_settings_disabled', 'lasso_editor'); |
|
30 | + $shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor'); |
|
31 | 31 | |
32 | 32 | |
33 | 33 | // CSS class if adding new post objects is disabled |
34 | - if ( 'on' == $post_new_disabled ) { $post_access_class = 'lasso--post-new-disabled'; } |
|
34 | + if ('on' == $post_new_disabled) { $post_access_class = 'lasso--post-new-disabled'; } |
|
35 | 35 | |
36 | 36 | // CSS class if adjust settings is disabled |
37 | - if ( 'on' == $post_settings_disabled ) { $post_access_class = 'lasso--post-settings-disabled'; } |
|
37 | + if ('on' == $post_settings_disabled) { $post_access_class = 'lasso--post-settings-disabled'; } |
|
38 | 38 | |
39 | 39 | // CSS class if adding new post objects AND settings are disabled |
40 | - if ( 'on' == $post_new_disabled && 'on' == $post_settings_disabled ) { $post_access_class = 'lasso--post-all-disabled'; } |
|
40 | + if ('on' == $post_new_disabled && 'on' == $post_settings_disabled) { $post_access_class = 'lasso--post-all-disabled'; } |
|
41 | 41 | |
42 | 42 | // CSS class if shortcodify or (Aesop Shortcode Conversion) is disabled |
43 | 43 | $sc_saving_class = 'on' == $shortcodify_disabled ? 'shortcodify-disabled' : 'shortcodify-enabled'; |
@@ -49,44 +49,44 @@ discard block |
||
49 | 49 | $mobile_style = $is_mobile ? 'style="bottom:0px;"' : null; |
50 | 50 | |
51 | 51 | |
52 | - ?><div id="lasso--controls" class="lasso-post-status--<?php echo sanitize_html_class( $status );?> <?php echo sanitize_html_class( $custom_classes );?>" data-post-id="<?php echo get_the_ID();?>" > |
|
52 | + ?><div id="lasso--controls" class="lasso-post-status--<?php echo sanitize_html_class($status); ?> <?php echo sanitize_html_class($custom_classes); ?>" data-post-id="<?php echo get_the_ID(); ?>" > |
|
53 | 53 | |
54 | - <ul class="lasso--controls__center lasso-editor-controls lasso-editor-controls--wrap <?php echo $post_access_class;?> " <?php echo $mobile_style ?> > |
|
54 | + <ul class="lasso--controls__center lasso-editor-controls lasso-editor-controls--wrap <?php echo $post_access_class; ?> " <?php echo $mobile_style ?> > |
|
55 | 55 | |
56 | - <?php do_action( 'lasso_editor_controls_before' ); |
|
56 | + <?php do_action('lasso_editor_controls_before'); |
|
57 | 57 | |
58 | - if ( $is_capable ) { ?> |
|
58 | + if ($is_capable) { ?> |
|
59 | 59 | |
60 | - <li id="lasso--edit" title="<?php esc_attr_e( 'Edit Post', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
60 | + <li id="lasso--edit" title="<?php esc_attr_e('Edit Post', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
61 | 61 | |
62 | - <?php if ( 'off' == $post_settings_disabled || empty( $post_settings_disabled ) ) { ?> |
|
63 | - <li id="lasso--post-settings" title="<?php esc_attr_e( 'Post Settings', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
62 | + <?php if ('off' == $post_settings_disabled || empty($post_settings_disabled)) { ?> |
|
63 | + <li id="lasso--post-settings" title="<?php esc_attr_e('Post Settings', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
64 | 64 | <?php } |
65 | 65 | |
66 | 66 | } ?> |
67 | 67 | |
68 | - <li id="lasso--post-all" title="<?php esc_attr_e( 'All Posts', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
68 | + <li id="lasso--post-all" title="<?php esc_attr_e('All Posts', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
69 | 69 | |
70 | - <?php if ( $is_capable && wp_revisions_enabled( $post ) ) { ?> |
|
71 | - <li id="lasso--post-revisions" title="<?php esc_attr_e( 'Revisions', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
70 | + <?php if ($is_capable && wp_revisions_enabled($post)) { ?> |
|
71 | + <li id="lasso--post-revisions" title="<?php esc_attr_e('Revisions', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
72 | 72 | <?php } ?> |
73 | 73 | |
74 | - <?php if ( ( 'off' == $post_new_disabled || empty( $post_new_disabled ) && lasso_user_can('publish_posts') ) ) { ?> |
|
75 | - <li id="lasso--post-new" title="<?php esc_attr_e( 'Add Post', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
74 | + <?php if (('off' == $post_new_disabled || empty($post_new_disabled) && lasso_user_can('publish_posts'))) { ?> |
|
75 | + <li id="lasso--post-new" title="<?php esc_attr_e('Add Post', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
76 | 76 | <?php } ?> |
77 | 77 | |
78 | - <?php do_action( 'lasso_editor_controls_after' );?> |
|
78 | + <?php do_action('lasso_editor_controls_after'); ?> |
|
79 | 79 | |
80 | 80 | </ul> |
81 | 81 | |
82 | - <?php if ( is_singular() && !$is_mobile ) { ?> |
|
82 | + <?php if (is_singular() && !$is_mobile) { ?> |
|
83 | 83 | |
84 | - <div class="lasso--controls__right" data-posttype="<?php echo get_post_type( get_the_ID() );?>" data-status="<?php echo $status;?>"> |
|
84 | + <div class="lasso--controls__right" data-posttype="<?php echo get_post_type(get_the_ID()); ?>" data-status="<?php echo $status; ?>"> |
|
85 | 85 | |
86 | - <a href="#" title="<?php esc_attr_e( 'Save Post', 'lasso' );?>" id="lasso--save" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
86 | + <a href="#" title="<?php esc_attr_e('Save Post', 'lasso'); ?>" id="lasso--save" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
87 | 87 | |
88 | - <?php if ( 'draft' == $status && ( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ) ) { ?> |
|
89 | - <a href="#" title="<?php esc_attr_e( 'Publish Post', 'lasso' );?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
88 | + <?php if ('draft' == $status && (lasso_user_can('publish_posts') || lasso_user_can('publish_pages'))) { ?> |
|
89 | + <a href="#" title="<?php esc_attr_e('Publish Post', 'lasso'); ?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
90 | 90 | <?php } ?> |
91 | 91 | |
92 | 92 | </div> |
@@ -109,13 +109,13 @@ discard block |
||
109 | 109 | |
110 | 110 | ob_start(); |
111 | 111 | |
112 | - if ( !lasso_user_can() ) |
|
112 | + if (!lasso_user_can()) |
|
113 | 113 | return; |
114 | 114 | |
115 | 115 | // let users add custom css classes |
116 | - $custom_classes = apply_filters( 'lasso_sidebar_classes', '' ); |
|
116 | + $custom_classes = apply_filters('lasso_sidebar_classes', ''); |
|
117 | 117 | ?> |
118 | - <div id="lasso--sidebar" class="<?php echo sanitize_html_class( $custom_classes );?>" > |
|
118 | + <div id="lasso--sidebar" class="<?php echo sanitize_html_class($custom_classes); ?>" > |
|
119 | 119 | <div class="lasso--sidebar__inner"> |
120 | 120 | <div id="lasso--component__settings"></div> |
121 | 121 | </div> |
@@ -133,26 +133,26 @@ discard block |
||
133 | 133 | |
134 | 134 | ob_start(); |
135 | 135 | |
136 | - if ( !lasso_user_can() ) |
|
136 | + if (!lasso_user_can()) |
|
137 | 137 | return; |
138 | 138 | |
139 | 139 | $is_mobile = wp_is_mobile(); |
140 | 140 | |
141 | 141 | // check for lasso story engine and add a class doniting this |
142 | - $ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active'; |
|
142 | + $ase_status = class_exists('Aesop_Core') || defined('LASSO_CUSTOM') ? 'ase-active' : 'ase-not-active'; |
|
143 | 143 | |
144 | 144 | // let users add custom css classes |
145 | - $custom_classes = apply_filters( 'lasso_toolbar_classes', '' ); |
|
145 | + $custom_classes = apply_filters('lasso_toolbar_classes', ''); |
|
146 | 146 | |
147 | 147 | // are toolbar headings enabled |
148 | - $toolbar_headings = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' ); |
|
149 | - $toolbar_headings_h4 = lasso_editor_get_option( 'toolbar_headings_h4', 'lasso_editor' ); |
|
148 | + $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
149 | + $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
150 | 150 | |
151 | - $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
|
151 | + $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
|
152 | 152 | |
153 | 153 | // mobile styles |
154 | 154 | $mobile_class = $is_mobile ? 'lasso-mobile' : false; |
155 | - $mobile_style =$is_mobile ? 'style="bottom:0px;"' : null; |
|
155 | + $mobile_style = $is_mobile ? 'style="bottom:0px;"' : null; |
|
156 | 156 | |
157 | 157 | //show color |
158 | 158 | $show_color = lasso_editor_get_option('toolbar_show_color', 'lasso_editor'); |
@@ -160,108 +160,108 @@ discard block |
||
160 | 160 | //show alignment |
161 | 161 | $show_align = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor'); |
162 | 162 | |
163 | - $status = get_post_status( get_the_ID() ); |
|
163 | + $status = get_post_status(get_the_ID()); |
|
164 | 164 | |
165 | 165 | |
166 | 166 | ?> |
167 | - <div class="lasso--toolbar_wrap lasso-editor-controls--wrap <?php echo $toolbar_class.' '.$mobile_class.' '.$ase_status.' '.sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style ?>> |
|
168 | - <ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"';}?>> |
|
169 | - <?php do_action( 'lasso_toolbar_components_before' );?> |
|
170 | - <li id="lasso-toolbar--bold" title="<?php esc_attr_e( 'Bold', 'lasso' );?>"></li> |
|
171 | - <li id="lasso-toolbar--underline" title="<?php esc_attr_e( 'Underline', 'lasso' );?>"></li> |
|
172 | - <li id="lasso-toolbar--italic" title="<?php esc_attr_e( 'Italicize', 'lasso' );?>"></li> |
|
173 | - <li id="lasso-toolbar--strike" title="<?php esc_attr_e( 'Strikethrough', 'lasso' );?>"></li> |
|
174 | - <li id="lasso-toolbar--components" title="<?php esc_attr_e( 'Insert Component', 'lasso' );?>" style="color:#ffffa0;"> |
|
167 | + <div class="lasso--toolbar_wrap lasso-editor-controls--wrap <?php echo $toolbar_class.' '.$mobile_class.' '.$ase_status.' '.sanitize_html_class($custom_classes); ?>" <?php echo $mobile_style ?>> |
|
168 | + <ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"'; }?>> |
|
169 | + <?php do_action('lasso_toolbar_components_before'); ?> |
|
170 | + <li id="lasso-toolbar--bold" title="<?php esc_attr_e('Bold', 'lasso'); ?>"></li> |
|
171 | + <li id="lasso-toolbar--underline" title="<?php esc_attr_e('Underline', 'lasso'); ?>"></li> |
|
172 | + <li id="lasso-toolbar--italic" title="<?php esc_attr_e('Italicize', 'lasso'); ?>"></li> |
|
173 | + <li id="lasso-toolbar--strike" title="<?php esc_attr_e('Strikethrough', 'lasso'); ?>"></li> |
|
174 | + <li id="lasso-toolbar--components" title="<?php esc_attr_e('Insert Component', 'lasso'); ?>" style="color:#ffffa0;"> |
|
175 | 175 | <ul id="lasso-toolbar--components__list" style="display:none;color:white;"> |
176 | - <?php if ( 'ase-active' == $ase_status ): ?> |
|
177 | - <li data-type="image" title="<?php esc_attr_e( 'Image', 'lasso' );?>" class="lasso-toolbar--component__image"></li> |
|
178 | - <li data-type="character" title="<?php esc_attr_e( 'Character', 'lasso' );?>" class="lasso-toolbar--component__character"></li> |
|
179 | - <li data-type="quote" title="<?php esc_attr_e( 'Quote', 'lasso' );?>" class="lasso-toolbar--component__quote"></li> |
|
180 | - <li data-type="content" title="<?php esc_attr_e( 'Content', 'lasso' );?>" class="lasso-toolbar--component__content"></li> |
|
181 | - <li data-type="chapter" title="<?php esc_attr_e( 'Chapter', 'lasso' );?>" class="lasso-toolbar--component__chapter"></li> |
|
182 | - <li data-type="parallax" title="<?php esc_attr_e( 'Parallax', 'lasso' );?>" class="lasso-toolbar--component__parallax"></li> |
|
183 | - <li data-type="audio" title="<?php esc_attr_e( 'Audio', 'lasso' );?>" class="lasso-toolbar--component__audio"></li> |
|
184 | - <li data-type="video" title="<?php esc_attr_e( 'Video', 'lasso' );?>" class="lasso-toolbar--component__video"></li> |
|
185 | - <li data-type="map" title="<?php esc_attr_e( 'Map', 'lasso' );?>" class="lasso-toolbar--component__map"></li> |
|
186 | - <li data-type="timeline_stop" title="<?php esc_attr_e( 'Timeline', 'lasso' );?>" class="lasso-toolbar--component__timeline"></li> |
|
187 | - <li data-type="document" title="<?php esc_attr_e( 'Document', 'lasso' );?>" class="lasso-toolbar--component__document"></li> |
|
188 | - <li data-type="collection" title="<?php esc_attr_e( 'Collection', 'lasso' );?>" class="lasso-toolbar--component__collection"></li> |
|
189 | - <li data-type="gallery" title="<?php esc_attr_e( 'Gallery', 'lasso' );?>" class="lasso-toolbar--component__gallery"></li> |
|
190 | - <?php if ( class_exists ('Aesop_GalleryPop') ) { ?> |
|
191 | - <li data-type="gallery" title="<?php esc_attr_e( 'Gallery Pop', 'lasso' );?>" class="lasso-toolbar--component__gallerypop"></li> |
|
176 | + <?php if ('ase-active' == $ase_status): ?> |
|
177 | + <li data-type="image" title="<?php esc_attr_e('Image', 'lasso'); ?>" class="lasso-toolbar--component__image"></li> |
|
178 | + <li data-type="character" title="<?php esc_attr_e('Character', 'lasso'); ?>" class="lasso-toolbar--component__character"></li> |
|
179 | + <li data-type="quote" title="<?php esc_attr_e('Quote', 'lasso'); ?>" class="lasso-toolbar--component__quote"></li> |
|
180 | + <li data-type="content" title="<?php esc_attr_e('Content', 'lasso'); ?>" class="lasso-toolbar--component__content"></li> |
|
181 | + <li data-type="chapter" title="<?php esc_attr_e('Chapter', 'lasso'); ?>" class="lasso-toolbar--component__chapter"></li> |
|
182 | + <li data-type="parallax" title="<?php esc_attr_e('Parallax', 'lasso'); ?>" class="lasso-toolbar--component__parallax"></li> |
|
183 | + <li data-type="audio" title="<?php esc_attr_e('Audio', 'lasso'); ?>" class="lasso-toolbar--component__audio"></li> |
|
184 | + <li data-type="video" title="<?php esc_attr_e('Video', 'lasso'); ?>" class="lasso-toolbar--component__video"></li> |
|
185 | + <li data-type="map" title="<?php esc_attr_e('Map', 'lasso'); ?>" class="lasso-toolbar--component__map"></li> |
|
186 | + <li data-type="timeline_stop" title="<?php esc_attr_e('Timeline', 'lasso'); ?>" class="lasso-toolbar--component__timeline"></li> |
|
187 | + <li data-type="document" title="<?php esc_attr_e('Document', 'lasso'); ?>" class="lasso-toolbar--component__document"></li> |
|
188 | + <li data-type="collection" title="<?php esc_attr_e('Collection', 'lasso'); ?>" class="lasso-toolbar--component__collection"></li> |
|
189 | + <li data-type="gallery" title="<?php esc_attr_e('Gallery', 'lasso'); ?>" class="lasso-toolbar--component__gallery"></li> |
|
190 | + <?php if (class_exists('Aesop_GalleryPop')) { ?> |
|
191 | + <li data-type="gallery" title="<?php esc_attr_e('Gallery Pop', 'lasso'); ?>" class="lasso-toolbar--component__gallerypop"></li> |
|
192 | 192 | <?php }?> |
193 | - <?php if ( class_exists ('Aesop_Events') ) { ?> |
|
194 | - <li data-type="events" title="<?php esc_attr_e( 'Event', 'lasso' );?>" class="lasso-toolbar--component__event"></li> |
|
193 | + <?php if (class_exists('Aesop_Events')) { ?> |
|
194 | + <li data-type="events" title="<?php esc_attr_e('Event', 'lasso'); ?>" class="lasso-toolbar--component__event"></li> |
|
195 | 195 | <?php }?> |
196 | 196 | <?php else: ?> |
197 | - <li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li> |
|
198 | - <li data-type="wpquote" title="<?php esc_attr_e( 'WordPress Quote', 'lasso' );?>" class="quote lasso-toolbar--component__quote"></li> |
|
199 | - <!--li data-type="wpvideo" title="<?php esc_attr_e( 'WordPress Video', 'lasso' );?>" class="video lasso-toolbar--component__video"></li--> |
|
197 | + <li data-type="wpimg" title="<?php esc_attr_e('WordPress Image', 'lasso'); ?>" class="image lasso-toolbar--component__image"></li> |
|
198 | + <li data-type="wpquote" title="<?php esc_attr_e('WordPress Quote', 'lasso'); ?>" class="quote lasso-toolbar--component__quote"></li> |
|
199 | + <!--li data-type="wpvideo" title="<?php esc_attr_e('WordPress Video', 'lasso'); ?>" class="video lasso-toolbar--component__video"></li--> |
|
200 | 200 | <?php endif; ?> |
201 | - <?php do_action( 'lasso_toolbar_components' );?> |
|
201 | + <?php do_action('lasso_toolbar_components'); ?> |
|
202 | 202 | </ul> |
203 | 203 | </li> |
204 | - <?php if ( $toolbar_headings ): ?> |
|
205 | - <li id="lasso-toolbar--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"></li> |
|
206 | - <li id="lasso-toolbar--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"></li> |
|
204 | + <?php if ($toolbar_headings): ?> |
|
205 | + <li id="lasso-toolbar--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"></li> |
|
206 | + <li id="lasso-toolbar--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"></li> |
|
207 | 207 | <?php endif; ?> |
208 | - <?php if ( $toolbar_headings_h4 ): ?> |
|
209 | - <li id="lasso-toolbar--h4" title="<?php esc_attr_e( 'H4 Heading', 'lasso' );?>"></li> |
|
210 | - <li id="lasso-toolbar--h5" title="<?php esc_attr_e( 'H5 Heading', 'lasso' );?>"></li> |
|
211 | - <li id="lasso-toolbar--h6" title="<?php esc_attr_e( 'H6 Heading', 'lasso' );?>"></li> |
|
208 | + <?php if ($toolbar_headings_h4): ?> |
|
209 | + <li id="lasso-toolbar--h4" title="<?php esc_attr_e('H4 Heading', 'lasso'); ?>"></li> |
|
210 | + <li id="lasso-toolbar--h5" title="<?php esc_attr_e('H5 Heading', 'lasso'); ?>"></li> |
|
211 | + <li id="lasso-toolbar--h6" title="<?php esc_attr_e('H6 Heading', 'lasso'); ?>"></li> |
|
212 | 212 | <?php endif; ?> |
213 | 213 | |
214 | - <?php if ( $show_color ): ?> |
|
215 | - <li id="lasso-toolbar--color-set" title="<?php esc_attr_e( 'Set Text Color', 'lasso' );?>"></li> |
|
216 | - <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e( 'Choose Color', 'lasso' );?>"></li> |
|
214 | + <?php if ($show_color): ?> |
|
215 | + <li id="lasso-toolbar--color-set" title="<?php esc_attr_e('Set Text Color', 'lasso'); ?>"></li> |
|
216 | + <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e('Choose Color', 'lasso'); ?>"></li> |
|
217 | 217 | <?php endif; ?> |
218 | 218 | |
219 | 219 | |
220 | - <li id="lasso-toolbar--link" title="<?php esc_attr_e( 'Anchor Link', 'lasso' );?>"> |
|
220 | + <li id="lasso-toolbar--link" title="<?php esc_attr_e('Anchor Link', 'lasso'); ?>"> |
|
221 | 221 | <div id="lasso-toolbar--link__wrap" <?php echo $mobile_style ?> > |
222 | - <div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'http://url.com', 'lasso' );?>"></div> |
|
223 | - <a href="#" title="<?php esc_attr_e( 'Create Link', 'lasso' );?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a> |
|
222 | + <div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e('http://url.com', 'lasso'); ?>"></div> |
|
223 | + <a href="#" title="<?php esc_attr_e('Create Link', 'lasso'); ?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a> |
|
224 | 224 | <input class="styled-checkbox" type="checkbox" id="aesop-toolbar--link_newtab" checked/> |
225 | 225 | <label for="aesop-toolbar--link_newtab">Open in Another Tab</label> |
226 | 226 | </div> |
227 | 227 | </li> |
228 | - <?php do_action( 'lasso_toolbar_components_after' );?> |
|
229 | - <li id="lasso-toolbar--html" title="<?php esc_attr_e( 'Insert HTML', 'lasso' );?>"> |
|
228 | + <?php do_action('lasso_toolbar_components_after'); ?> |
|
229 | + <li id="lasso-toolbar--html" title="<?php esc_attr_e('Insert HTML', 'lasso'); ?>"> |
|
230 | 230 | <div id="lasso-toolbar--html__wrap" <?php echo $mobile_style ?>> |
231 | - <div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?>"></div> |
|
231 | + <div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e('Enter HTML to insert', 'lasso'); ?>"></div> |
|
232 | 232 | <div id="lasso-toolbar--html__footer"> |
233 | 233 | <div id="lasso-toolbar--html__footer_desc" > |
234 | - <?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?><br> |
|
235 | - <?php esc_attr_e( 'You can also use Shortcodes', 'lasso' );?> |
|
234 | + <?php esc_attr_e('Enter HTML to insert', 'lasso'); ?><br> |
|
235 | + <?php esc_attr_e('You can also use Shortcodes', 'lasso'); ?> |
|
236 | 236 | </div> |
237 | 237 | <ul class="lasso-toolbar--html-snips"> |
238 | 238 | |
239 | - <?php if ( !$toolbar_headings ): ?> |
|
240 | - <li id="lasso-html--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"> |
|
241 | - <li id="lasso-html--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"> |
|
239 | + <?php if (!$toolbar_headings): ?> |
|
240 | + <li id="lasso-html--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"> |
|
241 | + <li id="lasso-html--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"> |
|
242 | 242 | <?php endif; ?> |
243 | - <li id="lasso-html--ul" title="<?php esc_attr_e( 'Unordered List', 'lasso' );?>"> |
|
244 | - <li id="lasso-html--ol" title="<?php esc_attr_e( 'Ordered List', 'lasso' );?>"> |
|
243 | + <li id="lasso-html--ul" title="<?php esc_attr_e('Unordered List', 'lasso'); ?>"> |
|
244 | + <li id="lasso-html--ol" title="<?php esc_attr_e('Ordered List', 'lasso'); ?>"> |
|
245 | 245 | </ul> |
246 | - <a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e( 'Cancel', 'lasso' );?></a> |
|
247 | - <a href="#" title="<?php esc_attr_e( 'Insert HTML', 'lasso' );?>" class="lasso-toolbar--html__control" id="lasso-toolbar--html__insert" ><?php _e( 'Insert', 'lasso' );?></a> |
|
246 | + <a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e('Cancel', 'lasso'); ?></a> |
|
247 | + <a href="#" title="<?php esc_attr_e('Insert HTML', 'lasso'); ?>" class="lasso-toolbar--html__control" id="lasso-toolbar--html__insert" ><?php _e('Insert', 'lasso'); ?></a> |
|
248 | 248 | </div> |
249 | 249 | </div> |
250 | 250 | </li> |
251 | - <?php if ( $show_align ): ?> |
|
252 | - <li id="lasso-toolbar--left-align" title="<?php esc_attr_e( 'Text Left Align', 'lasso' );?>"></li> |
|
253 | - <li id="lasso-toolbar--center-align" title="<?php esc_attr_e( 'Text Center Align', 'lasso' );?>"></li> |
|
254 | - <li id="lasso-toolbar--right-align" title="<?php esc_attr_e( 'Text Right Align', 'lasso' );?>"></li> |
|
251 | + <?php if ($show_align): ?> |
|
252 | + <li id="lasso-toolbar--left-align" title="<?php esc_attr_e('Text Left Align', 'lasso'); ?>"></li> |
|
253 | + <li id="lasso-toolbar--center-align" title="<?php esc_attr_e('Text Center Align', 'lasso'); ?>"></li> |
|
254 | + <li id="lasso-toolbar--right-align" title="<?php esc_attr_e('Text Right Align', 'lasso'); ?>"></li> |
|
255 | 255 | <?php endif; ?> |
256 | 256 | </ul> |
257 | - <?php if ( is_singular() && $is_mobile ) { ?> |
|
257 | + <?php if (is_singular() && $is_mobile) { ?> |
|
258 | 258 | |
259 | - <div class="lasso--controls__right" data-posttype="<?php echo get_post_type( get_the_ID() );?>" data-status="<?php echo $status;?>" style="position:static;bottom:0px;right;0px;left:auto;"> |
|
259 | + <div class="lasso--controls__right" data-posttype="<?php echo get_post_type(get_the_ID()); ?>" data-status="<?php echo $status; ?>" style="position:static;bottom:0px;right;0px;left:auto;"> |
|
260 | 260 | |
261 | - <a href="#" title="<?php esc_attr_e( 'Save Post', 'lasso' );?>" id="lasso--save" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
261 | + <a href="#" title="<?php esc_attr_e('Save Post', 'lasso'); ?>" id="lasso--save" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
262 | 262 | |
263 | - <?php if ( 'draft' == $status && ( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ) ) { ?> |
|
264 | - <a href="#" title="<?php esc_attr_e( 'Publish Post', 'lasso' );?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
263 | + <?php if ('draft' == $status && (lasso_user_can('publish_posts') || lasso_user_can('publish_pages'))) { ?> |
|
264 | + <a href="#" title="<?php esc_attr_e('Publish Post', 'lasso'); ?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
265 | 265 | <?php } ?> |
266 | 266 | |
267 | 267 | </div> |
@@ -279,22 +279,22 @@ discard block |
||
279 | 279 | */ |
280 | 280 | function lasso_editor_settings_toolbar() { |
281 | 281 | |
282 | - $delete_nonce = wp_create_nonce( 'lasso-delete-nonce' ); |
|
282 | + $delete_nonce = wp_create_nonce('lasso-delete-nonce'); |
|
283 | 283 | |
284 | 284 | ob_start(); |
285 | 285 | |
286 | - if ( !lasso_user_can() ) |
|
286 | + if (!lasso_user_can()) |
|
287 | 287 | return; |
288 | 288 | |
289 | 289 | // let users add custom css classes |
290 | - $custom_classes = apply_filters( 'lasso_component_classes', '' ); |
|
290 | + $custom_classes = apply_filters('lasso_component_classes', ''); |
|
291 | 291 | |
292 | 292 | ?> |
293 | - <ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
294 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
295 | - <li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
296 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
297 | - <li class="lasso-delete" data-postid="<?php echo get_the_ID();?>" data-nonce="<?php echo $delete_nonce;?>" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
293 | + <ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
294 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
295 | + <li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
296 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
297 | + <li class="lasso-delete" data-postid="<?php echo get_the_ID(); ?>" data-nonce="<?php echo $delete_nonce; ?>" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
298 | 298 | </ul> |
299 | 299 | |
300 | 300 | <?php return ob_get_clean(); |
@@ -310,17 +310,17 @@ discard block |
||
310 | 310 | |
311 | 311 | ob_start(); |
312 | 312 | |
313 | - if ( !lasso_user_can() ) |
|
313 | + if (!lasso_user_can()) |
|
314 | 314 | return; |
315 | 315 | |
316 | 316 | // has post thumbnail |
317 | - $has_thumbnail = has_post_thumbnail( get_the_ID() ) ? 'class="lasso--featImg--has-thumb"' : false; |
|
317 | + $has_thumbnail = has_post_thumbnail(get_the_ID()) ? 'class="lasso--featImg--has-thumb"' : false; |
|
318 | 318 | |
319 | 319 | ?> |
320 | - <ul id="lasso--featImgControls" <?php echo $has_thumbnail;?>> |
|
321 | - <li id="lasso--featImgUpload"><a title="<?php esc_attr_e( 'Replace Image', 'lasso' );?>" href="#"><i class="lasso-icon-image"></i></a></li> |
|
322 | - <li id="lasso--featImgDelete"><a title="<?php esc_attr_e( 'Delete Image', 'lasso' );?>" href="#"><i class="lasso-icon-bin2"></i></a></li> |
|
323 | - <li id="lasso--featImgSave"><a href="#"><?php esc_attr_e( 'save', 'lasso' );?></a></li> |
|
320 | + <ul id="lasso--featImgControls" <?php echo $has_thumbnail; ?>> |
|
321 | + <li id="lasso--featImgUpload"><a title="<?php esc_attr_e('Replace Image', 'lasso'); ?>" href="#"><i class="lasso-icon-image"></i></a></li> |
|
322 | + <li id="lasso--featImgDelete"><a title="<?php esc_attr_e('Delete Image', 'lasso'); ?>" href="#"><i class="lasso-icon-bin2"></i></a></li> |
|
323 | + <li id="lasso--featImgSave"><a href="#"><?php esc_attr_e('save', 'lasso'); ?></a></li> |
|
324 | 324 | </ul> |
325 | 325 | |
326 | 326 | <?php return ob_get_clean(); |
@@ -339,58 +339,58 @@ discard block |
||
339 | 339 | |
340 | 340 | ob_start(); |
341 | 341 | |
342 | - if ( !lasso_user_can() ) |
|
342 | + if (!lasso_user_can()) |
|
343 | 343 | return; |
344 | 344 | |
345 | 345 | global $post; |
346 | 346 | |
347 | 347 | $postid = get_the_ID(); |
348 | 348 | |
349 | - $status = get_post_status( $postid ); |
|
350 | - $nonce = wp_create_nonce( 'lasso-update-post-settings' ); |
|
349 | + $status = get_post_status($postid); |
|
350 | + $nonce = wp_create_nonce('lasso-update-post-settings'); |
|
351 | 351 | |
352 | 352 | // let users add custom css classes |
353 | - $custom_classes = apply_filters( 'lasso_modal_settings_classes', '' ); |
|
353 | + $custom_classes = apply_filters('lasso_modal_settings_classes', ''); |
|
354 | 354 | |
355 | 355 | // objects categories |
356 | - $categories = lasso_get_post_objects( $postid, 'category' ); |
|
357 | - $tags = lasso_get_post_objects( $postid, 'tag' ); |
|
356 | + $categories = lasso_get_post_objects($postid, 'category'); |
|
357 | + $tags = lasso_get_post_objects($postid, 'tag'); |
|
358 | 358 | |
359 | 359 | // modal tabs |
360 | - $tabs = lasso_modal_addons('tab'); |
|
361 | - $content = lasso_modal_addons('content'); |
|
360 | + $tabs = lasso_modal_addons('tab'); |
|
361 | + $content = lasso_modal_addons('content'); |
|
362 | 362 | |
363 | 363 | //editor options |
364 | 364 | $allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor'); |
365 | 365 | |
366 | 366 | // are we singular |
367 | - $is_singular = is_singular(); |
|
367 | + $is_singular = is_singular(); |
|
368 | 368 | $is_singular_class = $is_singular ? 'lasso--postsettings__2col' : 'lasso--postsettings__1col'; |
369 | 369 | $has_thumb_class = has_post_thumbnail() ? 'has-thumbnail' : 'no-thumbnail'; |
370 | 370 | $theme_supports = current_theme_supports('post-thumbnails'); |
371 | - $default_image = LASSO_URL.'/admin/assets/img/empty-img.png'; |
|
371 | + $default_image = LASSO_URL.'/admin/assets/img/empty-img.png'; |
|
372 | 372 | |
373 | 373 | ?> |
374 | - <div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>"> |
|
374 | + <div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>"> |
|
375 | 375 | <div class="lasso--modal__inner"> |
376 | 376 | |
377 | - <?php if( $tabs ) { echo $tabs; } ?> |
|
377 | + <?php if ($tabs) { echo $tabs; } ?> |
|
378 | 378 | |
379 | 379 | <div class="lasso--modal__content modal__content--core visible" data-addon-content="core"> |
380 | - <form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class;?>" > |
|
380 | + <form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class; ?>" > |
|
381 | 381 | |
382 | - <?php if ( $is_singular && $theme_supports ) : ?> |
|
382 | + <?php if ($is_singular && $theme_supports) : ?> |
|
383 | 383 | <div class="lasso--postsettings__left"> |
384 | - <label><?php _e( 'Featured Image', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Change the featured image for this post.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
385 | - <div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url( $default_image );?>"> |
|
384 | + <label><?php _e('Featured Image', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Change the featured image for this post.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
385 | + <div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url($default_image); ?>"> |
|
386 | 386 | |
387 | 387 | <div id="lasso--post-thumb__controls" class="lasso--post-thumb__controls"> |
388 | - <i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image','lasso');?>" class="dashicons dashicons-edit"></i> |
|
389 | - <i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image','lasso');?>" class="dashicons dashicons-no-alt"></i> |
|
388 | + <i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image', 'lasso'); ?>" class="dashicons dashicons-edit"></i> |
|
389 | + <i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image', 'lasso'); ?>" class="dashicons dashicons-no-alt"></i> |
|
390 | 390 | <i id="lasso--save-status" class="lasso-icon lasso-icon-spinner6 not-visible"></i> |
391 | 391 | </div> |
392 | 392 | |
393 | - <?php echo has_post_thumbnail() ? get_the_post_thumbnail( $post->ID, 'medium' ) : '<img src="'.$default_image.'">'; ?> |
|
393 | + <?php echo has_post_thumbnail() ? get_the_post_thumbnail($post->ID, 'medium') : '<img src="'.$default_image.'">'; ?> |
|
394 | 394 | |
395 | 395 | </div> |
396 | 396 | <div id="lasso--featImgSave"><a href="#" class="not-visible">Save</a></div> |
@@ -400,12 +400,12 @@ discard block |
||
400 | 400 | |
401 | 401 | <div class="lasso--postsettings__right"> |
402 | 402 | |
403 | - <?php if( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ): ?> |
|
403 | + <?php if (lasso_user_can('publish_posts') || lasso_user_can('publish_pages')): ?> |
|
404 | 404 | <div class="lasso--postsettings__option story-status-option"> |
405 | - <label><?php _e( 'Status', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Change the status of the post to draft or publish.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
406 | - <ul class="story-status story-status-<?php echo sanitize_html_class( $status );?>"> |
|
407 | - <li id="lasso--status-draft"><?php _e( 'Draft', 'lasso' );?></li> |
|
408 | - <li id="lasso--status-publish"><?php _e( 'Publish', 'lasso' );?></li> |
|
405 | + <label><?php _e('Status', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Change the status of the post to draft or publish.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
406 | + <ul class="story-status story-status-<?php echo sanitize_html_class($status); ?>"> |
|
407 | + <li id="lasso--status-draft"><?php _e('Draft', 'lasso'); ?></li> |
|
408 | + <li id="lasso--status-publish"><?php _e('Publish', 'lasso'); ?></li> |
|
409 | 409 | </ul> |
410 | 410 | <div class="lasso--slider_wrap"> |
411 | 411 | <div id="lasso--slider"></div> |
@@ -413,10 +413,10 @@ discard block |
||
413 | 413 | </div> |
414 | 414 | <?php endif; ?> |
415 | 415 | |
416 | - <?php if ( 'publish' == $status ): ?> |
|
416 | + <?php if ('publish' == $status): ?> |
|
417 | 417 | <div class="lasso--postsettings__option story-slug-option"> |
418 | - <label><?php _e( 'Post URL', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Change the URL (slug) of this post.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
419 | - <input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset( $post ) ? esc_attr( $post->post_name ) : false;?>"> |
|
418 | + <label><?php _e('Post URL', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Change the URL (slug) of this post.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
419 | + <input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset($post) ? esc_attr($post->post_name) : false; ?>"> |
|
420 | 420 | </div> |
421 | 421 | <?php endif; ?> |
422 | 422 | |
@@ -425,20 +425,20 @@ discard block |
||
425 | 425 | <div class="lasso--postsettings__middle"> |
426 | 426 | |
427 | 427 | <div class="lasso--postsettings__option story-categories-option"> |
428 | - <label style="width:120px;"><?php _e( 'Categories', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Type a category name and press enter.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
429 | - <input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories;?>"> |
|
428 | + <label style="width:120px;"><?php _e('Categories', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Type a category name and press enter.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
429 | + <input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories; ?>"> |
|
430 | 430 | </div> |
431 | 431 | |
432 | 432 | <div class="lasso--postsettings__option story-tags-option"> |
433 | - <label><?php _e( 'Tags', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Type a tag name and press enter.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
434 | - <input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags;?>"> |
|
433 | + <label><?php _e('Tags', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Type a tag name and press enter.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
434 | + <input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags; ?>"> |
|
435 | 435 | </div> |
436 | 436 | <?php |
437 | 437 | if ($allow_change_date) { |
438 | - $dateformat = get_option( 'date_format' ); |
|
438 | + $dateformat = get_option('date_format'); |
|
439 | 439 | ?> |
440 | - <label><?php _e( 'Post Date', 'lasso' ); ?></label> |
|
441 | - <input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/> |
|
440 | + <label><?php _e('Post Date', 'lasso'); ?></label> |
|
441 | + <input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid); ?>"/> |
|
442 | 442 | <?php |
443 | 443 | }?> |
444 | 444 | |
@@ -460,23 +460,23 @@ discard block |
||
460 | 460 | ?> |
461 | 461 | <!--/div--> |
462 | 462 | |
463 | - <?php do_action( 'lasso_modal_post_form' ); // action ?> |
|
463 | + <?php do_action('lasso_modal_post_form'); // action ?> |
|
464 | 464 | |
465 | 465 | <div class="lasso--postsettings__footer" > |
466 | - <a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a> |
|
466 | + <a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a> |
|
467 | 467 | <input type="hidden" name="status" value=""> |
468 | 468 | <input type="hidden" name="categories" value=""> |
469 | - <input type="hidden" name="postid" value="<?php echo get_the_ID();?>"> |
|
469 | + <input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>"> |
|
470 | 470 | <input type="hidden" name="action" value="process_update-object_post"> |
471 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
472 | - <?php do_action( 'lasso_modal_post_form_footer' ); // action ?> |
|
473 | - <input type="submit" value="<?php esc_attr_e( 'Save', 'lasso' );?>"> |
|
471 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
472 | + <?php do_action('lasso_modal_post_form_footer'); // action ?> |
|
473 | + <input type="submit" value="<?php esc_attr_e('Save', 'lasso'); ?>"> |
|
474 | 474 | </div> |
475 | 475 | |
476 | 476 | </form> |
477 | 477 | </div> |
478 | 478 | |
479 | - <?php if( $tabs ) { echo $content; } ?> |
|
479 | + <?php if ($tabs) { echo $content; } ?> |
|
480 | 480 | |
481 | 481 | </div> |
482 | 482 | |
@@ -497,45 +497,45 @@ discard block |
||
497 | 497 | |
498 | 498 | ob_start(); |
499 | 499 | |
500 | - if ( !lasso_user_can('edit_posts') ) |
|
500 | + if (!lasso_user_can('edit_posts')) |
|
501 | 501 | return; |
502 | 502 | |
503 | - $status = get_post_status( get_the_ID() ); |
|
503 | + $status = get_post_status(get_the_ID()); |
|
504 | 504 | |
505 | - $nonce = wp_create_nonce( 'lasso-editor-new-post' ); |
|
505 | + $nonce = wp_create_nonce('lasso-editor-new-post'); |
|
506 | 506 | |
507 | 507 | // let users add custom css classes |
508 | - $custom_classes = apply_filters( 'lasso_modal_post_classes', '' ); |
|
508 | + $custom_classes = apply_filters('lasso_modal_post_classes', ''); |
|
509 | 509 | |
510 | 510 | // return the post type |
511 | - $type = get_post_type( get_the_ID() ); |
|
511 | + $type = get_post_type(get_the_ID()); |
|
512 | 512 | |
513 | 513 | $mobile_style = ""; |
514 | 514 | if (wp_is_mobile()) { |
515 | 515 | $mobile_style = 'style="top:140px !important;"'; |
516 | 516 | } |
517 | 517 | ?> |
518 | - <div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style;?>"> |
|
518 | + <div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" <?php echo $mobile_style; ?>"> |
|
519 | 519 | <div class="lasso--modal__inner lasso--hasnewform"> |
520 | 520 | |
521 | 521 | <form id="lasso--postnew__form" enctype="multipart/form-data" class="lasso--post-form"> |
522 | 522 | |
523 | 523 | <div class="lasso--postsettings__option story-slug-option lasso--last-option"> |
524 | - <label><?php esc_attr_e( 'New <span>post</span> title', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Specify title for new post, then save to edit.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
525 | - <input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e( 'Grump Wizards Make Toxic Brew', 'lasso' );?>"> |
|
524 | + <label><?php esc_attr_e('New <span>post</span> title', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Specify title for new post, then save to edit.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
525 | + <input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e('Grump Wizards Make Toxic Brew', 'lasso'); ?>"> |
|
526 | 526 | <div class="lasso--select-wrap" style="width:90px"> |
527 | 527 | <select id="lasso--select-type" name="story_type"> |
528 | 528 | |
529 | 529 | <?php |
530 | 530 | $types = lasso_post_types(); |
531 | 531 | |
532 | - if ( !empty( $types ) ) { |
|
532 | + if (!empty($types)) { |
|
533 | 533 | |
534 | - foreach( $types as $type ) { |
|
534 | + foreach ($types as $type) { |
|
535 | 535 | |
536 | - $type = preg_replace( '/s\b/','', $type ); |
|
536 | + $type = preg_replace('/s\b/', '', $type); |
|
537 | 537 | |
538 | - printf( '<option value="%s">%s</option>', lcfirst( esc_attr( $type ) ) , ucfirst( esc_attr( $type ) ) ); |
|
538 | + printf('<option value="%s">%s</option>', lcfirst(esc_attr($type)), ucfirst(esc_attr($type))); |
|
539 | 539 | } |
540 | 540 | |
541 | 541 | } |
@@ -545,12 +545,12 @@ discard block |
||
545 | 545 | </div> |
546 | 546 | </div> |
547 | 547 | |
548 | - <div class="lasso--postsettings__footer" style="<?php if (!wp_is_mobile()) {echo 'display:none;';} ?>"> |
|
549 | - <a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a> |
|
548 | + <div class="lasso--postsettings__footer" style="<?php if (!wp_is_mobile()) {echo 'display:none;'; } ?>"> |
|
549 | + <a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a> |
|
550 | 550 | <input type="hidden" name="action" value="process_new-object_post"> |
551 | 551 | <input type="hidden" name="object" value="post"> |
552 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
553 | - <input type="submit" value="<?php esc_attr_e( 'Create', 'lasso' );?>"> |
|
552 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
553 | + <input type="submit" value="<?php esc_attr_e('Create', 'lasso'); ?>"> |
|
554 | 554 | </div> |
555 | 555 | |
556 | 556 | </form> |
@@ -578,18 +578,18 @@ discard block |
||
578 | 578 | ob_start(); |
579 | 579 | |
580 | 580 | // post status |
581 | - $status = get_post_status( get_the_ID() ); |
|
581 | + $status = get_post_status(get_the_ID()); |
|
582 | 582 | |
583 | 583 | // let users add custom css classes |
584 | - $custom_classes = apply_filters( 'lasso_modal_all_post_classes', '' ); |
|
584 | + $custom_classes = apply_filters('lasso_modal_all_post_classes', ''); |
|
585 | 585 | |
586 | 586 | ?> |
587 | - <div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" style="max-height:100%"> |
|
587 | + <div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" style="max-height:100%"> |
|
588 | 588 | <div class="lasso--modal__inner"> |
589 | 589 | |
590 | 590 | <div class="lasso--post-filtering not-visible"> |
591 | 591 | <div class="lasso--search__results"> |
592 | - <span id="lasso--results-found"></span><?php _e('results found','lasso');?> |
|
592 | + <span id="lasso--results-found"></span><?php _e('results found', 'lasso'); ?> |
|
593 | 593 | </div> |
594 | 594 | <div class="lasso--search"> |
595 | 595 | <i id="lasso--search__toggle" class="dashicons dashicons-search"></i> |
@@ -603,18 +603,18 @@ discard block |
||
603 | 603 | $post_types = lasso_post_types_names(); |
604 | 604 | $rest_bases = lasso_post_types_rest_base(); |
605 | 605 | |
606 | - if ( ! empty( $post_types ) ) { |
|
606 | + if (!empty($post_types)) { |
|
607 | 607 | $first = 'active'; |
608 | - foreach( $post_types as $name => $label ) { |
|
608 | + foreach ($post_types as $name => $label) { |
|
609 | 609 | if (array_key_exists($name, $rest_bases)) { |
610 | - printf( '<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr( $first), esc_attr( $rest_bases[$name] ), esc_attr( $label ) ); |
|
610 | + printf('<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr($first), esc_attr($rest_bases[$name]), esc_attr($label)); |
|
611 | 611 | } |
612 | 612 | $first = ''; |
613 | 613 | } |
614 | 614 | |
615 | 615 | } |
616 | 616 | |
617 | - do_action('lasso_modal_post_objects');?> |
|
617 | + do_action('lasso_modal_post_objects'); ?> |
|
618 | 618 | |
619 | 619 | </ul> |
620 | 620 | <div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div> |
@@ -632,18 +632,18 @@ discard block |
||
632 | 632 | |
633 | 633 | ob_start(); |
634 | 634 | |
635 | - if ( !lasso_user_can() ) |
|
635 | + if (!lasso_user_can()) |
|
636 | 636 | return; |
637 | 637 | |
638 | 638 | // let users add custom css classes |
639 | - $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
|
639 | + $custom_classes = apply_filters('lasso_wpimg_classes', ''); |
|
640 | 640 | |
641 | 641 | ?> |
642 | - <ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
643 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
644 | - <li id="lasso--wpimg-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
645 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
646 | - <li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
642 | + <ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
643 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
644 | + <li id="lasso--wpimg-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
645 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
646 | + <li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
647 | 647 | </ul> |
648 | 648 | |
649 | 649 | <?php return ob_get_clean(); |
@@ -653,18 +653,18 @@ discard block |
||
653 | 653 | |
654 | 654 | ob_start(); |
655 | 655 | |
656 | - if ( !lasso_user_can() ) |
|
656 | + if (!lasso_user_can()) |
|
657 | 657 | return; |
658 | 658 | |
659 | 659 | // let users add custom css classes |
660 | - $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
|
660 | + $custom_classes = apply_filters('lasso_wpimg_classes', ''); |
|
661 | 661 | |
662 | 662 | ?> |
663 | - <ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
664 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
665 | - <li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
666 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
667 | - <li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
663 | + <ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
664 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
665 | + <li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
666 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
667 | + <li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
668 | 668 | </ul> |
669 | 669 | |
670 | 670 | <?php return ob_get_clean(); |
@@ -677,16 +677,16 @@ discard block |
||
677 | 677 | */ |
678 | 678 | function lasso_map_form_footer() { |
679 | 679 | |
680 | - $nonce = wp_create_nonce( 'lasso-process-map' ); |
|
680 | + $nonce = wp_create_nonce('lasso-process-map'); |
|
681 | 681 | |
682 | 682 | ob_start(); |
683 | 683 | |
684 | 684 | ?> |
685 | 685 | <div class="lasso--map-form__footer"> |
686 | - <input type="hidden" name="postid" value="<?php echo get_the_ID();?>"> |
|
687 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
686 | + <input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>"> |
|
687 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
688 | 688 | <input type="hidden" name="action" value="process_map_save"> |
689 | - <input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e( 'Save Locations', 'lasso' );?>"> |
|
689 | + <input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e('Save Locations', 'lasso'); ?>"> |
|
690 | 690 | </div> |
691 | 691 | |
692 | 692 | <?php return ob_get_clean(); |
@@ -704,7 +704,7 @@ discard block |
||
704 | 704 | |
705 | 705 | ?> |
706 | 706 | <div id="lasso--pagerefresh" class="visible"> |
707 | - <?php _e( 'Save this post and refesh the page to see these changes.', 'lasso' );?> |
|
707 | + <?php _e('Save this post and refesh the page to see these changes.', 'lasso'); ?> |
|
708 | 708 | </div> |
709 | 709 | |
710 | 710 | <?php return ob_get_clean(); |
@@ -718,43 +718,43 @@ discard block |
||
718 | 718 | */ |
719 | 719 | function lasso_editor_options_blob() { |
720 | 720 | |
721 | - $codes = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : apply_filters( 'lasso_custom_options', '' ); |
|
722 | - $galleries = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery'; |
|
721 | + $codes = function_exists('aesop_shortcodes') ? aesop_shortcodes() : apply_filters('lasso_custom_options', ''); |
|
722 | + $galleries = function_exists('lasso_editor_galleries_exist') && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery'; |
|
723 | 723 | |
724 | - $nonce = wp_create_nonce( 'lasso_gallery' ); |
|
724 | + $nonce = wp_create_nonce('lasso_gallery'); |
|
725 | 725 | |
726 | 726 | $blob = array(); |
727 | 727 | |
728 | - if ( empty( $codes ) ) |
|
728 | + if (empty($codes)) |
|
729 | 729 | return; |
730 | 730 | |
731 | - foreach ( $codes as $slug => $shortcode ) { |
|
731 | + foreach ($codes as $slug => $shortcode) { |
|
732 | 732 | $return = ''; |
733 | 733 | // Shortcode has atts |
734 | 734 | |
735 | - if ( count( $shortcode['atts'] ) && $shortcode['atts'] ) { |
|
735 | + if (count($shortcode['atts']) && $shortcode['atts']) { |
|
736 | 736 | |
737 | - foreach ( $shortcode['atts'] as $attr_name => $attr_info ) { |
|
737 | + foreach ($shortcode['atts'] as $attr_name => $attr_info) { |
|
738 | 738 | |
739 | 739 | |
740 | - $prefix = isset( $attr_info['prefix'] ) ? sprintf( '<span class="lasso-option-prefix">%s</span>', $attr_info['prefix'] ) : null; |
|
740 | + $prefix = isset($attr_info['prefix']) ? sprintf('<span class="lasso-option-prefix">%s</span>', $attr_info['prefix']) : null; |
|
741 | 741 | |
742 | 742 | $return .= '<form id="lasso--component-settings-form" class="'.$galleries.'" method="post">'; |
743 | 743 | $return .= '<p data-option="'.$attr_name.'" class="lasso-option lasso-'.$slug.'-'.$attr_name.'">'; |
744 | - $return .= '<label for="lasso-generator-attr-' . $attr_name . '">' . $attr_info['desc'] . '</label>'; |
|
744 | + $return .= '<label for="lasso-generator-attr-'.$attr_name.'">'.$attr_info['desc'].'</label>'; |
|
745 | 745 | $return .= '<small class="lasso-option-desc">'.$attr_info['tip'].'</small>'; |
746 | 746 | // Select |
747 | 747 | |
748 | - if ( isset( $attr_info['values'] ) ) { |
|
748 | + if (isset($attr_info['values'])) { |
|
749 | 749 | |
750 | - $return .= '<select name="' . $attr_name . '" id="lasso-generator-attr-' . $attr_name . '" class="lasso-generator-attr">'; |
|
750 | + $return .= '<select name="'.$attr_name.'" id="lasso-generator-attr-'.$attr_name.'" class="lasso-generator-attr">'; |
|
751 | 751 | |
752 | - $i=0; |
|
752 | + $i = 0; |
|
753 | 753 | |
754 | - foreach ( $attr_info['values'] as $attr_value ) { |
|
754 | + foreach ($attr_info['values'] as $attr_value) { |
|
755 | 755 | $attr_value_selected = $attr_info['default'] == $attr_value ? ' selected="selected"' : ''; |
756 | 756 | |
757 | - $return .= '<option value="'.$attr_info['values'][$i]['value'].'" ' . $attr_value_selected . '>'.$attr_info['values'][$i]['name'].'</option>'; |
|
757 | + $return .= '<option value="'.$attr_info['values'][$i]['value'].'" '.$attr_value_selected.'>'.$attr_info['values'][$i]['name'].'</option>'; |
|
758 | 758 | |
759 | 759 | $i++; |
760 | 760 | } |
@@ -763,24 +763,24 @@ discard block |
||
763 | 763 | |
764 | 764 | } else { |
765 | 765 | |
766 | - $attr_field_type = isset( $attr_info['type'] ) ? $attr_info['type'] : 'text'; |
|
766 | + $attr_field_type = isset($attr_info['type']) ? $attr_info['type'] : 'text'; |
|
767 | 767 | |
768 | 768 | // image upload |
769 | - if ( 'media_upload' == $attr_info['type'] ) { |
|
769 | + if ('media_upload' == $attr_info['type']) { |
|
770 | 770 | |
771 | - $return .= '<input type="' . $attr_field_type . '" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="lasso-generator-attr-' . $attr_name . '" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" />'; |
|
771 | + $return .= '<input type="'.$attr_field_type.'" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="lasso-generator-attr-'.$attr_name.'" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" />'; |
|
772 | 772 | $return .= '<a href="#" id="lasso-upload-img" class="lasso-option-button" /></a>'; |
773 | 773 | |
774 | - } elseif ( 'color' == $attr_info['type'] ) { |
|
774 | + } elseif ('color' == $attr_info['type']) { |
|
775 | 775 | |
776 | - $return .= '<input type="color" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="lasso-generator-attr-' . $attr_name . '" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" />'; |
|
776 | + $return .= '<input type="color" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="lasso-generator-attr-'.$attr_name.'" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" />'; |
|
777 | 777 | |
778 | - } elseif ( 'text_area' == $attr_info['type'] ) { |
|
778 | + } elseif ('text_area' == $attr_info['type']) { |
|
779 | 779 | |
780 | - $return .= '<textarea name="' . $attr_name . '" id="lasso-generator-attr-' . $attr_name . '" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" placeholder="'.$attr_info['default'].'" /></textarea>'.$prefix.''; |
|
780 | + $return .= '<textarea name="'.$attr_name.'" id="lasso-generator-attr-'.$attr_name.'" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" placeholder="'.$attr_info['default'].'" /></textarea>'.$prefix.''; |
|
781 | 781 | |
782 | 782 | } else { |
783 | - $return .= '<input type="' . $attr_field_type . '" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="lasso-generator-attr-' . $attr_name . '" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" />'.$prefix.''; |
|
783 | + $return .= '<input type="'.$attr_field_type.'" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="lasso-generator-attr-'.$attr_name.'" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" />'.$prefix.''; |
|
784 | 784 | } |
785 | 785 | } |
786 | 786 | $return .= '</p>'; |
@@ -791,9 +791,9 @@ discard block |
||
791 | 791 | /////////////////////////// |
792 | 792 | // START GALLERY AND MAP FRONT END STUFFS |
793 | 793 | /////////////////////////// |
794 | - if ( isset( $shortcode['front'] ) && true == $shortcode['front'] ) { |
|
794 | + if (isset($shortcode['front']) && true == $shortcode['front']) { |
|
795 | 795 | |
796 | - if ( 'gallery' == $shortcode['front_type'] ) { |
|
796 | + if ('gallery' == $shortcode['front_type']) { |
|
797 | 797 | |
798 | 798 | $return .= lasso_gallery_editor_module(); |
799 | 799 | |
@@ -804,13 +804,13 @@ discard block |
||
804 | 804 | /////////////////////////// |
805 | 805 | |
806 | 806 | // Single shortcode (not closed) |
807 | - if ( 'single' == $shortcode['type'] ) { |
|
807 | + if ('single' == $shortcode['type']) { |
|
808 | 808 | |
809 | 809 | $return .= '<input type="hidden" name="lasso-generator-content" id="lasso-generator-content" value="false" />'; |
810 | 810 | |
811 | 811 | } else { |
812 | 812 | |
813 | - $return .= '<p data-option="content" class="lasso-option lasso-c-comp-text"><label>' . __( 'Content', 'lasso' ) . '</label><textarea type="text" name="lasso-generator-content" id="lasso-generator-content" value="' . $shortcode['content'] . '" /></textarea></p>'; |
|
813 | + $return .= '<p data-option="content" class="lasso-option lasso-c-comp-text"><label>'.__('Content', 'lasso').'</label><textarea type="text" name="lasso-generator-content" id="lasso-generator-content" value="'.$shortcode['content'].'" /></textarea></p>'; |
|
814 | 814 | } |
815 | 815 | |
816 | 816 | $return .= '<p class="lasso-buttoninsert-wrap"><a href="#" class="lasso-generator-cancel" id="lasso--sidebar__close">Cancel |
@@ -843,7 +843,7 @@ discard block |
||
843 | 843 | <div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div> |
844 | 844 | <div id="lasso--hide" style="display:none;" class="lasso--post-form"> |
845 | 845 | <i class="lasso-icon lasso-icon-move"></i> |
846 | - <label><?php _e( 'Revisions', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Use the slider to view the revision live on the page.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
846 | + <label><?php _e('Revisions', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Use the slider to view the revision live on the page.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
847 | 847 | <div class="lasso--slider_wrap"> |
848 | 848 | <div id="lasso--slider"></div> |
849 | 849 | </div> |
@@ -182,7 +182,7 @@ |
||
182 | 182 | * @param string|bool $value The term slug, or a comma separated list of slugs. Or false to remove all terms set for post. |
183 | 183 | * The first item is the name of taxonomy |
184 | 184 | * |
185 | - * @return bool True if update was successful, false if not. |
|
185 | + * @return boolean|null True if update was successful, false if not. |
|
186 | 186 | */ |
187 | 187 | public function set_custom_taxonomy( $postid, $value) { |
188 | 188 |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | * @since 0.9.3 |
135 | 135 | * |
136 | 136 | * @param int $postid The current postid |
137 | - * @param string|bool $value The term slug, or a comma separated list of slugs. Or false to remove all terms set for post. |
|
137 | + * @param string|bool $value The term slug, or a comma separated list of slugs. Or false to remove all terms set for post. |
|
138 | 138 | * @param string $taxonomy The name of the taxonomy to which the term belongs. |
139 | 139 | * |
140 | 140 | * @return bool True if update was successful, false if not. |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | } |
148 | 148 | |
149 | 149 | if ($taxonomy =='category') { |
150 | - // convert from names to category ids |
|
150 | + // convert from names to category ids |
|
151 | 151 | $cats = array(); |
152 | 152 | if (is_array($value)) { |
153 | 153 | foreach ($value as $cat) { |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | * |
180 | 180 | * |
181 | 181 | * @param int $postid The current postid |
182 | - * @param string|bool $value The term slug, or a comma separated list of slugs. Or false to remove all terms set for post. |
|
182 | + * @param string|bool $value The term slug, or a comma separated list of slugs. Or false to remove all terms set for post. |
|
183 | 183 | * The first item is the name of taxonomy |
184 | 184 | * |
185 | 185 | * @return bool True if update was successful, false if not. |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | $value = explode( ',', $value ); |
193 | 193 | } |
194 | 194 | |
195 | - // Deleting first array item |
|
195 | + // Deleting first array item |
|
196 | 196 | $taxonomy = array_shift($value); |
197 | 197 | $cats = array(); |
198 | 198 | foreach ($value as $cat) { |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | |
215 | 215 | if( $value ) { |
216 | 216 | $time = current_time('mysql'); |
217 | - wp_update_post( |
|
217 | + wp_update_post( |
|
218 | 218 | array ( |
219 | 219 | 'ID' => $postid, // ID of the post to update |
220 | 220 | 'post_date' => date( 'Y-m-d H:i:s', strtotime($value) ), |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | use lasso\internal_api\api_action; |
11 | 11 | |
12 | -class update_object implements api_action{ |
|
12 | +class update_object implements api_action { |
|
13 | 13 | |
14 | 14 | /** |
15 | 15 | * The nonce action for this request. |
@@ -29,11 +29,11 @@ discard block |
||
29 | 29 | * |
30 | 30 | * @return bool Always returns true. |
31 | 31 | */ |
32 | - public function post( $data ) { |
|
32 | + public function post($data) { |
|
33 | 33 | |
34 | - $status = isset( $data['status'] ) ? $data['status'] : false; |
|
35 | - $postid = isset( $data['postid'] ) ? $data['postid'] : false; |
|
36 | - $slug = isset( $data['story_slug'] ) ? $data['story_slug'] : false; |
|
34 | + $status = isset($data['status']) ? $data['status'] : false; |
|
35 | + $postid = isset($data['postid']) ? $data['postid'] : false; |
|
36 | + $slug = isset($data['story_slug']) ? $data['story_slug'] : false; |
|
37 | 37 | |
38 | 38 | |
39 | 39 | |
@@ -43,28 +43,28 @@ discard block |
||
43 | 43 | 'post_status' => $status |
44 | 44 | ); |
45 | 45 | |
46 | - wp_update_post( apply_filters( 'lasso_object_status_update_args', $args ) ); |
|
46 | + wp_update_post(apply_filters('lasso_object_status_update_args', $args)); |
|
47 | 47 | |
48 | 48 | |
49 | 49 | // update categories |
50 | - $cats = isset( $data['story_cats'] ) ? $data['story_cats'] : false; |
|
51 | - self::set_post_terms( $postid, $cats, 'category' ); |
|
50 | + $cats = isset($data['story_cats']) ? $data['story_cats'] : false; |
|
51 | + self::set_post_terms($postid, $cats, 'category'); |
|
52 | 52 | |
53 | 53 | |
54 | 54 | // update tags |
55 | - $tags = isset( $data['story_tags'] ) ? $data['story_tags'] : false; |
|
56 | - self::set_post_terms( $postid, $tags, 'post_tag' ); |
|
55 | + $tags = isset($data['story_tags']) ? $data['story_tags'] : false; |
|
56 | + self::set_post_terms($postid, $tags, 'post_tag'); |
|
57 | 57 | |
58 | 58 | // update custom taxonomy |
59 | - $taxs = isset( $data['story_custom_taxonomy'] ) ? $data['story_custom_taxonomy'] : false; |
|
60 | - self::set_custom_taxonomy( $postid, $taxs ); |
|
59 | + $taxs = isset($data['story_custom_taxonomy']) ? $data['story_custom_taxonomy'] : false; |
|
60 | + self::set_custom_taxonomy($postid, $taxs); |
|
61 | 61 | |
62 | 62 | //update date |
63 | - $date = isset( $data['post_date'] ) ? $data['post_date'] : false; |
|
64 | - self::set_date( $postid, $date ); |
|
63 | + $date = isset($data['post_date']) ? $data['post_date'] : false; |
|
64 | + self::set_date($postid, $date); |
|
65 | 65 | |
66 | 66 | |
67 | - do_action( 'lasso_post_updated', $postid, $slug, $status, get_current_user_ID() ); |
|
67 | + do_action('lasso_post_updated', $postid, $slug, $status, get_current_user_ID()); |
|
68 | 68 | |
69 | 69 | return true; |
70 | 70 | |
@@ -78,8 +78,8 @@ discard block |
||
78 | 78 | * |
79 | 79 | * @return array Array of keys to pull from $_POST per action and their sanitization callback |
80 | 80 | */ |
81 | - public static function params(){ |
|
82 | - $params[ 'process_update_object_post' ] = array( |
|
81 | + public static function params() { |
|
82 | + $params['process_update_object_post'] = array( |
|
83 | 83 | 'postid' => 'absint', |
84 | 84 | 'status' => 'strip_tags', |
85 | 85 | 'story_slug' => array( |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * @return array Array of additional functions to use to authorize action. |
118 | 118 | */ |
119 | 119 | public static function auth_callbacks() { |
120 | - $params[ 'process_update_object_post' ] = array( |
|
120 | + $params['process_update_object_post'] = array( |
|
121 | 121 | 'lasso_user_can' |
122 | 122 | ); |
123 | 123 | |
@@ -139,14 +139,14 @@ discard block |
||
139 | 139 | * |
140 | 140 | * @return bool True if update was successful, false if not. |
141 | 141 | */ |
142 | - public function set_post_terms( $postid, $value, $taxonomy ) { |
|
143 | - if( $value ) { |
|
142 | + public function set_post_terms($postid, $value, $taxonomy) { |
|
143 | + if ($value) { |
|
144 | 144 | // first check if multiple, make array if so. |
145 | - if ( self::has_multiple_objects( $value ) ) { |
|
146 | - $value = explode( ',', $value ); |
|
145 | + if (self::has_multiple_objects($value)) { |
|
146 | + $value = explode(',', $value); |
|
147 | 147 | } |
148 | 148 | |
149 | - if ($taxonomy =='category') { |
|
149 | + if ($taxonomy == 'category') { |
|
150 | 150 | // convert from names to category ids |
151 | 151 | $cats = array(); |
152 | 152 | if (is_array($value)) { |
@@ -159,17 +159,17 @@ discard block |
||
159 | 159 | } |
160 | 160 | } |
161 | 161 | |
162 | - $result = wp_set_object_terms( $postid, $value, $taxonomy ); |
|
162 | + $result = wp_set_object_terms($postid, $value, $taxonomy); |
|
163 | 163 | } |
164 | - else { |
|
164 | + else { |
|
165 | 165 | //remove all terms from post |
166 | - $result = wp_set_object_terms( $postid, null, $taxonomy ); |
|
166 | + $result = wp_set_object_terms($postid, null, $taxonomy); |
|
167 | 167 | |
168 | 168 | } |
169 | 169 | |
170 | - if ( ! is_wp_error( $result ) ) { |
|
170 | + if (!is_wp_error($result)) { |
|
171 | 171 | return true; |
172 | - }else{ |
|
172 | + } else { |
|
173 | 173 | return false; |
174 | 174 | } |
175 | 175 | } |
@@ -184,12 +184,12 @@ discard block |
||
184 | 184 | * |
185 | 185 | * @return bool True if update was successful, false if not. |
186 | 186 | */ |
187 | - public function set_custom_taxonomy( $postid, $value) { |
|
187 | + public function set_custom_taxonomy($postid, $value) { |
|
188 | 188 | |
189 | - if( $value ) { |
|
189 | + if ($value) { |
|
190 | 190 | // first check if multiple, make array if so. |
191 | - if ( self::has_multiple_objects( $value ) ) { |
|
192 | - $value = explode( ',', $value ); |
|
191 | + if (self::has_multiple_objects($value)) { |
|
192 | + $value = explode(',', $value); |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | // Deleting first array item |
@@ -201,24 +201,24 @@ discard block |
||
201 | 201 | $value = $cats; |
202 | 202 | |
203 | 203 | |
204 | - $result = wp_set_object_terms( $postid, $cats, $taxonomy ); |
|
205 | - if ( ! is_wp_error( $result ) ) { |
|
204 | + $result = wp_set_object_terms($postid, $cats, $taxonomy); |
|
205 | + if (!is_wp_error($result)) { |
|
206 | 206 | return true; |
207 | - }else{ |
|
207 | + } else { |
|
208 | 208 | return false; |
209 | 209 | } |
210 | 210 | } |
211 | 211 | } |
212 | 212 | |
213 | - public function set_date( $postid, $value) { |
|
213 | + public function set_date($postid, $value) { |
|
214 | 214 | |
215 | - if( $value ) { |
|
215 | + if ($value) { |
|
216 | 216 | $time = current_time('mysql'); |
217 | 217 | wp_update_post( |
218 | - array ( |
|
218 | + array( |
|
219 | 219 | 'ID' => $postid, // ID of the post to update |
220 | - 'post_date' => date( 'Y-m-d H:i:s', strtotime($value) ), |
|
221 | - 'post_date_gmt' => gmdate( 'Y-m-d H:i:s', strtotime($value) ), |
|
220 | + 'post_date' => date('Y-m-d H:i:s', strtotime($value)), |
|
221 | + 'post_date_gmt' => gmdate('Y-m-d H:i:s', strtotime($value)), |
|
222 | 222 | ) |
223 | 223 | ); |
224 | 224 | } |
@@ -232,9 +232,9 @@ discard block |
||
232 | 232 | * @return bool True if there are multiple terms; otherwise, false. |
233 | 233 | * @since 0.9.3 |
234 | 234 | */ |
235 | - public function has_multiple_objects( $value ) { |
|
235 | + public function has_multiple_objects($value) { |
|
236 | 236 | |
237 | - return 0 < strpos( $value, ',' ); |
|
237 | + return 0 < strpos($value, ','); |
|
238 | 238 | |
239 | 239 | } |
240 | 240 |
@@ -160,8 +160,7 @@ discard block |
||
160 | 160 | } |
161 | 161 | |
162 | 162 | $result = wp_set_object_terms( $postid, $value, $taxonomy ); |
163 | - } |
|
164 | - else { |
|
163 | + } else { |
|
165 | 164 | //remove all terms from post |
166 | 165 | $result = wp_set_object_terms( $postid, null, $taxonomy ); |
167 | 166 | |
@@ -169,7 +168,7 @@ discard block |
||
169 | 168 | |
170 | 169 | if ( ! is_wp_error( $result ) ) { |
171 | 170 | return true; |
172 | - }else{ |
|
171 | + } else{ |
|
173 | 172 | return false; |
174 | 173 | } |
175 | 174 | } |
@@ -204,7 +203,7 @@ discard block |
||
204 | 203 | $result = wp_set_object_terms( $postid, $cats, $taxonomy ); |
205 | 204 | if ( ! is_wp_error( $result ) ) { |
206 | 205 | return true; |
207 | - }else{ |
|
206 | + } else{ |
|
208 | 207 | return false; |
209 | 208 | } |
210 | 209 | } |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $postid = get_the_ID(); |
82 | 82 | |
83 | 83 | $post_date = get_the_time('U', $postid); |
84 | - $delta = time() - $post_date; |
|
84 | + $delta = time() - $post_date; |
|
85 | 85 | |
86 | 86 | $strings = array( |
87 | 87 | 'save' => __('Save','lasso'), |
@@ -127,11 +127,11 @@ discard block |
||
127 | 127 | $gallery_nonce = wp_create_nonce( $gallery_nonce_action ); |
128 | 128 | |
129 | 129 | |
130 | - if ($allow_change_date) { |
|
131 | - $permalink = get_site_url().'/?p='.$postid; |
|
132 | - } else { |
|
133 | - $permalink = get_permalink($postid); |
|
134 | - } |
|
130 | + if ($allow_change_date) { |
|
131 | + $permalink = get_site_url().'/?p='.$postid; |
|
132 | + } else { |
|
133 | + $permalink = get_permalink($postid); |
|
134 | + } |
|
135 | 135 | |
136 | 136 | // rest api |
137 | 137 | $rest_nonce = ''; |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | |
228 | 228 | |
229 | 229 | if (!$using_restapiv2) { |
230 | - // enqueue REST API V1 |
|
230 | + // enqueue REST API V1 |
|
231 | 231 | wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true ); |
232 | 232 | $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) ); |
233 | 233 | wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings ); |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | if ($show_color) { |
244 | 244 | wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true); |
245 | 245 | } else { |
246 | - wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
246 | + wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
247 | 247 | } |
248 | 248 | wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) ); |
249 | 249 |
@@ -10,15 +10,15 @@ discard block |
||
10 | 10 | |
11 | 11 | class assets { |
12 | 12 | |
13 | - public function __construct(){ |
|
13 | + public function __construct() { |
|
14 | 14 | |
15 | - add_action('wp_enqueue_scripts', array($this,'scripts')); |
|
15 | + add_action('wp_enqueue_scripts', array($this, 'scripts')); |
|
16 | 16 | } |
17 | 17 | |
18 | - public function scripts(){ |
|
18 | + public function scripts() { |
|
19 | 19 | |
20 | 20 | |
21 | - if ( lasso_user_can('edit_posts')) { |
|
21 | + if (lasso_user_can('edit_posts')) { |
|
22 | 22 | |
23 | 23 | wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true); |
24 | 24 | |
@@ -33,27 +33,27 @@ discard block |
||
33 | 33 | // url for json api |
34 | 34 | $home_url = function_exists('json_get_url_prefix') ? json_get_url_prefix() : false; |
35 | 35 | |
36 | - $article_object = lasso_editor_get_option('article_class','lasso_editor'); |
|
36 | + $article_object = lasso_editor_get_option('article_class', 'lasso_editor'); |
|
37 | 37 | |
38 | - $article_object = empty( $article_object ) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object; |
|
38 | + $article_object = empty($article_object) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object; |
|
39 | 39 | |
40 | - $featImgClass = lasso_editor_get_option('featimg_class','lasso_editor'); |
|
41 | - if (empty( $featImgClass )) { |
|
40 | + $featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor'); |
|
41 | + if (empty($featImgClass)) { |
|
42 | 42 | $featImgClass = lasso_get_supported_theme_featured_image_class(); |
43 | 43 | } |
44 | - $titleClass = lasso_editor_get_option('title_class','lasso_editor'); |
|
45 | - if (empty( $titleClass )) { |
|
44 | + $titleClass = lasso_editor_get_option('title_class', 'lasso_editor'); |
|
45 | + if (empty($titleClass)) { |
|
46 | 46 | $titleClass = lasso_get_supported_theme_title_class(); |
47 | 47 | } |
48 | - $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
49 | - $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
48 | + $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
49 | + $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
50 | 50 | $objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor'); |
51 | - $objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor'); |
|
51 | + $objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor'); |
|
52 | 52 | $disableRESTSave = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor'); |
53 | - $save_to_post_disabled = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' ); |
|
53 | + $save_to_post_disabled = lasso_editor_get_option('post_save_disabled', 'lasso_editor'); |
|
54 | 54 | |
55 | - $bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor','b'); |
|
56 | - $i_tag = lasso_editor_get_option('i_tag', 'lasso_editor','i'); |
|
55 | + $bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor', 'b'); |
|
56 | + $i_tag = lasso_editor_get_option('i_tag', 'lasso_editor', 'i'); |
|
57 | 57 | |
58 | 58 | |
59 | 59 | //text alignement |
@@ -67,13 +67,13 @@ discard block |
||
67 | 67 | |
68 | 68 | if ($show_color) { |
69 | 69 | //color picker |
70 | - wp_enqueue_style( 'wp-color-picker' ); |
|
71 | - wp_enqueue_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 ); |
|
70 | + wp_enqueue_style('wp-color-picker'); |
|
71 | + wp_enqueue_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), false, 1); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | // custom fields |
75 | 75 | |
76 | - $custom_fields = apply_filters( 'editus_custom_fields', null ); //array('testFieldName' => '#field1'); |
|
76 | + $custom_fields = apply_filters('editus_custom_fields', null); //array('testFieldName' => '#field1'); |
|
77 | 77 | |
78 | 78 | |
79 | 79 | |
@@ -84,47 +84,47 @@ discard block |
||
84 | 84 | $delta = time() - $post_date; |
85 | 85 | |
86 | 86 | $strings = array( |
87 | - 'save' => __('Save','lasso'), |
|
88 | - 'saving' => __('Saving...','lasso'), |
|
89 | - 'saved' => __('Saved!','lasso'), |
|
90 | - 'adding' => __('Adding...','lasso'), |
|
91 | - 'added' => __('Added!','lasso'), |
|
92 | - 'loading' => __('Loading...','lasso'), |
|
93 | - 'loadMore' => __('Load More','lasso'), |
|
94 | - 'noPostsFound' => __('No more posts found','lasso'), |
|
95 | - 'fetchFail' => __('Fetching failed.','lasso'), |
|
96 | - 'galleryCreated' => __('Gallery Created!','lasso'), |
|
97 | - 'galleryUpdated' => __('Gallery Updated!','lasso'), |
|
98 | - 'justWrite' => __('Just write...','lasso'), |
|
99 | - 'chooseImage' => __('Choose an image','lasso'), |
|
100 | - 'updateImage' => __('Update Image','lasso'), |
|
101 | - 'insertImage' => __('Insert Image','lasso'), |
|
102 | - 'selectImage' => __('Select Image','lasso'), |
|
103 | - 'removeFeatImg' => __('Remove featured image?','lasso'), |
|
104 | - 'updateSelectedImg' => __('Update Selected Image','lasso'), |
|
105 | - 'chooseImages' => __('Choose images','lasso'), |
|
106 | - 'editImage' => __('Edit Image','lasso'), |
|
107 | - 'addImages' => __('Add Images','lasso'), |
|
108 | - 'addNewGallery' => __('Add New Gallery','lasso'), |
|
109 | - 'selectGallery' => __('Select Lasso Gallery Image','lasso'), |
|
110 | - 'useSelectedImages' => __('Use Selected Images','lasso'), |
|
111 | - 'publishPost' => __('Publish Post?','lasso'), |
|
112 | - 'publishYes' => __('Yes, publish it!','lasso'), |
|
113 | - 'deletePost' => __('Trash Post?','lasso'), |
|
114 | - 'deleteYes' => __('Yes, trash it!','lasso'), |
|
115 | - 'warning' => __('Oh snap!','laso'), |
|
116 | - 'cancelText' => __('O.K. got it!','lasso'), |
|
117 | - 'missingClass' => __('It looks like we are either missing the Article CSS class, or it is configured incorrectly. Editus will not function correctly without this CSS class.','lasso'), |
|
87 | + 'save' => __('Save', 'lasso'), |
|
88 | + 'saving' => __('Saving...', 'lasso'), |
|
89 | + 'saved' => __('Saved!', 'lasso'), |
|
90 | + 'adding' => __('Adding...', 'lasso'), |
|
91 | + 'added' => __('Added!', 'lasso'), |
|
92 | + 'loading' => __('Loading...', 'lasso'), |
|
93 | + 'loadMore' => __('Load More', 'lasso'), |
|
94 | + 'noPostsFound' => __('No more posts found', 'lasso'), |
|
95 | + 'fetchFail' => __('Fetching failed.', 'lasso'), |
|
96 | + 'galleryCreated' => __('Gallery Created!', 'lasso'), |
|
97 | + 'galleryUpdated' => __('Gallery Updated!', 'lasso'), |
|
98 | + 'justWrite' => __('Just write...', 'lasso'), |
|
99 | + 'chooseImage' => __('Choose an image', 'lasso'), |
|
100 | + 'updateImage' => __('Update Image', 'lasso'), |
|
101 | + 'insertImage' => __('Insert Image', 'lasso'), |
|
102 | + 'selectImage' => __('Select Image', 'lasso'), |
|
103 | + 'removeFeatImg' => __('Remove featured image?', 'lasso'), |
|
104 | + 'updateSelectedImg' => __('Update Selected Image', 'lasso'), |
|
105 | + 'chooseImages' => __('Choose images', 'lasso'), |
|
106 | + 'editImage' => __('Edit Image', 'lasso'), |
|
107 | + 'addImages' => __('Add Images', 'lasso'), |
|
108 | + 'addNewGallery' => __('Add New Gallery', 'lasso'), |
|
109 | + 'selectGallery' => __('Select Lasso Gallery Image', 'lasso'), |
|
110 | + 'useSelectedImages' => __('Use Selected Images', 'lasso'), |
|
111 | + 'publishPost' => __('Publish Post?', 'lasso'), |
|
112 | + 'publishYes' => __('Yes, publish it!', 'lasso'), |
|
113 | + 'deletePost' => __('Trash Post?', 'lasso'), |
|
114 | + 'deleteYes' => __('Yes, trash it!', 'lasso'), |
|
115 | + 'warning' => __('Oh snap!', 'laso'), |
|
116 | + 'cancelText' => __('O.K. got it!', 'lasso'), |
|
117 | + 'missingClass' => __('It looks like we are either missing the Article CSS class, or it is configured incorrectly. Editus will not function correctly without this CSS class.', 'lasso'), |
|
118 | 118 | 'missingConfirm' => __('Update Settings', 'lasso'), |
119 | - 'helperText' => __('one more letter','lasso'), |
|
119 | + 'helperText' => __('one more letter', 'lasso'), |
|
120 | 120 | 'editingBackup' => __('You are currently editing a backup copy of this post.'), |
121 | 121 | ); |
122 | 122 | |
123 | - $api_url = trailingslashit( home_url() ) . 'lasso-internal-api'; |
|
123 | + $api_url = trailingslashit(home_url()).'lasso-internal-api'; |
|
124 | 124 | |
125 | 125 | $gallery_class = new gallery(); |
126 | 126 | $gallery_nonce_action = $gallery_class->nonce_action; |
127 | - $gallery_nonce = wp_create_nonce( $gallery_nonce_action ); |
|
127 | + $gallery_nonce = wp_create_nonce($gallery_nonce_action); |
|
128 | 128 | |
129 | 129 | |
130 | 130 | if ($allow_change_date) { |
@@ -139,13 +139,13 @@ discard block |
||
139 | 139 | |
140 | 140 | if (function_exists('rest_url')) { |
141 | 141 | //$rest_root = esc_url_raw( rest_url()); |
142 | - $rest_nonce = wp_create_nonce( 'wp_rest' ); |
|
143 | - $settings = array( 'root' => $rest_root, 'nonce' => $rest_nonce ); |
|
144 | - wp_enqueue_script( 'wp-api', '', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true ); |
|
145 | - wp_localize_script( 'wp-api', 'wpApiSettings', $settings ); |
|
146 | - wp_localize_script( 'wp-api', 'WP_API_Settings', $settings ); |
|
142 | + $rest_nonce = wp_create_nonce('wp_rest'); |
|
143 | + $settings = array('root' => $rest_root, 'nonce' => $rest_nonce); |
|
144 | + wp_enqueue_script('wp-api', '', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true); |
|
145 | + wp_localize_script('wp-api', 'wpApiSettings', $settings); |
|
146 | + wp_localize_script('wp-api', 'WP_API_Settings', $settings); |
|
147 | 147 | |
148 | - if ( class_exists( 'WP_REST_Controller' )) { |
|
148 | + if (class_exists('WP_REST_Controller')) { |
|
149 | 149 | // we are using REST API V2 |
150 | 150 | $using_restapiv2 = true; |
151 | 151 | } |
@@ -153,8 +153,8 @@ discard block |
||
153 | 153 | |
154 | 154 | // localized objects |
155 | 155 | $objects = array( |
156 | - 'ajaxurl' => esc_url( $api_url ), |
|
157 | - 'ajaxurl2' => esc_url( admin_url( 'admin-ajax.php' )), |
|
156 | + 'ajaxurl' => esc_url($api_url), |
|
157 | + 'ajaxurl2' => esc_url(admin_url('admin-ajax.php')), |
|
158 | 158 | 'rest_root' => $rest_root, |
159 | 159 | 'rest_nonce' => $rest_nonce, |
160 | 160 | 'editor' => 'lasso--content', // ID of editable content (without #) DONT CHANGE |
@@ -162,13 +162,13 @@ discard block |
||
162 | 162 | 'featImgClass' => $featImgClass, |
163 | 163 | 'titleClass' => $titleClass, |
164 | 164 | 'strings' => $strings, |
165 | - 'settingsLink' => function_exists('is_multisite') && is_multisite() ? network_admin_url( 'settings.php?page=lasso-editor' ) : admin_url( 'admin.php?page=lasso-editor-settings' ), |
|
166 | - 'post_status' => get_post_status( $postid ), |
|
165 | + 'settingsLink' => function_exists('is_multisite') && is_multisite() ? network_admin_url('settings.php?page=lasso-editor') : admin_url('admin.php?page=lasso-editor-settings'), |
|
166 | + 'post_status' => get_post_status($postid), |
|
167 | 167 | 'postid' => $postid, |
168 | 168 | 'permalink' => $permalink, |
169 | 169 | 'edit_others_pages' => current_user_can('edit_others_pages') ? true : false, |
170 | 170 | 'edit_others_posts' => current_user_can('edit_others_posts') ? true : false, |
171 | - 'userCanEdit' => current_user_can('edit_post', $postid ), |
|
171 | + 'userCanEdit' => current_user_can('edit_post', $postid), |
|
172 | 172 | 'can_publish_posts' => current_user_can('publish_posts'), |
173 | 173 | 'can_publish_pages' => current_user_can('publish_pages'), |
174 | 174 | 'author' => is_user_logged_in() ? get_current_user_ID() : false, |
@@ -203,24 +203,24 @@ discard block |
||
203 | 203 | 'postTags' => lasso_get_objects('tag'), |
204 | 204 | 'noResultsDiv' => lasso_editor_empty_results(), |
205 | 205 | 'noRevisionsDiv' => lasso_editor_empty_results('revision'), |
206 | - 'mapTileProvider' => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider( $postid ) : false, |
|
207 | - 'mapLocations' => get_post_meta( $postid, 'ase_map_component_locations' ), |
|
208 | - 'mapStart' => get_post_meta( $postid, 'ase_map_component_start_point', true ), |
|
209 | - 'mapZoom' => get_post_meta( $postid, 'ase_map_component_zoom', true ), |
|
206 | + 'mapTileProvider' => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider($postid) : false, |
|
207 | + 'mapLocations' => get_post_meta($postid, 'ase_map_component_locations'), |
|
208 | + 'mapStart' => get_post_meta($postid, 'ase_map_component_start_point', true), |
|
209 | + 'mapZoom' => get_post_meta($postid, 'ase_map_component_zoom', true), |
|
210 | 210 | 'revisionModal' => lasso_editor_revision_modal(), |
211 | 211 | 'isMobile' => wp_is_mobile(), |
212 | - 'enableAutoSave' => lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ), |
|
212 | + 'enableAutoSave' => lasso_editor_get_option('enable_autosave', 'lasso_editor'), |
|
213 | 213 | 'showColor' => $show_color, |
214 | 214 | 'showAlignment' => $show_align, |
215 | 215 | 'showIgnoredItems' => lasso_editor_get_option('show_ignored_items', 'lasso_editor'), |
216 | 216 | 'restapi2' => $using_restapiv2, |
217 | 217 | 'saveusingrest' => $using_restapiv2 && !$disableRESTSave, |
218 | - 'newObjectContent' => apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso') ), |
|
218 | + 'newObjectContent' => apply_filters('lasso_new_object_content', __('Once upon a time...', 'lasso')), |
|
219 | 219 | 'disableSavePost' => $save_to_post_disabled, |
220 | 220 | 'boldTag' => $bold_tag, |
221 | 221 | 'iTag' => $i_tag, |
222 | 222 | 'customFields' => $custom_fields, |
223 | - 'skipToEdit' =>( $delta < 30 ) // if it's a new post, skip to edit mode |
|
223 | + 'skipToEdit' =>($delta < 30) // if it's a new post, skip to edit mode |
|
224 | 224 | ); |
225 | 225 | |
226 | 226 | |
@@ -229,9 +229,9 @@ discard block |
||
229 | 229 | |
230 | 230 | if (!$using_restapiv2) { |
231 | 231 | // enqueue REST API V1 |
232 | - wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true ); |
|
233 | - $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) ); |
|
234 | - wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings ); |
|
232 | + wp_enqueue_script('wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true); |
|
233 | + $settings = array('root' => home_url($home_url), 'nonce' => wp_create_nonce('wp_json')); |
|
234 | + wp_localize_script('wp-api-js', 'WP_API_Settings', $settings); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | if ($allow_change_date) { |
@@ -240,13 +240,13 @@ discard block |
||
240 | 240 | wp_enqueue_style('jquery-ui'); |
241 | 241 | } |
242 | 242 | |
243 | - $postfix = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? '' : '.min'; |
|
243 | + $postfix = (defined('SCRIPT_DEBUG') && true === SCRIPT_DEBUG) ? '' : '.min'; |
|
244 | 244 | if ($show_color) { |
245 | - wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true); |
|
245 | + wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api', 'iris'), LASSO_VERSION, true); |
|
246 | 246 | } else { |
247 | - wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
247 | + wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
248 | 248 | } |
249 | - wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) ); |
|
249 | + wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects)); |
|
250 | 250 | |
251 | 251 | |
252 | 252 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | * |
77 | 77 | * @since 0.0.1 |
78 | 78 | * |
79 | - * @return Plugin slug variable. |
|
79 | + * @return string slug variable. |
|
80 | 80 | */ |
81 | 81 | public function get_plugin_slug() { |
82 | 82 | return $this->plugin_slug; |
@@ -330,6 +330,9 @@ discard block |
||
330 | 330 | exit; |
331 | 331 | } |
332 | 332 | |
333 | + /** |
|
334 | + * @param string $type |
|
335 | + */ |
|
333 | 336 | public static function enable_metasave($type) |
334 | 337 | { |
335 | 338 | register_rest_field( $type, 'metadata', array( |
@@ -422,6 +425,10 @@ discard block |
||
422 | 425 | |
423 | 426 | exit; |
424 | 427 | } |
428 | + |
|
429 | + /** |
|
430 | + * @param string $taxonomy |
|
431 | + */ |
|
425 | 432 | public function set_post_terms( $postid, $value, $taxonomy ) { |
426 | 433 | if( $value ) { |
427 | 434 | $value = explode( ',', $value ); |
@@ -261,14 +261,14 @@ discard block |
||
261 | 261 | $out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' ); |
262 | 262 | } |
263 | 263 | |
264 | - // new ajax function to lock post for editing |
|
264 | + // new ajax function to lock post for editing |
|
265 | 265 | public function editus_lock_post() |
266 | 266 | { |
267 | 267 | $post_id= $_POST["postid"]; |
268 | 268 | $locked = wp_check_post_lock($post_id); |
269 | 269 | |
270 | 270 | if (!$locked) { |
271 | - wp_set_post_lock($post_id); |
|
271 | + wp_set_post_lock($post_id); |
|
272 | 272 | echo "true"; |
273 | 273 | } else { |
274 | 274 | $user_info = get_userdata($locked); |
@@ -365,59 +365,59 @@ discard block |
||
365 | 365 | ); |
366 | 366 | foreach ($_POST as $key => $value) { |
367 | 367 | if ($key !="code" && $key !="action") { |
368 | - //$shortcode = $shortcode.$key.'="'.$value.'" '; |
|
368 | + //$shortcode = $shortcode.$key.'="'.$value.'" '; |
|
369 | 369 | $atts[$key] = $value; |
370 | 370 | } |
371 | 371 | } |
372 | 372 | if ($code == "aesop_video") { |
373 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
374 | - echo aesop_video_shortcode($atts); |
|
373 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
374 | + echo aesop_video_shortcode($atts); |
|
375 | 375 | } |
376 | 376 | else if ($code == "aesop_image") { |
377 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
378 | - echo aesop_image_shortcode($atts); |
|
377 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
378 | + echo aesop_image_shortcode($atts); |
|
379 | 379 | } |
380 | 380 | else if ($code == "aesop_quote") { |
381 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
382 | - echo aesop_quote_shortcode($atts); |
|
381 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
382 | + echo aesop_quote_shortcode($atts); |
|
383 | 383 | } |
384 | 384 | else if ($code == "aesop_parallax") { |
385 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
386 | - echo aesop_parallax_shortcode($atts); |
|
385 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
386 | + echo aesop_parallax_shortcode($atts); |
|
387 | 387 | } |
388 | 388 | else if ($code == "aesop_character") { |
389 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
390 | - echo aesop_character_shortcode($atts); |
|
389 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
390 | + echo aesop_character_shortcode($atts); |
|
391 | 391 | } |
392 | 392 | else if ($code == "aesop_collection") { |
393 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
394 | - echo aesop_collection_shortcode($atts); |
|
393 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
394 | + echo aesop_collection_shortcode($atts); |
|
395 | 395 | } |
396 | 396 | else if ($code == "aesop_chapter") { |
397 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
398 | - echo aesop_chapter_shortcode($atts); |
|
397 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
398 | + echo aesop_chapter_shortcode($atts); |
|
399 | 399 | } |
400 | 400 | else if ($code == "aesop_content") { |
401 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
402 | - echo aesop_content_shortcode($atts, $atts['content_data']); |
|
401 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
402 | + echo aesop_content_shortcode($atts, $atts['content_data']); |
|
403 | 403 | } |
404 | 404 | else if ($code == "aesop_gallery") { |
405 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
406 | - echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
405 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
406 | + echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
407 | 407 | } |
408 | 408 | else if ($code == "aesop_audio") { |
409 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
410 | - echo aesop_audio_shortcode($atts); |
|
409 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
410 | + echo aesop_audio_shortcode($atts); |
|
411 | 411 | } |
412 | 412 | else { |
413 | 413 | $code = '['.$code.' '; |
414 | 414 | foreach ($atts as $key => $value) { |
415 | - $code = ''.$key.'="'.$value.'" '; |
|
415 | + $code = ''.$key.'="'.$value.'" '; |
|
416 | 416 | } |
417 | 417 | $code = $code.']'; |
418 | 418 | echo do_shortcode($code); |
419 | - //require_once( ABSPATH . '/wp-content/plugins/aesop-events/public/includes/shortcode.php'); |
|
420 | - //echo aesop_audio_shortcode($atts); |
|
419 | + //require_once( ABSPATH . '/wp-content/plugins/aesop-events/public/includes/shortcode.php'); |
|
420 | + //echo aesop_audio_shortcode($atts); |
|
421 | 421 | } |
422 | 422 | |
423 | 423 | exit; |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | $value = explode( ',', $value ); |
428 | 428 | |
429 | 429 | if ($taxonomy =='category') { |
430 | - // convert from names to category ids |
|
430 | + // convert from names to category ids |
|
431 | 431 | $cats = array(); |
432 | 432 | foreach ($value as $cat) { |
433 | 433 | $cats [] = get_cat_ID($cat); |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | |
452 | 452 | public function set_date( $postid, $value) { |
453 | 453 | if( $value ) { |
454 | - wp_update_post( |
|
454 | + wp_update_post( |
|
455 | 455 | array ( |
456 | 456 | 'ID' => $postid, // ID of the post to update |
457 | 457 | 'post_date' => date( 'Y-m-d H:i:s', strtotime($value) ), |
@@ -52,16 +52,16 @@ discard block |
||
52 | 52 | require_once LASSO_DIR.'/public/includes/wrap-shortcodes.php'; |
53 | 53 | |
54 | 54 | // Activate plugin when new blog is added |
55 | - add_action( 'wpmu_new_blog', array( $this, 'activate_new_site' ) ); |
|
55 | + add_action('wpmu_new_blog', array($this, 'activate_new_site')); |
|
56 | 56 | |
57 | 57 | // Load plugin text domain |
58 | - add_action( 'init', array( $this, 'load_plugin_textdomain' ) ); |
|
58 | + add_action('init', array($this, 'load_plugin_textdomain')); |
|
59 | 59 | |
60 | - add_action( 'wp_ajax_get_aesop_component', array( $this, 'get_aesop_component' ) ); |
|
61 | - add_action( 'wp_ajax_editus_do_shortcode', array( $this, 'editus_do_shortcode' ) ); |
|
62 | - add_action( 'wp_ajax_editus_lock_post', array( $this, 'editus_lock_post' ) ); |
|
63 | - add_action( 'wp_ajax_editus_hide_tour', array( $this, 'editus_hide_tour' ) ); |
|
64 | - add_action( 'wp_ajax_editus_set_post_setting', array( $this, 'editus_set_post_setting' ) ); |
|
60 | + add_action('wp_ajax_get_aesop_component', array($this, 'get_aesop_component')); |
|
61 | + add_action('wp_ajax_editus_do_shortcode', array($this, 'editus_do_shortcode')); |
|
62 | + add_action('wp_ajax_editus_lock_post', array($this, 'editus_lock_post')); |
|
63 | + add_action('wp_ajax_editus_hide_tour', array($this, 'editus_hide_tour')); |
|
64 | + add_action('wp_ajax_editus_set_post_setting', array($this, 'editus_set_post_setting')); |
|
65 | 65 | |
66 | 66 | // enable saving custom fields through REST API |
67 | 67 | self::enable_metasave('post'); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | public static function get_instance() { |
93 | 93 | |
94 | 94 | // If the single instance hasn't been set, set it now. |
95 | - if ( null == self::$instance ) { |
|
95 | + if (null == self::$instance) { |
|
96 | 96 | self::$instance = new self; |
97 | 97 | } |
98 | 98 | |
@@ -109,18 +109,18 @@ discard block |
||
109 | 109 | * WPMU is disabled or plugin is |
110 | 110 | * activated on an individual blog. |
111 | 111 | */ |
112 | - public static function activate( $network_wide ) { |
|
112 | + public static function activate($network_wide) { |
|
113 | 113 | |
114 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
114 | + if (function_exists('is_multisite') && is_multisite()) { |
|
115 | 115 | |
116 | - if ( $network_wide ) { |
|
116 | + if ($network_wide) { |
|
117 | 117 | |
118 | 118 | // Get all blog ids |
119 | 119 | $blog_ids = self::get_blog_ids(); |
120 | 120 | |
121 | - foreach ( $blog_ids as $blog_id ) { |
|
121 | + foreach ($blog_ids as $blog_id) { |
|
122 | 122 | |
123 | - switch_to_blog( $blog_id ); |
|
123 | + switch_to_blog($blog_id); |
|
124 | 124 | self::single_activate(); |
125 | 125 | } |
126 | 126 | |
@@ -146,18 +146,18 @@ discard block |
||
146 | 146 | * WPMU is disabled or plugin is |
147 | 147 | * deactivated on an individual blog. |
148 | 148 | */ |
149 | - public static function deactivate( $network_wide ) { |
|
149 | + public static function deactivate($network_wide) { |
|
150 | 150 | |
151 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
151 | + if (function_exists('is_multisite') && is_multisite()) { |
|
152 | 152 | |
153 | - if ( $network_wide ) { |
|
153 | + if ($network_wide) { |
|
154 | 154 | |
155 | 155 | // Get all blog ids |
156 | 156 | $blog_ids = self::get_blog_ids(); |
157 | 157 | |
158 | - foreach ( $blog_ids as $blog_id ) { |
|
158 | + foreach ($blog_ids as $blog_id) { |
|
159 | 159 | |
160 | - switch_to_blog( $blog_id ); |
|
160 | + switch_to_blog($blog_id); |
|
161 | 161 | self::single_deactivate(); |
162 | 162 | |
163 | 163 | } |
@@ -181,13 +181,13 @@ discard block |
||
181 | 181 | * |
182 | 182 | * @param int $blog_id ID of the new blog. |
183 | 183 | */ |
184 | - public function activate_new_site( $blog_id ) { |
|
184 | + public function activate_new_site($blog_id) { |
|
185 | 185 | |
186 | - if ( 1 !== did_action( 'wpmu_new_blog' ) ) { |
|
186 | + if (1 !== did_action('wpmu_new_blog')) { |
|
187 | 187 | return; |
188 | 188 | } |
189 | 189 | |
190 | - switch_to_blog( $blog_id ); |
|
190 | + switch_to_blog($blog_id); |
|
191 | 191 | self::single_activate(); |
192 | 192 | restore_current_blog(); |
193 | 193 | |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | WHERE archived = '0' AND spam = '0' |
213 | 213 | AND deleted = '0'"; |
214 | 214 | |
215 | - return $wpdb->get_col( $sql ); |
|
215 | + return $wpdb->get_col($sql); |
|
216 | 216 | |
217 | 217 | } |
218 | 218 | |
@@ -223,18 +223,18 @@ discard block |
||
223 | 223 | */ |
224 | 224 | private static function single_activate() { |
225 | 225 | |
226 | - $curr_version = get_option( 'lasso_version' ); |
|
226 | + $curr_version = get_option('lasso_version'); |
|
227 | 227 | |
228 | 228 | // update upgraded from |
229 | - if ( $curr_version ) { |
|
230 | - update_option( 'lasso_updated_from', $curr_version ); |
|
229 | + if ($curr_version) { |
|
230 | + update_option('lasso_updated_from', $curr_version); |
|
231 | 231 | } |
232 | 232 | |
233 | 233 | // update lasso version option |
234 | - update_option( 'lasso_version', LASSO_VERSION ); |
|
234 | + update_option('lasso_version', LASSO_VERSION); |
|
235 | 235 | |
236 | 236 | // set transietn for activation welcome |
237 | - set_transient( '_lasso_welcome_redirect', true, 30 ); |
|
237 | + set_transient('_lasso_welcome_redirect', true, 30); |
|
238 | 238 | |
239 | 239 | |
240 | 240 | } |
@@ -256,15 +256,15 @@ discard block |
||
256 | 256 | public function load_plugin_textdomain() { |
257 | 257 | |
258 | 258 | $domain = $this->plugin_slug; |
259 | - $locale = apply_filters( 'plugin_locale', get_locale(), $domain ); |
|
259 | + $locale = apply_filters('plugin_locale', get_locale(), $domain); |
|
260 | 260 | |
261 | - $out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' ); |
|
261 | + $out = load_textdomain($domain, trailingslashit(LASSO_DIR).'languages/'.$domain.'-'.$locale.'.mo'); |
|
262 | 262 | } |
263 | 263 | |
264 | 264 | // new ajax function to lock post for editing |
265 | 265 | public function editus_lock_post() |
266 | 266 | { |
267 | - $post_id= $_POST["postid"]; |
|
267 | + $post_id = $_POST["postid"]; |
|
268 | 268 | $locked = wp_check_post_lock($post_id); |
269 | 269 | |
270 | 270 | if (!$locked) { |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | echo "true"; |
273 | 273 | } else { |
274 | 274 | $user_info = get_userdata($locked); |
275 | - echo "Post opened by ".$user_info->first_name . " " . $user_info->last_name; |
|
275 | + echo "Post opened by ".$user_info->first_name." ".$user_info->last_name; |
|
276 | 276 | } |
277 | 277 | exit; |
278 | 278 | } |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | { |
283 | 283 | $user_id = get_current_user_ID(); |
284 | 284 | |
285 | - update_user_meta( $user_id, 'lasso_hide_tour', true ); |
|
285 | + update_user_meta($user_id, 'lasso_hide_tour', true); |
|
286 | 286 | exit; |
287 | 287 | } |
288 | 288 | |
@@ -293,14 +293,14 @@ discard block |
||
293 | 293 | $data = array(); |
294 | 294 | parse_str($_POST['data'], $data); |
295 | 295 | |
296 | - if (!wp_verify_nonce( $data[ 'nonce' ], 'lasso-update-post-settings' )) { |
|
296 | + if (!wp_verify_nonce($data['nonce'], 'lasso-update-post-settings')) { |
|
297 | 297 | wp_send_json_error(); |
298 | 298 | exit; |
299 | 299 | } |
300 | 300 | |
301 | - $status = isset( $data['status'] ) ? $data['status'] : false; |
|
302 | - $postid = isset( $data['postid'] ) ? $data['postid'] : false; |
|
303 | - $slug = isset( $data['story_slug'] ) ? $data['story_slug'] : false; |
|
301 | + $status = isset($data['status']) ? $data['status'] : false; |
|
302 | + $postid = isset($data['postid']) ? $data['postid'] : false; |
|
303 | + $slug = isset($data['story_slug']) ? $data['story_slug'] : false; |
|
304 | 304 | |
305 | 305 | |
306 | 306 | $args = array( |
@@ -311,32 +311,32 @@ discard block |
||
311 | 311 | |
312 | 312 | |
313 | 313 | |
314 | - wp_update_post( apply_filters( 'lasso_object_status_update_args', $args ) ); |
|
314 | + wp_update_post(apply_filters('lasso_object_status_update_args', $args)); |
|
315 | 315 | |
316 | 316 | // update categories |
317 | - $cats = isset( $data['story_cats'] ) ? $data['story_cats'] : false; |
|
318 | - self::set_post_terms( $postid, $cats, 'category' ); |
|
317 | + $cats = isset($data['story_cats']) ? $data['story_cats'] : false; |
|
318 | + self::set_post_terms($postid, $cats, 'category'); |
|
319 | 319 | |
320 | 320 | // update tags |
321 | - $tags = isset( $data['story_tags'] ) ? $data['story_tags'] : false; |
|
322 | - self::set_post_terms( $postid, $tags, 'post_tag' ); |
|
321 | + $tags = isset($data['story_tags']) ? $data['story_tags'] : false; |
|
322 | + self::set_post_terms($postid, $tags, 'post_tag'); |
|
323 | 323 | |
324 | 324 | //update date |
325 | - $date = isset( $data['post_date'] ) ? $data['post_date'] : false; |
|
326 | - self::set_date( $postid, $date ); |
|
325 | + $date = isset($data['post_date']) ? $data['post_date'] : false; |
|
326 | + self::set_date($postid, $date); |
|
327 | 327 | |
328 | - do_action( 'lasso_post_updated', $postid, $slug, $status, get_current_user_ID() ); |
|
328 | + do_action('lasso_post_updated', $postid, $slug, $status, get_current_user_ID()); |
|
329 | 329 | wp_send_json_success(); |
330 | 330 | exit; |
331 | 331 | } |
332 | 332 | |
333 | 333 | public static function enable_metasave($type) |
334 | 334 | { |
335 | - register_rest_field( $type, 'metadata', array( |
|
336 | - 'get_callback' => function ( $data ) { |
|
337 | - return get_post_meta( $data['id']);//, '', '' ); |
|
335 | + register_rest_field($type, 'metadata', array( |
|
336 | + 'get_callback' => function($data) { |
|
337 | + return get_post_meta($data['id']); //, '', '' ); |
|
338 | 338 | }, |
339 | - 'update_callback' => function( $data, $post ) { |
|
339 | + 'update_callback' => function($data, $post) { |
|
340 | 340 | foreach ($data as $key => $value) { |
341 | 341 | update_post_meta($post->ID, $key, $value); |
342 | 342 | } |
@@ -348,10 +348,10 @@ discard block |
||
348 | 348 | public function editus_do_shortcode() |
349 | 349 | { |
350 | 350 | |
351 | - $code= $_POST["code"]; |
|
351 | + $code = $_POST["code"]; |
|
352 | 352 | $code = str_replace('\"', '"', $code); |
353 | - $out = lasso_wrap_shortcodes( $code); |
|
354 | - $out = do_shortcode($out); |
|
353 | + $out = lasso_wrap_shortcodes($code); |
|
354 | + $out = do_shortcode($out); |
|
355 | 355 | echo $out; |
356 | 356 | exit; |
357 | 357 | } |
@@ -360,53 +360,53 @@ discard block |
||
360 | 360 | { |
361 | 361 | |
362 | 362 | |
363 | - $code= $_POST["code"]; |
|
363 | + $code = $_POST["code"]; |
|
364 | 364 | $atts = array( |
365 | 365 | ); |
366 | 366 | foreach ($_POST as $key => $value) { |
367 | - if ($key !="code" && $key !="action") { |
|
367 | + if ($key != "code" && $key != "action") { |
|
368 | 368 | //$shortcode = $shortcode.$key.'="'.$value.'" '; |
369 | 369 | $atts[$key] = $value; |
370 | 370 | } |
371 | 371 | } |
372 | 372 | if ($code == "aesop_video") { |
373 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
373 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
374 | 374 | echo aesop_video_shortcode($atts); |
375 | 375 | } |
376 | 376 | else if ($code == "aesop_image") { |
377 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
377 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
378 | 378 | echo aesop_image_shortcode($atts); |
379 | 379 | } |
380 | 380 | else if ($code == "aesop_quote") { |
381 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
381 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
382 | 382 | echo aesop_quote_shortcode($atts); |
383 | 383 | } |
384 | 384 | else if ($code == "aesop_parallax") { |
385 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
385 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
386 | 386 | echo aesop_parallax_shortcode($atts); |
387 | 387 | } |
388 | 388 | else if ($code == "aesop_character") { |
389 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
389 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
390 | 390 | echo aesop_character_shortcode($atts); |
391 | 391 | } |
392 | 392 | else if ($code == "aesop_collection") { |
393 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
393 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
394 | 394 | echo aesop_collection_shortcode($atts); |
395 | 395 | } |
396 | 396 | else if ($code == "aesop_chapter") { |
397 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
397 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
398 | 398 | echo aesop_chapter_shortcode($atts); |
399 | 399 | } |
400 | 400 | else if ($code == "aesop_content") { |
401 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
401 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
402 | 402 | echo aesop_content_shortcode($atts, $atts['content_data']); |
403 | 403 | } |
404 | 404 | else if ($code == "aesop_gallery") { |
405 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
406 | - echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
405 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
406 | + echo do_shortcode('[aesop_gallery id="'.$atts["id"].'"]'); |
|
407 | 407 | } |
408 | 408 | else if ($code == "aesop_audio") { |
409 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
409 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
410 | 410 | echo aesop_audio_shortcode($atts); |
411 | 411 | } |
412 | 412 | else { |
@@ -422,11 +422,11 @@ discard block |
||
422 | 422 | |
423 | 423 | exit; |
424 | 424 | } |
425 | - public function set_post_terms( $postid, $value, $taxonomy ) { |
|
426 | - if( $value ) { |
|
427 | - $value = explode( ',', $value ); |
|
425 | + public function set_post_terms($postid, $value, $taxonomy) { |
|
426 | + if ($value) { |
|
427 | + $value = explode(',', $value); |
|
428 | 428 | |
429 | - if ($taxonomy =='category') { |
|
429 | + if ($taxonomy == 'category') { |
|
430 | 430 | // convert from names to category ids |
431 | 431 | $cats = array(); |
432 | 432 | foreach ($value as $cat) { |
@@ -435,27 +435,27 @@ discard block |
||
435 | 435 | $value = $cats; |
436 | 436 | } |
437 | 437 | |
438 | - $result = wp_set_object_terms( $postid, $value, $taxonomy ); |
|
438 | + $result = wp_set_object_terms($postid, $value, $taxonomy); |
|
439 | 439 | } |
440 | - else { |
|
440 | + else { |
|
441 | 441 | //remove all terms from post |
442 | - $result = wp_set_object_terms( $postid, null, $taxonomy ); |
|
442 | + $result = wp_set_object_terms($postid, null, $taxonomy); |
|
443 | 443 | } |
444 | 444 | |
445 | - if ( ! is_wp_error( $result ) ) { |
|
445 | + if (!is_wp_error($result)) { |
|
446 | 446 | return true; |
447 | - }else{ |
|
447 | + } else { |
|
448 | 448 | return false; |
449 | 449 | } |
450 | 450 | } |
451 | 451 | |
452 | - public function set_date( $postid, $value) { |
|
453 | - if( $value ) { |
|
452 | + public function set_date($postid, $value) { |
|
453 | + if ($value) { |
|
454 | 454 | wp_update_post( |
455 | - array ( |
|
455 | + array( |
|
456 | 456 | 'ID' => $postid, // ID of the post to update |
457 | - 'post_date' => date( 'Y-m-d H:i:s', strtotime($value) ), |
|
458 | - 'post_date_gmt' => gmdate( 'Y-m-d H:i:s', strtotime($value) ), |
|
457 | + 'post_date' => date('Y-m-d H:i:s', strtotime($value)), |
|
458 | + 'post_date_gmt' => gmdate('Y-m-d H:i:s', strtotime($value)), |
|
459 | 459 | ) |
460 | 460 | ); |
461 | 461 | } |
@@ -372,44 +372,34 @@ discard block |
||
372 | 372 | if ($code == "aesop_video") { |
373 | 373 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
374 | 374 | echo aesop_video_shortcode($atts); |
375 | - } |
|
376 | - else if ($code == "aesop_image") { |
|
375 | + } else if ($code == "aesop_image") { |
|
377 | 376 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
378 | 377 | echo aesop_image_shortcode($atts); |
379 | - } |
|
380 | - else if ($code == "aesop_quote") { |
|
378 | + } else if ($code == "aesop_quote") { |
|
381 | 379 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
382 | 380 | echo aesop_quote_shortcode($atts); |
383 | - } |
|
384 | - else if ($code == "aesop_parallax") { |
|
381 | + } else if ($code == "aesop_parallax") { |
|
385 | 382 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
386 | 383 | echo aesop_parallax_shortcode($atts); |
387 | - } |
|
388 | - else if ($code == "aesop_character") { |
|
384 | + } else if ($code == "aesop_character") { |
|
389 | 385 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
390 | 386 | echo aesop_character_shortcode($atts); |
391 | - } |
|
392 | - else if ($code == "aesop_collection") { |
|
387 | + } else if ($code == "aesop_collection") { |
|
393 | 388 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
394 | 389 | echo aesop_collection_shortcode($atts); |
395 | - } |
|
396 | - else if ($code == "aesop_chapter") { |
|
390 | + } else if ($code == "aesop_chapter") { |
|
397 | 391 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
398 | 392 | echo aesop_chapter_shortcode($atts); |
399 | - } |
|
400 | - else if ($code == "aesop_content") { |
|
393 | + } else if ($code == "aesop_content") { |
|
401 | 394 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
402 | 395 | echo aesop_content_shortcode($atts, $atts['content_data']); |
403 | - } |
|
404 | - else if ($code == "aesop_gallery") { |
|
396 | + } else if ($code == "aesop_gallery") { |
|
405 | 397 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
406 | 398 | echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
407 | - } |
|
408 | - else if ($code == "aesop_audio") { |
|
399 | + } else if ($code == "aesop_audio") { |
|
409 | 400 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
410 | 401 | echo aesop_audio_shortcode($atts); |
411 | - } |
|
412 | - else { |
|
402 | + } else { |
|
413 | 403 | $code = '['.$code.' '; |
414 | 404 | foreach ($atts as $key => $value) { |
415 | 405 | $code = ''.$key.'="'.$value.'" '; |
@@ -436,15 +426,14 @@ discard block |
||
436 | 426 | } |
437 | 427 | |
438 | 428 | $result = wp_set_object_terms( $postid, $value, $taxonomy ); |
439 | - } |
|
440 | - else { |
|
429 | + } else { |
|
441 | 430 | //remove all terms from post |
442 | 431 | $result = wp_set_object_terms( $postid, null, $taxonomy ); |
443 | 432 | } |
444 | 433 | |
445 | 434 | if ( ! is_wp_error( $result ) ) { |
446 | 435 | return true; |
447 | - }else{ |
|
436 | + } else{ |
|
448 | 437 | return false; |
449 | 438 | } |
450 | 439 | } |