@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | add_action( 'wp_ajax_get_aesop_component', array( $this, 'get_aesop_component' ) ); |
61 | 61 | add_action( 'wp_ajax_editus_do_shortcode', array( $this, 'editus_do_shortcode' ) ); |
62 | - add_action( 'wp_ajax_editus_do_block', array( $this, 'editus_do_block' ) ); |
|
62 | + add_action( 'wp_ajax_editus_do_block', array( $this, 'editus_do_block' ) ); |
|
63 | 63 | add_action( 'wp_ajax_editus_lock_post', array( $this, 'editus_lock_post' ) ); |
64 | 64 | add_action( 'wp_ajax_editus_unlock_post', array( $this, 'editus_unlock_post' ) ); |
65 | 65 | add_action( 'wp_ajax_editus_hide_tour', array( $this, 'editus_hide_tour' ) ); |
@@ -69,10 +69,10 @@ discard block |
||
69 | 69 | add_action( 'wp_ajax_editus_featured_img', array( $this, 'set_featured_img' ) ); |
70 | 70 | add_action( 'wp_ajax_editus_del_featured_img', array( $this, 'del_featured_img' ) ); |
71 | 71 | |
72 | - add_action( 'wp_ajax_editus_publish_post', array( $this, 'on_publish_post' ) ); |
|
72 | + add_action( 'wp_ajax_editus_publish_post', array( $this, 'on_publish_post' ) ); |
|
73 | 73 | |
74 | - add_action( 'wp_ajax_editus_create_gallery', array( $this, 'create_gallery' ) ); |
|
75 | - add_action( 'wp_ajax_editus_update_gallery', array( $this, 'update_gallery' ) ); |
|
74 | + add_action( 'wp_ajax_editus_create_gallery', array( $this, 'create_gallery' ) ); |
|
75 | + add_action( 'wp_ajax_editus_update_gallery', array( $this, 'update_gallery' ) ); |
|
76 | 76 | |
77 | 77 | // enable saving custom fields through REST API |
78 | 78 | self::enable_metasave('post'); |
@@ -272,14 +272,14 @@ discard block |
||
272 | 272 | $out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' ); |
273 | 273 | } |
274 | 274 | |
275 | - // new ajax function to lock post for editing |
|
275 | + // new ajax function to lock post for editing |
|
276 | 276 | public function editus_lock_post() |
277 | 277 | { |
278 | 278 | $post_id= $_POST["postid"]; |
279 | 279 | $locked = wp_check_post_lock($post_id); |
280 | 280 | |
281 | 281 | if (!$locked) { |
282 | - wp_set_post_lock($post_id); |
|
282 | + wp_set_post_lock($post_id); |
|
283 | 283 | echo "true"; |
284 | 284 | } else { |
285 | 285 | $user_info = get_userdata($locked); |
@@ -292,9 +292,9 @@ discard block |
||
292 | 292 | { |
293 | 293 | $post_id= $_POST["postid"]; |
294 | 294 | $locked = wp_check_post_lock($post_id); |
295 | - if (!$locked) { |
|
296 | - delete_post_meta( $post_id, '_edit_lock'); |
|
297 | - } |
|
295 | + if (!$locked) { |
|
296 | + delete_post_meta( $post_id, '_edit_lock'); |
|
297 | + } |
|
298 | 298 | echo "true"; |
299 | 299 | |
300 | 300 | exit; |
@@ -397,12 +397,12 @@ discard block |
||
397 | 397 | exit; |
398 | 398 | } |
399 | 399 | |
400 | - public function editus_do_block() |
|
400 | + public function editus_do_block() |
|
401 | 401 | { |
402 | 402 | |
403 | 403 | $code= $_POST["code"]; |
404 | 404 | |
405 | - $out = do_blocks( $code ); |
|
405 | + $out = do_blocks( $code ); |
|
406 | 406 | |
407 | 407 | echo $out; |
408 | 408 | exit; |
@@ -417,59 +417,59 @@ discard block |
||
417 | 417 | ); |
418 | 418 | foreach ($_POST as $key => $value) { |
419 | 419 | if ($key !="code" && $key !="action") { |
420 | - //$shortcode = $shortcode.$key.'="'.$value.'" '; |
|
420 | + //$shortcode = $shortcode.$key.'="'.$value.'" '; |
|
421 | 421 | $atts[$key] = $value; |
422 | 422 | } |
423 | 423 | } |
424 | 424 | if ($code == "aesop_video") { |
425 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
426 | - echo aesop_video_shortcode($atts); |
|
425 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
426 | + echo aesop_video_shortcode($atts); |
|
427 | 427 | } |
428 | 428 | else if ($code == "aesop_image") { |
429 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
430 | - echo aesop_image_shortcode($atts); |
|
429 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
430 | + echo aesop_image_shortcode($atts); |
|
431 | 431 | } |
432 | 432 | else if ($code == "aesop_quote") { |
433 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
434 | - echo aesop_quote_shortcode($atts); |
|
433 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
434 | + echo aesop_quote_shortcode($atts); |
|
435 | 435 | } |
436 | 436 | else if ($code == "aesop_parallax") { |
437 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
438 | - echo aesop_parallax_shortcode($atts); |
|
437 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
438 | + echo aesop_parallax_shortcode($atts); |
|
439 | 439 | } |
440 | 440 | else if ($code == "aesop_character") { |
441 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
442 | - echo aesop_character_shortcode($atts); |
|
441 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
442 | + echo aesop_character_shortcode($atts); |
|
443 | 443 | } |
444 | 444 | else if ($code == "aesop_collection") { |
445 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
446 | - echo aesop_collection_shortcode($atts); |
|
445 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
446 | + echo aesop_collection_shortcode($atts); |
|
447 | 447 | } |
448 | 448 | else if ($code == "aesop_chapter") { |
449 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
450 | - echo aesop_chapter_shortcode($atts); |
|
449 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
450 | + echo aesop_chapter_shortcode($atts); |
|
451 | 451 | } |
452 | 452 | else if ($code == "aesop_content") { |
453 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
454 | - echo aesop_content_shortcode($atts, $atts['content_data']); |
|
453 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
454 | + echo aesop_content_shortcode($atts, $atts['content_data']); |
|
455 | 455 | } |
456 | 456 | else if ($code == "aesop_gallery") { |
457 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
458 | - echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
457 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
458 | + echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
459 | 459 | } |
460 | 460 | else if ($code == "aesop_audio") { |
461 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
462 | - echo aesop_audio_shortcode($atts); |
|
461 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
462 | + echo aesop_audio_shortcode($atts); |
|
463 | 463 | } |
464 | 464 | else { |
465 | 465 | $code = '['.$code.' '; |
466 | 466 | foreach ($atts as $key => $value) { |
467 | - $code = ''.$key.'="'.$value.'" '; |
|
467 | + $code = ''.$key.'="'.$value.'" '; |
|
468 | 468 | } |
469 | 469 | $code = $code.']'; |
470 | 470 | echo do_shortcode($code); |
471 | - //require_once( ABSPATH . '/wp-content/plugins/aesop-events/public/includes/shortcode.php'); |
|
472 | - //echo aesop_audio_shortcode($atts); |
|
471 | + //require_once( ABSPATH . '/wp-content/plugins/aesop-events/public/includes/shortcode.php'); |
|
472 | + //echo aesop_audio_shortcode($atts); |
|
473 | 473 | } |
474 | 474 | |
475 | 475 | exit; |
@@ -509,12 +509,12 @@ discard block |
||
509 | 509 | exit; |
510 | 510 | } |
511 | 511 | |
512 | - /* This function doesn't actually publish post, but should be called when a post is published */ |
|
513 | - public function on_publish_post( ) { |
|
512 | + /* This function doesn't actually publish post, but should be called when a post is published */ |
|
513 | + public function on_publish_post( ) { |
|
514 | 514 | |
515 | 515 | $post_id = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
516 | 516 | |
517 | - do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) ); |
|
517 | + do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) ); |
|
518 | 518 | |
519 | 519 | exit; |
520 | 520 | } |
@@ -572,14 +572,14 @@ discard block |
||
572 | 572 | $allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' ); |
573 | 573 | |
574 | 574 | if ($taxonomy =='category') { |
575 | - // convert from names to category ids |
|
575 | + // convert from names to category ids |
|
576 | 576 | $cats = array(); |
577 | 577 | foreach ($value as $cat) { |
578 | 578 | $cat_id = get_cat_ID($cat); |
579 | 579 | if ($cat_id !=0) { |
580 | 580 | $cats [] = $cat_id; |
581 | 581 | } else if ($allow_new_category) { |
582 | - $cats [] = wp_create_category($cat); |
|
582 | + $cats [] = wp_create_category($cat); |
|
583 | 583 | } |
584 | 584 | } |
585 | 585 | $value = $cats; |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | } |
600 | 600 | } |
601 | 601 | |
602 | - public function create_gallery( ) { |
|
602 | + public function create_gallery( ) { |
|
603 | 603 | |
604 | 604 | $postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
605 | 605 | |
@@ -653,10 +653,10 @@ discard block |
||
653 | 653 | 'message' => 'gallery-created', |
654 | 654 | 'id' => $postid) |
655 | 655 | ); |
656 | - exit; |
|
656 | + exit; |
|
657 | 657 | } |
658 | 658 | |
659 | - public function update_gallery( ) { |
|
659 | + public function update_gallery( ) { |
|
660 | 660 | |
661 | 661 | $options = isset( $_POST['fields'] ) ? $_POST['fields'] : false; |
662 | 662 | |
@@ -672,12 +672,12 @@ discard block |
||
672 | 672 | |
673 | 673 | self::save_gallery_options( $postid, $gallery_ids, $options, $type ); |
674 | 674 | |
675 | - echo json_encode( array('message' => 'gallery-updated') ); |
|
675 | + echo json_encode( array('message' => 'gallery-updated') ); |
|
676 | 676 | |
677 | - exit; |
|
677 | + exit; |
|
678 | 678 | } |
679 | 679 | |
680 | - public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) { |
|
680 | + public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) { |
|
681 | 681 | |
682 | 682 | // gallery width |
683 | 683 | $gallery_width = isset( $options['width'] ) ? $options['width'] : false; |
@@ -761,7 +761,7 @@ discard block |
||
761 | 761 | public function set_date( $postid, $value) { |
762 | 762 | if( $value ) { |
763 | 763 | $value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time( 'timestamp', 1 )); |
764 | - wp_update_post( |
|
764 | + wp_update_post( |
|
765 | 765 | array ( |
766 | 766 | 'ID' => $postid, // ID of the post to update |
767 | 767 | 'post_date' => date( 'Y-m-d H:i:s', strtotime($value) ), |