@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | if ( strpos( $m[2],'aesop_' ) === 0 ) { |
69 | 69 | // check against the exceptions |
70 | 70 | if (strpos_arr($m[2],$exception_arr1)===false) { |
71 | - return $m[0]; |
|
71 | + return $m[0]; |
|
72 | 72 | } |
73 | 73 | } |
74 | 74 | if (strpos_arr($m[2],$exception_arr2)!==false) { |
@@ -80,9 +80,9 @@ discard block |
||
80 | 80 | |
81 | 81 | /* a helper function */ |
82 | 82 | function strpos_arr($haystack, $needle) { |
83 | - if(!is_array($needle)) $needle = array($needle); |
|
84 | - foreach($needle as $what) { |
|
85 | - if(($pos = strpos($haystack, $what))!==false) return $pos; |
|
86 | - } |
|
87 | - return false; |
|
83 | + if(!is_array($needle)) $needle = array($needle); |
|
84 | + foreach($needle as $what) { |
|
85 | + if(($pos = strpos($haystack, $what))!==false) return $pos; |
|
86 | + } |
|
87 | + return false; |
|
88 | 88 | } |
89 | 89 | \ No newline at end of file |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | * @since 0.9.3 |
119 | 119 | * |
120 | 120 | * @param int $postid The current postid |
121 | - * @param string|bool $value The term slug, or a comma separated list of slugs. Or false to remove all terms set for post. |
|
121 | + * @param string|bool $value The term slug, or a comma separated list of slugs. Or false to remove all terms set for post. |
|
122 | 122 | * @param string $taxonomy The name of the taxonomy to which the term belongs. |
123 | 123 | * |
124 | 124 | * @return bool True if update was successful, false if not. |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | } |
132 | 132 | |
133 | 133 | if ($taxonomy =='category') { |
134 | - // convert from names to category ids |
|
134 | + // convert from names to category ids |
|
135 | 135 | $cats = array(); |
136 | 136 | if (is_array($value)) { |
137 | 137 | foreach ($value as $cat) { |
@@ -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 | } |
@@ -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 |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $postid = get_the_ID(); |
74 | 74 | |
75 | 75 | $post_date = get_the_time('U', $postid); |
76 | - $delta = time() - $post_date; |
|
76 | + $delta = time() - $post_date; |
|
77 | 77 | |
78 | 78 | $strings = array( |
79 | 79 | 'save' => __('Save','lasso'), |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | |
209 | 209 | |
210 | 210 | if (!$using_restapiv2) { |
211 | - // enqueue REST API V1 |
|
211 | + // enqueue REST API V1 |
|
212 | 212 | wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true ); |
213 | 213 | $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) ); |
214 | 214 | wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings ); |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | if ($show_color) { |
219 | 219 | wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true); |
220 | 220 | } else { |
221 | - wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
221 | + wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
222 | 222 | } |
223 | 223 | wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) ); |
224 | 224 |
@@ -259,14 +259,14 @@ discard block |
||
259 | 259 | $out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' ); |
260 | 260 | } |
261 | 261 | |
262 | - // new ajax function to lock post for editing |
|
262 | + // new ajax function to lock post for editing |
|
263 | 263 | public function editus_lock_post() |
264 | 264 | { |
265 | 265 | $post_id= $_POST["postid"]; |
266 | 266 | $locked = wp_check_post_lock($post_id); |
267 | 267 | |
268 | 268 | if (!$locked) { |
269 | - wp_set_post_lock($post_id); |
|
269 | + wp_set_post_lock($post_id); |
|
270 | 270 | echo "true"; |
271 | 271 | } else { |
272 | 272 | $user_info = get_userdata($locked); |
@@ -309,59 +309,59 @@ discard block |
||
309 | 309 | ); |
310 | 310 | foreach ($_POST as $key => $value) { |
311 | 311 | if ($key !="code" && $key !="action") { |
312 | - //$shortcode = $shortcode.$key.'="'.$value.'" '; |
|
312 | + //$shortcode = $shortcode.$key.'="'.$value.'" '; |
|
313 | 313 | $atts[$key] = $value; |
314 | 314 | } |
315 | 315 | } |
316 | 316 | if ($code == "aesop_video") { |
317 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
318 | - echo aesop_video_shortcode($atts); |
|
317 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
318 | + echo aesop_video_shortcode($atts); |
|
319 | 319 | } |
320 | 320 | else if ($code == "aesop_image") { |
321 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
322 | - echo aesop_image_shortcode($atts); |
|
321 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
322 | + echo aesop_image_shortcode($atts); |
|
323 | 323 | } |
324 | 324 | else if ($code == "aesop_quote") { |
325 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
326 | - echo aesop_quote_shortcode($atts); |
|
325 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
326 | + echo aesop_quote_shortcode($atts); |
|
327 | 327 | } |
328 | 328 | else if ($code == "aesop_parallax") { |
329 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
330 | - echo aesop_parallax_shortcode($atts); |
|
329 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
330 | + echo aesop_parallax_shortcode($atts); |
|
331 | 331 | } |
332 | 332 | else if ($code == "aesop_character") { |
333 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
334 | - echo aesop_character_shortcode($atts); |
|
333 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
334 | + echo aesop_character_shortcode($atts); |
|
335 | 335 | } |
336 | 336 | else if ($code == "aesop_collection") { |
337 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
338 | - echo aesop_collection_shortcode($atts); |
|
337 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
338 | + echo aesop_collection_shortcode($atts); |
|
339 | 339 | } |
340 | 340 | else if ($code == "aesop_chapter") { |
341 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
342 | - echo aesop_chapter_shortcode($atts); |
|
341 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
342 | + echo aesop_chapter_shortcode($atts); |
|
343 | 343 | } |
344 | 344 | else if ($code == "aesop_content") { |
345 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
346 | - echo aesop_content_shortcode($atts, $atts['content_data']); |
|
345 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
346 | + echo aesop_content_shortcode($atts, $atts['content_data']); |
|
347 | 347 | } |
348 | 348 | else if ($code == "aesop_gallery") { |
349 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
350 | - echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
349 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
350 | + echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
351 | 351 | } |
352 | 352 | else if ($code == "aesop_audio") { |
353 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
354 | - echo aesop_audio_shortcode($atts); |
|
353 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
354 | + echo aesop_audio_shortcode($atts); |
|
355 | 355 | } |
356 | 356 | else { |
357 | 357 | $code = '['.$code.' '; |
358 | 358 | foreach ($atts as $key => $value) { |
359 | - $code = ''.$key.'="'.$value.'" '; |
|
359 | + $code = ''.$key.'="'.$value.'" '; |
|
360 | 360 | } |
361 | 361 | $code = $code.']'; |
362 | 362 | echo do_shortcode($code); |
363 | - //require_once( ABSPATH . '/wp-content/plugins/aesop-events/public/includes/shortcode.php'); |
|
364 | - //echo aesop_audio_shortcode($atts); |
|
363 | + //require_once( ABSPATH . '/wp-content/plugins/aesop-events/public/includes/shortcode.php'); |
|
364 | + //echo aesop_audio_shortcode($atts); |
|
365 | 365 | } |
366 | 366 | |
367 | 367 | exit; |