Completed
Push — master ( ab6983...0357cb )
by
unknown
28s
created
public/includes/lasso.php 2 patches
Indentation   +127 added lines, -127 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
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,19 +69,19 @@  discard block
 block discarded – undo
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');
79 79
 		self::enable_metasave('page');
80 80
         
81
-        $default_post_types = apply_filters( 'lasso_allowed_post_types', array( 'post', 'page'));
81
+		$default_post_types = apply_filters( 'lasso_allowed_post_types', array( 'post', 'page'));
82 82
 		$allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor',  $default_post_types);
83
-        foreach ( $allowed_post_types  as $post_type ) {
84
-           self::enable_metasave($post_type);
83
+		foreach ( $allowed_post_types  as $post_type ) {
84
+		   self::enable_metasave($post_type);
85 85
 		}
86 86
 		//enqueue assets
87 87
 		new assets();
@@ -278,14 +278,14 @@  discard block
 block discarded – undo
278 278
 		$out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' );
279 279
 	}
280 280
 	
281
-    // new ajax function to lock post for editing
281
+	// new ajax function to lock post for editing
282 282
 	public function editus_lock_post()
283 283
 	{
284 284
 		$post_id= $_POST["postid"];
285 285
 		$locked = wp_check_post_lock($post_id);
286 286
 		
287 287
 		if (!$locked) {
288
-		    wp_set_post_lock($post_id);
288
+			wp_set_post_lock($post_id);
289 289
 			echo "true";
290 290
 		} else {
291 291
 			$user_info = get_userdata($locked);
@@ -298,9 +298,9 @@  discard block
 block discarded – undo
298 298
 	{
299 299
 		$post_id= $_POST["postid"];
300 300
 		$locked = wp_check_post_lock($post_id);
301
-        if (!$locked) {
302
-            delete_post_meta( $post_id, '_edit_lock');
303
-        }
301
+		if (!$locked) {
302
+			delete_post_meta( $post_id, '_edit_lock');
303
+		}
304 304
 		echo "true";
305 305
 		
306 306
 		exit;
@@ -328,14 +328,14 @@  discard block
 block discarded – undo
328 328
 		$status = isset( $data['status'] ) ? $data['status'] : false;
329 329
 		$postid = isset( $data['postid'] ) ? $data['postid'] : false;
330 330
 		$slug   = isset( $data['story_slug'] ) ? $data['story_slug'] : false;
331
-        $excerpt   = isset( $data['excerpt'] ) ? $data['excerpt'] : false;
331
+		$excerpt   = isset( $data['excerpt'] ) ? $data['excerpt'] : false;
332 332
 	
333 333
 
334 334
 		$args = array(
335 335
 			'ID'   			=> (int) $postid,
336 336
 			'post_name'  	=> $slug,
337 337
 			'post_status' 	=> $status,
338
-            'post_excerpt'  => wp_strip_all_tags($excerpt,true)
338
+			'post_excerpt'  => wp_strip_all_tags($excerpt,true)
339 339
 		);
340 340
 		
341 341
 		
@@ -410,12 +410,12 @@  discard block
 block discarded – undo
410 410
 		exit;
411 411
 	}
412 412
     
413
-    public function editus_do_block()
413
+	public function editus_do_block()
414 414
 	{
415 415
 		
416 416
 		$code= $_POST["code"];
417 417
 
418
-        $out = do_blocks( $code );
418
+		$out = do_blocks( $code );
419 419
 		
420 420
 		echo $out;
421 421
 		exit;
@@ -434,63 +434,63 @@  discard block
 block discarded – undo
434 434
 			}
435 435
 		}
436 436
 		if ($code == "aesop_video") {
437
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
438
-		    echo aesop_video_shortcode($atts);
437
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
438
+			echo aesop_video_shortcode($atts);
439 439
 		}
440 440
 		else if ($code == "aesop_image") {
441
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
442
-		    echo aesop_image_shortcode($atts);
441
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
442
+			echo aesop_image_shortcode($atts);
443 443
 		}
444 444
 		else if ($code == "aesop_quote") {
445
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
446
-		    echo aesop_quote_shortcode($atts);
445
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
446
+			echo aesop_quote_shortcode($atts);
447 447
 		}
448 448
 		else if ($code == "aesop_parallax") {
449
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
450
-		    echo aesop_parallax_shortcode($atts);
449
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
450
+			echo aesop_parallax_shortcode($atts);
451 451
 		}
452 452
 		else if ($code == "aesop_character") {
453
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
454
-		    echo aesop_character_shortcode($atts);
453
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
454
+			echo aesop_character_shortcode($atts);
455 455
 		}
456 456
 		else if ($code == "aesop_collection") {
457
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
458
-		    echo aesop_collection_shortcode($atts);
457
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
458
+			echo aesop_collection_shortcode($atts);
459 459
 		}
460 460
 		else if ($code == "aesop_chapter") {
461
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
462
-		    echo aesop_chapter_shortcode($atts);
461
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
462
+			echo aesop_chapter_shortcode($atts);
463 463
 		}
464 464
 		else if ($code == "aesop_content") {
465
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
466
-		    echo aesop_content_shortcode($atts, $atts['content_data']);
465
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
466
+			echo aesop_content_shortcode($atts, $atts['content_data']);
467 467
 		}
468 468
 		else if ($code == "aesop_gallery") {
469
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
470
-		    echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
469
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
470
+			echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
471 471
 		}
472 472
 		else if ($code == "aesop_audio") {
473
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
474
-		    echo aesop_audio_shortcode($atts);
473
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
474
+			echo aesop_audio_shortcode($atts);
475 475
 		}
476 476
 		else if ($code == "aesop_document") {
477
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php');
478
-		    echo aesop_document_shortcode($atts);
477
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php');
478
+			echo aesop_document_shortcode($atts);
479 479
 		}
480
-        /*else if ($code == "aesop_content") {
480
+		/*else if ($code == "aesop_content") {
481 481
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-content.php');
482 482
 		    echo aesop_content_shortcode($atts);
483 483
 		}*/
484
-        else if ($code == "aesop_wpimg") {
485
-            self::wpimg($atts);
484
+		else if ($code == "aesop_wpimg") {
485
+			self::wpimg($atts);
486 486
 		}
487 487
 		else if ($code == "aesop_wpimg-block") {
488
-            self::wpimg_block($atts);
488
+			self::wpimg_block($atts);
489 489
 		}
490 490
 		else {
491 491
 			$code = '['.$code.' ';
492 492
 			foreach ($atts as $key => $value) {
493
-			    $code = ''.$key.'="'.$value.'" ';
493
+				$code = ''.$key.'="'.$value.'" ';
494 494
 			}
495 495
 			$code = $code.']';
496 496
 			echo do_shortcode($code);
@@ -499,95 +499,95 @@  discard block
 block discarded – undo
499 499
 		exit; 
500 500
 	}
501 501
     
502
-    public static function wpimg($atts) {
502
+	public static function wpimg($atts) {
503 503
 
504
-        echo '<figure data-component-type="wpimg"';
504
+		echo '<figure data-component-type="wpimg"';
505 505
         
506
-        $extra = "";
506
+		$extra = "";
507 507
         
508
-        // try to use srcset and sizes on new WP installs
508
+		// try to use srcset and sizes on new WP installs
509 509
 		if ( function_exists('wp_get_attachment_image_srcset') && $attachment_id = attachment_url_to_postid( $atts['img'] ) ) {
510 510
 			$srcset = wp_get_attachment_image_srcset( $attachment_id, 'full' );
511 511
 			$sizes = wp_get_attachment_image_sizes( $attachment_id, 'full' );
512
-            $extra = "srcset='$srcset' sizes='$sizes' ";
513
-        }
514
-        if ($atts['align']=="left") {
515
-            $extra .= 'class="alignleft';
516
-        } else if ($atts['align']=="right") {
517
-            $extra .= 'class="alignright';
518
-        } else {
519
-            $extra .= 'class="aligncenter';
520
-        }
521
-        if ($atts['imgwidth'] || $atts['imgheight']) {
522
-            if ($atts['imgwidth']) {
523
-                $extra .= 'width:'. $atts['imgwidth'].';';
524
-            }
525
-            if ($atts['imgheight']) {
526
-                $extra .= 'height:'. $atts['imgheight'].';';
527
-            }
512
+			$extra = "srcset='$srcset' sizes='$sizes' ";
513
+		}
514
+		if ($atts['align']=="left") {
515
+			$extra .= 'class="alignleft';
516
+		} else if ($atts['align']=="right") {
517
+			$extra .= 'class="alignright';
518
+		} else {
519
+			$extra .= 'class="aligncenter';
520
+		}
521
+		if ($atts['imgwidth'] || $atts['imgheight']) {
522
+			if ($atts['imgwidth']) {
523
+				$extra .= 'width:'. $atts['imgwidth'].';';
524
+			}
525
+			if ($atts['imgheight']) {
526
+				$extra .= 'height:'. $atts['imgheight'].';';
527
+			}
528 528
             
529
-        }
530
-        $extra .= '"';
529
+		}
530
+		$extra .= '"';
531 531
         
532
-        foreach ($atts as $key => $value) {
532
+		foreach ($atts as $key => $value) {
533 533
 			 echo ' data-'.$key.'="'.$value.'"';
534 534
 		}
535
-        //echo ' class="wp-image- lasso--wpimg__wrap lasso-component">';
536
-        echo ' class="wp-caption lasso-component">';
537
-        $hrefset = false;
538
-        if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption']=="url" ))
539
-        {
540
-            echo '<a href="' . $atts['link'] . '">';
541
-            $hrefset = true;
542
-        } else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img' ) {
543
-            echo '<a href="' . $atts['img'] . '">';
544
-            $hrefset = true;
545
-        }
546
-        echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  .  '" '. $extra. '>';
547
-        if ($hrefset)
548
-        {
549
-            echo '</a>';
550
-        }
551
-        if ($atts['caption'])
552
-        {
553
-            echo '<figcaption class="wp-caption-text">'.$atts['caption'].'</figcaption>';
554
-        }
555
-        echo '</figure>';
556
-        echo '<p><br></p>';
557
-        return;
558
-    }
535
+		//echo ' class="wp-image- lasso--wpimg__wrap lasso-component">';
536
+		echo ' class="wp-caption lasso-component">';
537
+		$hrefset = false;
538
+		if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption']=="url" ))
539
+		{
540
+			echo '<a href="' . $atts['link'] . '">';
541
+			$hrefset = true;
542
+		} else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img' ) {
543
+			echo '<a href="' . $atts['img'] . '">';
544
+			$hrefset = true;
545
+		}
546
+		echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  .  '" '. $extra. '>';
547
+		if ($hrefset)
548
+		{
549
+			echo '</a>';
550
+		}
551
+		if ($atts['caption'])
552
+		{
553
+			echo '<figcaption class="wp-caption-text">'.$atts['caption'].'</figcaption>';
554
+		}
555
+		echo '</figure>';
556
+		echo '<p><br></p>';
557
+		return;
558
+	}
559 559
 	
560 560
 	public static function wpimg_block($atts) {
561 561
 		$imgextra = '';
562 562
 		if (!empty($atts['id'])) {
563 563
 			$imgextra = 'class="wp-image-'.$atts['id'].'"';
564 564
 		}
565
-        $figclass = 'aligncenter';
566
-        if ($atts['align']=="left") {
567
-            $figclass = 'alignleft';
568
-        } else if ($atts['align']=="right") {
569
-            $figclass = 'alignright';
570
-        } else {
571
-            $figclass = 'aligncenter';
572
-        }
565
+		$figclass = 'aligncenter';
566
+		if ($atts['align']=="left") {
567
+			$figclass = 'alignleft';
568
+		} else if ($atts['align']=="right") {
569
+			$figclass = 'alignright';
570
+		} else {
571
+			$figclass = 'aligncenter';
572
+		}
573 573
         
574
-        echo '<div class="wp-block-image" data-component-type="wpimg-block">'; 
575
-        echo '<figure class="wp-block-image '.$figclass.' size-large" contenteditable="false">';   
576
-        if (!empty($atts['link'])) {
577
-            echo '<a href="'.$atts['link'].'">';
578
-        }        
579
-        echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  . '"' . $imgextra . ' >';
580
-        if ($atts['caption'])
581
-        {
582
-            echo '<figcaption>'.$atts['caption'].'</figcaption>';
583
-        }
584
-        if (!empty($atts['link'])) {
585
-            echo '</a>';
586
-        }
587
-        echo '</figure></div>';
588
-        echo '<p><br></p>';
589
-        return;
590
-    }
574
+		echo '<div class="wp-block-image" data-component-type="wpimg-block">'; 
575
+		echo '<figure class="wp-block-image '.$figclass.' size-large" contenteditable="false">';   
576
+		if (!empty($atts['link'])) {
577
+			echo '<a href="'.$atts['link'].'">';
578
+		}        
579
+		echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  . '"' . $imgextra . ' >';
580
+		if ($atts['caption'])
581
+		{
582
+			echo '<figcaption>'.$atts['caption'].'</figcaption>';
583
+		}
584
+		if (!empty($atts['link'])) {
585
+			echo '</a>';
586
+		}
587
+		echo '</figure></div>';
588
+		echo '<p><br></p>';
589
+		return;
590
+	}
591 591
 	
592 592
 	
593 593
 	public function get_ase_options()
@@ -623,12 +623,12 @@  discard block
 block discarded – undo
623 623
 		exit;
624 624
 	}
625 625
     
626
-    /* This function doesn't actually publish post, but should be called when a post is published */
627
-    public function on_publish_post( ) {
626
+	/* This function doesn't actually publish post, but should be called when a post is published */
627
+	public function on_publish_post( ) {
628 628
 
629 629
 		$post_id = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
630 630
         
631
-        do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) );
631
+		do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) );
632 632
 
633 633
 		exit;
634 634
 	}
@@ -686,14 +686,14 @@  discard block
 block discarded – undo
686 686
 			$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
687 687
 			
688 688
 			if ($taxonomy =='category') {
689
-                // convert from names to category ids
689
+				// convert from names to category ids
690 690
 				$cats = array();
691 691
 				foreach ($value as $cat) {
692 692
 					$cat_id = get_cat_ID($cat);
693 693
 					if ($cat_id !=0) {
694 694
 						$cats [] = $cat_id;
695 695
 					} else if ($allow_new_category) {
696
-					    $cats [] = wp_create_category($cat);
696
+						$cats [] = wp_create_category($cat);
697 697
 					}
698 698
 				}
699 699
 				$value = $cats;
@@ -713,7 +713,7 @@  discard block
 block discarded – undo
713 713
 		}
714 714
 	}
715 715
     
716
-    public function create_gallery( ) {
716
+	public function create_gallery( ) {
717 717
 
718 718
 		$postid  	= isset( $_POST['postid'] ) ? $_POST['postid'] : false;
719 719
         
@@ -767,10 +767,10 @@  discard block
 block discarded – undo
767 767
 			'message' => 'gallery-created',
768 768
 			'id' => $postid)
769 769
 		);
770
-        exit;
770
+		exit;
771 771
 	}
772 772
     
773
-    public function update_gallery( ) {
773
+	public function update_gallery( ) {
774 774
         
775 775
 		$options      = isset( $_POST['fields'] ) ? $_POST['fields'] : false;
776 776
         
@@ -786,12 +786,12 @@  discard block
 block discarded – undo
786 786
 
787 787
 		self::save_gallery_options( $postid, $gallery_ids, $options, $type );
788 788
 
789
-        echo json_encode( array('message' => 'gallery-updated') );
789
+		echo json_encode( array('message' => 'gallery-updated') );
790 790
 
791
-        exit;
791
+		exit;
792 792
 	}
793 793
     
794
-    public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) {
794
+	public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) {
795 795
 
796 796
 		// gallery width
797 797
 		$gallery_width = isset( $options['width'] ) ? $options['width'] : false;
@@ -875,7 +875,7 @@  discard block
 block discarded – undo
875 875
 	public function set_date( $postid, $value) {
876 876
 		if( $value ) {
877 877
 			$value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time( 'timestamp', 1 ));
878
-            wp_update_post(
878
+			wp_update_post(
879 879
 				array (
880 880
 					'ID'            => $postid, // ID of the post to update
881 881
 					'post_date'     => date( 'Y-m-d H:i:s',  strtotime($value) ),
Please login to merge, or discard this patch.
Spacing   +192 added lines, -192 removed lines patch added patch discarded remove patch
@@ -52,35 +52,35 @@  discard block
 block discarded – undo
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_do_block',     array( $this, 'editus_do_block' ) );
63
-		add_action( 'wp_ajax_editus_lock_post',     array( $this, 'editus_lock_post' ) );
64
-		add_action( 'wp_ajax_editus_unlock_post',     array( $this, 'editus_unlock_post' ) );
65
-		add_action( 'wp_ajax_editus_hide_tour',     array( $this, 'editus_hide_tour' ) );
66
-		add_action( 'wp_ajax_editus_set_post_setting',     array( $this, 'editus_set_post_setting' ) );
67
-		add_action( 'wp_ajax_editus_get_ase_options',     array( $this, 'get_ase_options' ) );
68
-		add_action( 'wp_ajax_editus_delete_post',     array( $this, 'delete_post' ) );
69
-		add_action( 'wp_ajax_editus_featured_img',     array( $this, 'set_featured_img' ) );
70
-		add_action( 'wp_ajax_editus_del_featured_img',     array( $this, 'del_featured_img' ) );
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_do_block', array($this, 'editus_do_block'));
63
+		add_action('wp_ajax_editus_lock_post', array($this, 'editus_lock_post'));
64
+		add_action('wp_ajax_editus_unlock_post', array($this, 'editus_unlock_post'));
65
+		add_action('wp_ajax_editus_hide_tour', array($this, 'editus_hide_tour'));
66
+		add_action('wp_ajax_editus_set_post_setting', array($this, 'editus_set_post_setting'));
67
+		add_action('wp_ajax_editus_get_ase_options', array($this, 'get_ase_options'));
68
+		add_action('wp_ajax_editus_delete_post', array($this, 'delete_post'));
69
+		add_action('wp_ajax_editus_featured_img', array($this, 'set_featured_img'));
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');
79 79
 		self::enable_metasave('page');
80 80
         
81
-        $default_post_types = apply_filters( 'lasso_allowed_post_types', array( 'post', 'page'));
82
-		$allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor',  $default_post_types);
83
-        foreach ( $allowed_post_types  as $post_type ) {
81
+        $default_post_types = apply_filters('lasso_allowed_post_types', array('post', 'page'));
82
+		$allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', $default_post_types);
83
+        foreach ($allowed_post_types  as $post_type) {
84 84
            self::enable_metasave($post_type);
85 85
 		}
86 86
 		//enqueue assets
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	public static function get_instance() {
110 110
 
111 111
 		// If the single instance hasn't been set, set it now.
112
-		if ( null == self::$instance ) {
112
+		if (null == self::$instance) {
113 113
 			self::$instance = new self;
114 114
 		}
115 115
 
@@ -126,18 +126,18 @@  discard block
 block discarded – undo
126 126
 	 *                                       WPMU is disabled or plugin is
127 127
 	 *                                       activated on an individual blog.
128 128
 	 */
129
-	public static function activate( $network_wide ) {
129
+	public static function activate($network_wide) {
130 130
 
131
-		if ( function_exists( 'is_multisite' ) && is_multisite() ) {
131
+		if (function_exists('is_multisite') && is_multisite()) {
132 132
 
133
-			if ( $network_wide  ) {
133
+			if ($network_wide) {
134 134
 
135 135
 				// Get all blog ids
136 136
 				$blog_ids = self::get_blog_ids();
137 137
 
138
-				foreach ( $blog_ids as $blog_id ) {
138
+				foreach ($blog_ids as $blog_id) {
139 139
 
140
-					switch_to_blog( $blog_id );
140
+					switch_to_blog($blog_id);
141 141
 					self::single_activate();
142 142
 				}
143 143
 
@@ -163,18 +163,18 @@  discard block
 block discarded – undo
163 163
 	 *                                       WPMU is disabled or plugin is
164 164
 	 *                                       deactivated on an individual blog.
165 165
 	 */
166
-	public static function deactivate( $network_wide ) {
166
+	public static function deactivate($network_wide) {
167 167
 
168
-		if ( function_exists( 'is_multisite' ) && is_multisite() ) {
168
+		if (function_exists('is_multisite') && is_multisite()) {
169 169
 
170
-			if ( $network_wide ) {
170
+			if ($network_wide) {
171 171
 
172 172
 				// Get all blog ids
173 173
 				$blog_ids = self::get_blog_ids();
174 174
 
175
-				foreach ( $blog_ids as $blog_id ) {
175
+				foreach ($blog_ids as $blog_id) {
176 176
 
177
-					switch_to_blog( $blog_id );
177
+					switch_to_blog($blog_id);
178 178
 					self::single_deactivate();
179 179
 
180 180
 				}
@@ -198,13 +198,13 @@  discard block
 block discarded – undo
198 198
 	 *
199 199
 	 * @param int     $blog_id ID of the new blog.
200 200
 	 */
201
-	public function activate_new_site( $blog_id ) {
201
+	public function activate_new_site($blog_id) {
202 202
 
203
-		if ( 1 !== did_action( 'wpmu_new_blog' ) ) {
203
+		if (1 !== did_action('wpmu_new_blog')) {
204 204
 			return;
205 205
 		}
206 206
 
207
-		switch_to_blog( $blog_id );
207
+		switch_to_blog($blog_id);
208 208
 		self::single_activate();
209 209
 		restore_current_blog();
210 210
 
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 			WHERE archived = '0' AND spam = '0'
230 230
 			AND deleted = '0'";
231 231
 
232
-		return $wpdb->get_col( $sql );
232
+		return $wpdb->get_col($sql);
233 233
 
234 234
 	}
235 235
 
@@ -240,18 +240,18 @@  discard block
 block discarded – undo
240 240
 	 */
241 241
 	private static function single_activate() {
242 242
 
243
-		$curr_version = get_option( 'lasso_version' );
243
+		$curr_version = get_option('lasso_version');
244 244
 
245 245
 		// update upgraded from
246
-		if ( $curr_version ) {
247
-			update_option( 'lasso_updated_from', $curr_version );
246
+		if ($curr_version) {
247
+			update_option('lasso_updated_from', $curr_version);
248 248
 		}
249 249
 
250 250
 		// update lasso version option
251
-		update_option( 'lasso_version', LASSO_VERSION );
251
+		update_option('lasso_version', LASSO_VERSION);
252 252
 
253 253
 		// set transietn for activation welcome
254
-		set_transient( '_lasso_welcome_redirect', true, 30 );
254
+		set_transient('_lasso_welcome_redirect', true, 30);
255 255
 
256 256
 
257 257
 	}
@@ -273,15 +273,15 @@  discard block
 block discarded – undo
273 273
 	public function load_plugin_textdomain() {
274 274
 
275 275
 		$domain = $this->plugin_slug;
276
-		$locale = apply_filters( 'plugin_locale', get_locale(), $domain );
276
+		$locale = apply_filters('plugin_locale', get_locale(), $domain);
277 277
 
278
-		$out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' );
278
+		$out = load_textdomain($domain, trailingslashit(LASSO_DIR).'languages/'.$domain.'-'.$locale.'.mo');
279 279
 	}
280 280
 	
281 281
     // new ajax function to lock post for editing
282 282
 	public function editus_lock_post()
283 283
 	{
284
-		$post_id= $_POST["postid"];
284
+		$post_id = $_POST["postid"];
285 285
 		$locked = wp_check_post_lock($post_id);
286 286
 		
287 287
 		if (!$locked) {
@@ -289,17 +289,17 @@  discard block
 block discarded – undo
289 289
 			echo "true";
290 290
 		} else {
291 291
 			$user_info = get_userdata($locked);
292
-			echo _e( 'Post being edited by ', 'lasso' ).$user_info->first_name .  " " . $user_info->last_name;
292
+			echo _e('Post being edited by ', 'lasso').$user_info->first_name." ".$user_info->last_name;
293 293
 		}
294 294
 		exit;
295 295
 	}
296 296
 	
297 297
 	public function editus_unlock_post()
298 298
 	{
299
-		$post_id= $_POST["postid"];
299
+		$post_id = $_POST["postid"];
300 300
 		$locked = wp_check_post_lock($post_id);
301 301
         if (!$locked) {
302
-            delete_post_meta( $post_id, '_edit_lock');
302
+            delete_post_meta($post_id, '_edit_lock');
303 303
         }
304 304
 		echo "true";
305 305
 		
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
 	{
312 312
 		$user_id = get_current_user_ID();
313 313
 				
314
-		update_user_meta( $user_id, 'lasso_hide_tour', true );
314
+		update_user_meta($user_id, 'lasso_hide_tour', true);
315 315
 		exit;
316 316
 	}
317 317
 	
@@ -320,51 +320,51 @@  discard block
 block discarded – undo
320 320
 		$data = array();
321 321
 		parse_str($_POST['data'], $data);
322 322
 		
323
-		if (!wp_verify_nonce( $data[ 'nonce' ], 'lasso-update-post-settings' )) {
323
+		if (!wp_verify_nonce($data['nonce'], 'lasso-update-post-settings')) {
324 324
 			wp_send_json_error();
325 325
 			exit;
326 326
 		}
327 327
 		
328
-		$status = isset( $data['status'] ) ? $data['status'] : false;
329
-		$postid = isset( $data['postid'] ) ? $data['postid'] : false;
330
-		$slug   = isset( $data['story_slug'] ) ? $data['story_slug'] : false;
331
-        $excerpt   = isset( $data['excerpt'] ) ? $data['excerpt'] : false;
328
+		$status = isset($data['status']) ? $data['status'] : false;
329
+		$postid = isset($data['postid']) ? $data['postid'] : false;
330
+		$slug   = isset($data['story_slug']) ? $data['story_slug'] : false;
331
+        $excerpt = isset($data['excerpt']) ? $data['excerpt'] : false;
332 332
 	
333 333
 
334 334
 		$args = array(
335 335
 			'ID'   			=> (int) $postid,
336 336
 			'post_name'  	=> $slug,
337 337
 			'post_status' 	=> $status,
338
-            'post_excerpt'  => wp_strip_all_tags($excerpt,true)
338
+            'post_excerpt'  => wp_strip_all_tags($excerpt, true)
339 339
 		);
340 340
 		
341 341
 		
342 342
 
343
-		wp_update_post( apply_filters( 'lasso_object_status_update_args', $args ) );
343
+		wp_update_post(apply_filters('lasso_object_status_update_args', $args));
344 344
 		
345 345
 		// update categories
346
-		$cats  = isset( $data['story_cats'] ) ? $data['story_cats'] : false;
346
+		$cats = isset($data['story_cats']) ? $data['story_cats'] : false;
347 347
 		
348
-		self::set_post_terms( $postid, $cats, 'category' );
348
+		self::set_post_terms($postid, $cats, 'category');
349 349
 		
350 350
 		// update tags
351
-		$tags = isset( $data['story_tags'] ) ? $data['story_tags'] : false;
352
-		self::set_post_terms( $postid, $tags, 'post_tag' );
351
+		$tags = isset($data['story_tags']) ? $data['story_tags'] : false;
352
+		self::set_post_terms($postid, $tags, 'post_tag');
353 353
 		
354 354
 		// update custom taxonomy
355
-		$custom_taxonomies = isset( $data['story_custom_taxonomies'] ) ? json_decode($data['story_custom_taxonomies']) : false;
355
+		$custom_taxonomies = isset($data['story_custom_taxonomies']) ? json_decode($data['story_custom_taxonomies']) : false;
356 356
         
357 357
 		foreach ($custom_taxonomies as $x => $x_value) {
358
-			self::set_post_terms( $postid, $x_value, $x );
358
+			self::set_post_terms($postid, $x_value, $x);
359 359
 		}
360 360
 		
361 361
 		//update date
362
-		$date  = isset( $data['post_date'] ) ? $data['post_date'] : false;
363
-		self::set_date( $postid, $date );
362
+		$date = isset($data['post_date']) ? $data['post_date'] : false;
363
+		self::set_date($postid, $date);
364 364
 		
365
-		do_action( 'lasso_post_updated', $postid, $slug, $status, get_current_user_ID() );
366
-		$response= array(
367
-			'link'   => get_permalink($postid). (($status=='publish') ? '' : '&preview=true')
365
+		do_action('lasso_post_updated', $postid, $slug, $status, get_current_user_ID());
366
+		$response = array(
367
+			'link'   => get_permalink($postid).(($status == 'publish') ? '' : '&preview=true')
368 368
 		);
369 369
 		wp_send_json_success($response);
370 370
 		exit;
@@ -372,11 +372,11 @@  discard block
 block discarded – undo
372 372
 	
373 373
 	public static function enable_metasave($type)
374 374
 	{
375
-		register_rest_field( $type, 'metadata', array(
376
-			'get_callback' => function ( $data ) {
377
-				return get_post_meta( $data['id']);//, '', '' );
375
+		register_rest_field($type, 'metadata', array(
376
+			'get_callback' => function($data) {
377
+				return get_post_meta($data['id']); //, '', '' );
378 378
 			}, 
379
-			'update_callback' => function( $data, $post ) {
379
+			'update_callback' => function($data, $post) {
380 380
 				foreach ($data as $key => $value) {
381 381
 					update_post_meta($post->ID, $key, $value);
382 382
 				}
@@ -388,13 +388,13 @@  discard block
 block discarded – undo
388 388
 	public function editus_do_shortcode()
389 389
 	{
390 390
 		
391
-		$code= $_POST["code"];
391
+		$code = $_POST["code"];
392 392
 		$code = str_replace('\"', '"', $code);
393 393
 		
394
-		$code_wrapped = lasso_wrap_shortcodes( $code);
395
-		$out =  do_shortcode($code);
394
+		$code_wrapped = lasso_wrap_shortcodes($code);
395
+		$out = do_shortcode($code);
396 396
 		if ($out != '') {
397
-			$out =  do_shortcode($code_wrapped);
397
+			$out = do_shortcode($code_wrapped);
398 398
 			echo $out;
399 399
 			exit;
400 400
 		}
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
 		/** @var \WP_Embed $wp_embed */
405 405
 		global $wp_embed;
406 406
 		$wp_embed->post_ID = $_POST["ID"];
407
-		$out =$wp_embed->run_shortcode( $code_wrapped );
407
+		$out = $wp_embed->run_shortcode($code_wrapped);
408 408
 		
409 409
 		echo $out;
410 410
 		exit;
@@ -413,9 +413,9 @@  discard block
 block discarded – undo
413 413
     public function editus_do_block()
414 414
 	{
415 415
 		
416
-		$code= $_POST["code"];
416
+		$code = $_POST["code"];
417 417
 
418
-        $out = do_blocks( $code );
418
+        $out = do_blocks($code);
419 419
 		
420 420
 		echo $out;
421 421
 		exit;
@@ -425,56 +425,56 @@  discard block
 block discarded – undo
425 425
 	{
426 426
 		
427 427
 		
428
-		$code= $_POST["code"];
428
+		$code = $_POST["code"];
429 429
 		$atts = array(
430 430
 		 );
431 431
 		foreach ($_POST as $key => $value) {
432
-			if ($key !="code" && $key !="action") {
432
+			if ($key != "code" && $key != "action") {
433 433
 				$atts[$key] = $value;
434 434
 			}
435 435
 		}
436 436
 		if ($code == "aesop_video") {
437
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
437
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
438 438
 		    echo aesop_video_shortcode($atts);
439 439
 		}
440 440
 		else if ($code == "aesop_image") {
441
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
441
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
442 442
 		    echo aesop_image_shortcode($atts);
443 443
 		}
444 444
 		else if ($code == "aesop_quote") {
445
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
445
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
446 446
 		    echo aesop_quote_shortcode($atts);
447 447
 		}
448 448
 		else if ($code == "aesop_parallax") {
449
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
449
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
450 450
 		    echo aesop_parallax_shortcode($atts);
451 451
 		}
452 452
 		else if ($code == "aesop_character") {
453
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
453
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
454 454
 		    echo aesop_character_shortcode($atts);
455 455
 		}
456 456
 		else if ($code == "aesop_collection") {
457
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
457
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
458 458
 		    echo aesop_collection_shortcode($atts);
459 459
 		}
460 460
 		else if ($code == "aesop_chapter") {
461
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
461
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
462 462
 		    echo aesop_chapter_shortcode($atts);
463 463
 		}
464 464
 		else if ($code == "aesop_content") {
465
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
465
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
466 466
 		    echo aesop_content_shortcode($atts, $atts['content_data']);
467 467
 		}
468 468
 		else if ($code == "aesop_gallery") {
469
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
470
-		    echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
469
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
470
+		    echo do_shortcode('[aesop_gallery id="'.$atts["id"].'"]');
471 471
 		}
472 472
 		else if ($code == "aesop_audio") {
473
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
473
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
474 474
 		    echo aesop_audio_shortcode($atts);
475 475
 		}
476 476
 		else if ($code == "aesop_document") {
477
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php');
477
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php');
478 478
 		    echo aesop_document_shortcode($atts);
479 479
 		}
480 480
         /*else if ($code == "aesop_content") {
@@ -506,24 +506,24 @@  discard block
 block discarded – undo
506 506
         $extra = "";
507 507
         
508 508
         // try to use srcset and sizes on new WP installs
509
-		if ( function_exists('wp_get_attachment_image_srcset') && $attachment_id = attachment_url_to_postid( $atts['img'] ) ) {
510
-			$srcset = wp_get_attachment_image_srcset( $attachment_id, 'full' );
511
-			$sizes = wp_get_attachment_image_sizes( $attachment_id, 'full' );
509
+		if (function_exists('wp_get_attachment_image_srcset') && $attachment_id = attachment_url_to_postid($atts['img'])) {
510
+			$srcset = wp_get_attachment_image_srcset($attachment_id, 'full');
511
+			$sizes = wp_get_attachment_image_sizes($attachment_id, 'full');
512 512
             $extra = "srcset='$srcset' sizes='$sizes' ";
513 513
         }
514
-        if ($atts['align']=="left") {
514
+        if ($atts['align'] == "left") {
515 515
             $extra .= 'class="alignleft';
516
-        } else if ($atts['align']=="right") {
516
+        } else if ($atts['align'] == "right") {
517 517
             $extra .= 'class="alignright';
518 518
         } else {
519 519
             $extra .= 'class="aligncenter';
520 520
         }
521 521
         if ($atts['imgwidth'] || $atts['imgheight']) {
522 522
             if ($atts['imgwidth']) {
523
-                $extra .= 'width:'. $atts['imgwidth'].';';
523
+                $extra .= 'width:'.$atts['imgwidth'].';';
524 524
             }
525 525
             if ($atts['imgheight']) {
526
-                $extra .= 'height:'. $atts['imgheight'].';';
526
+                $extra .= 'height:'.$atts['imgheight'].';';
527 527
             }
528 528
             
529 529
         }
@@ -535,15 +535,15 @@  discard block
 block discarded – undo
535 535
         //echo ' class="wp-image- lasso--wpimg__wrap lasso-component">';
536 536
         echo ' class="wp-caption lasso-component">';
537 537
         $hrefset = false;
538
-        if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption']=="url" ))
538
+        if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption'] == "url"))
539 539
         {
540
-            echo '<a href="' . $atts['link'] . '">';
540
+            echo '<a href="'.$atts['link'].'">';
541 541
             $hrefset = true;
542
-        } else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img' ) {
543
-            echo '<a href="' . $atts['img'] . '">';
542
+        } else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img') {
543
+            echo '<a href="'.$atts['img'].'">';
544 544
             $hrefset = true;
545 545
         }
546
-        echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  .  '" '. $extra. '>';
546
+        echo '<img src="'.$atts['img'].'" alt="'.$atts['alt'].'" '.$extra.'>';
547 547
         if ($hrefset)
548 548
         {
549 549
             echo '</a>';
@@ -563,9 +563,9 @@  discard block
 block discarded – undo
563 563
 			$imgextra = 'class="wp-image-'.$atts['id'].'"';
564 564
 		}
565 565
         $figclass = 'aligncenter';
566
-        if ($atts['align']=="left") {
566
+        if ($atts['align'] == "left") {
567 567
             $figclass = 'alignleft';
568
-        } else if ($atts['align']=="right") {
568
+        } else if ($atts['align'] == "right") {
569 569
             $figclass = 'alignright';
570 570
         } else {
571 571
             $figclass = 'aligncenter';
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
         if (!empty($atts['link'])) {
577 577
             echo '<a href="'.$atts['link'].'">';
578 578
         }        
579
-        echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  . '"' . $imgextra . ' >';
579
+        echo '<img src="'.$atts['img'].'" alt="'.$atts['alt'].'"'.$imgextra.' >';
580 580
         if ($atts['caption'])
581 581
         {
582 582
             echo '<figcaption>'.$atts['caption'].'</figcaption>';
@@ -593,20 +593,20 @@  discard block
 block discarded – undo
593 593
 	public function get_ase_options()
594 594
 	{
595 595
 		$blob = lasso_editor_options_blob();
596
-		$code= $_POST["component"];
596
+		$code = $_POST["component"];
597 597
 		echo $blob[$code];
598 598
 		exit; 
599 599
 	}
600 600
 	
601 601
 	public function delete_post( ) {
602 602
 
603
-		$postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
603
+		$postid = isset($_POST['postid']) ? $_POST['postid'] : false;
604 604
 
605 605
 		// bail out if the current user can't publish posts
606
-		if ( !lasso_user_can( 'delete_post', $postid ) )
606
+		if (!lasso_user_can('delete_post', $postid))
607 607
 			return;
608 608
 		
609
-		if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_delete_post' )) {
609
+		if (!wp_verify_nonce($_POST['nonce'], 'lasso_delete_post')) {
610 610
 			wp_send_json_error();
611 611
 			exit;
612 612
 		}
@@ -616,9 +616,9 @@  discard block
 block discarded – undo
616 616
 			'post_status' 	=> 'trash'
617 617
 		);
618 618
 
619
-		wp_update_post( apply_filters( 'lasso_object_deleted_args', $args ) );
619
+		wp_update_post(apply_filters('lasso_object_deleted_args', $args));
620 620
 
621
-		do_action( 'lasso_object_deleted', $postid, get_current_user_ID() );
621
+		do_action('lasso_object_deleted', $postid, get_current_user_ID());
622 622
 
623 623
 		exit;
624 624
 	}
@@ -626,40 +626,40 @@  discard block
 block discarded – undo
626 626
     /* This function doesn't actually publish post, but should be called when a post is published */
627 627
     public function on_publish_post( ) {
628 628
 
629
-		$post_id = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
629
+		$post_id = isset($_POST['postid']) ? $_POST['postid'] : false;
630 630
         
631
-        do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) );
631
+        do_action('transition_post_status', 'publish', 'draft', get_post($post_id));
632 632
 
633 633
 		exit;
634 634
 	}
635 635
 	
636 636
 	public function set_featured_img( ) {
637 637
 
638
-		$postid  	= isset( $_POST['postid'] ) ? $_POST['postid'] : false;
639
-		$image_id  	= isset( $_POST['image_id'] ) ? absint( $_POST['image_id'] ) : false;
640
-		if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_gallery' )) {
638
+		$postid = isset($_POST['postid']) ? $_POST['postid'] : false;
639
+		$image_id = isset($_POST['image_id']) ? absint($_POST['image_id']) : false;
640
+		if (!wp_verify_nonce($_POST['nonce'], 'lasso_gallery')) {
641 641
 			wp_send_json_error();
642 642
 			exit;
643 643
 		}	
644 644
 
645
-		set_post_thumbnail( $postid, $image_id );
645
+		set_post_thumbnail($postid, $image_id);
646 646
 
647
-		do_action( 'lasso_featured_image_set', $postid, $image_id, get_current_user_ID() );
647
+		do_action('lasso_featured_image_set', $postid, $image_id, get_current_user_ID());
648 648
 
649 649
 		exit;
650 650
 	}
651 651
 	
652 652
 	public function del_featured_img( ) {
653 653
 
654
-		$postid  = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
655
-		if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_gallery' )) {
654
+		$postid = isset($_POST['postid']) ? $_POST['postid'] : false;
655
+		if (!wp_verify_nonce($_POST['nonce'], 'lasso_gallery')) {
656 656
 			wp_send_json_error();
657 657
 			exit;
658 658
 		}	
659 659
 
660
-		delete_post_thumbnail( $postid );
660
+		delete_post_thumbnail($postid);
661 661
 
662
-		do_action( 'lasso_featured_image_deleted', $postid, get_current_user_ID() );
662
+		do_action('lasso_featured_image_deleted', $postid, get_current_user_ID());
663 663
 
664 664
 		exit;
665 665
 	}
@@ -680,17 +680,17 @@  discard block
 block discarded – undo
680 680
 		return self::$revisions;
681 681
 	}*/
682 682
 	
683
-	public function set_post_terms( $postid, $value, $taxonomy ) {
684
-		if( $value ) {
685
-			$value = explode( ',', $value );
686
-			$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
683
+	public function set_post_terms($postid, $value, $taxonomy) {
684
+		if ($value) {
685
+			$value = explode(',', $value);
686
+			$allow_new_category = lasso_editor_get_option('allow_new_category', 'lasso_editor');
687 687
 			
688
-			if ($taxonomy =='category') {
688
+			if ($taxonomy == 'category') {
689 689
                 // convert from names to category ids
690 690
 				$cats = array();
691 691
 				foreach ($value as $cat) {
692 692
 					$cat_id = get_cat_ID($cat);
693
-					if ($cat_id !=0) {
693
+					if ($cat_id != 0) {
694 694
 						$cats [] = $cat_id;
695 695
 					} else if ($allow_new_category) {
696 696
 					    $cats [] = wp_create_category($cat);
@@ -699,71 +699,71 @@  discard block
 block discarded – undo
699 699
 				$value = $cats;
700 700
 			}
701 701
 	
702
-			$result = wp_set_object_terms( $postid, $value, $taxonomy );
702
+			$result = wp_set_object_terms($postid, $value, $taxonomy);
703 703
 		}
704
-		else  {
704
+		else {
705 705
 			//remove all terms from post
706
-			$result = wp_set_object_terms( $postid, null, $taxonomy );
706
+			$result = wp_set_object_terms($postid, null, $taxonomy);
707 707
 		}
708 708
 
709
-		if ( ! is_wp_error( $result ) ) {
709
+		if (!is_wp_error($result)) {
710 710
 			return true;
711
-		}else{
711
+		} else {
712 712
 			return false;
713 713
 		}
714 714
 	}
715 715
     
716 716
     public function create_gallery( ) {
717 717
 
718
-		$postid  	= isset( $_POST['postid'] ) ? $_POST['postid'] : false;
718
+		$postid = isset($_POST['postid']) ? $_POST['postid'] : false;
719 719
         
720
-		if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_gallery' )) {
720
+		if (!wp_verify_nonce($_POST['nonce'], 'lasso_gallery')) {
721 721
 			wp_send_json_error();
722 722
 			exit;
723 723
 		}	
724 724
 
725
-		if (  ! lasso_user_can( 'publish_posts' ) ) {
725
+		if (!lasso_user_can('publish_posts')) {
726 726
 			return false;
727 727
 
728 728
 		}
729 729
 
730
-		$gallery_ids = isset( $_POST['gallery_ids'] ) ? $_POST['gallery_ids'] : false;
730
+		$gallery_ids = isset($_POST['gallery_ids']) ? $_POST['gallery_ids'] : false;
731 731
 
732 732
 		// bail if no gallery ids
733
-		if ( empty( $gallery_ids ) ) {
733
+		if (empty($gallery_ids)) {
734 734
 			return false;
735 735
 		}
736 736
 
737
-		$type   		 = isset( $_POST['gallery_type'] ) ? $_POST['gallery_type'] : false;
738
-		$edgallerytitle	 = isset( $_POST['edgallerytitle'] ) ? $_POST['edgallerytitle'] : $postid.'-'.rand();
737
+		$type = isset($_POST['gallery_type']) ? $_POST['gallery_type'] : false;
738
+		$edgallerytitle = isset($_POST['edgallerytitle']) ? $_POST['edgallerytitle'] : $postid.'-'.rand();
739 739
 
740 740
 		// insert a new gallery
741 741
 		$args = array(
742
-			'post_title'    => $edgallerytitle ,
742
+			'post_title'    => $edgallerytitle,
743 743
 			'post_status'   => 'publish',
744 744
 			'post_type'     => 'ai_galleries'
745 745
 		);
746 746
 
747
-		$postid = wp_insert_post( apply_filters( 'lasso_insert_gallery_args', $args ) );
747
+		$postid = wp_insert_post(apply_filters('lasso_insert_gallery_args', $args));
748 748
 
749 749
 		// update gallery ids
750
-		if ( $gallery_ids ) {
750
+		if ($gallery_ids) {
751 751
 
752
-			update_post_meta( $postid, '_ase_gallery_images', $gallery_ids );
752
+			update_post_meta($postid, '_ase_gallery_images', $gallery_ids);
753 753
 
754 754
 		}
755 755
 
756 756
 		// update the gallery type
757
-		if ( !empty( $type ) ) {
757
+		if (!empty($type)) {
758 758
 
759
-			update_post_meta( $postid, 'aesop_gallery_type', $type );
759
+			update_post_meta($postid, 'aesop_gallery_type', $type);
760 760
 
761 761
 		}
762 762
 
763
-		do_action( 'lasso_gallery_published', $postid, $gallery_ids, get_current_user_ID() );
763
+		do_action('lasso_gallery_published', $postid, $gallery_ids, get_current_user_ID());
764 764
 
765 765
 
766
-		echo json_encode( array(
766
+		echo json_encode(array(
767 767
 			'message' => 'gallery-created',
768 768
 			'id' => $postid)
769 769
 		);
@@ -772,114 +772,114 @@  discard block
 block discarded – undo
772 772
     
773 773
     public function update_gallery( ) {
774 774
         
775
-		$options      = isset( $_POST['fields'] ) ? $_POST['fields'] : false;
775
+		$options      = isset($_POST['fields']) ? $_POST['fields'] : false;
776 776
         
777
-		$postid   	  = !empty( $options ) ? (int) $options['id'] : false;
778
-		$gallery_ids  = isset( $_POST['gallery_ids'] ) ? $_POST['gallery_ids'] : false;
779
-		if ( $_POST[ 'gallery_type' ] ) {
780
-			$type = $_POST[ 'gallery_type' ];
781
-		}elseif ( ! empty( $options ) && $options[ 'galleryType' ] ) {
782
-			$type = $options[ 'galleryType' ];
783
-		}else{
777
+		$postid = !empty($options) ? (int) $options['id'] : false;
778
+		$gallery_ids  = isset($_POST['gallery_ids']) ? $_POST['gallery_ids'] : false;
779
+		if ($_POST['gallery_type']) {
780
+			$type = $_POST['gallery_type'];
781
+		}elseif (!empty($options) && $options['galleryType']) {
782
+			$type = $options['galleryType'];
783
+		} else {
784 784
 			$type = false;
785 785
 		}
786 786
 
787
-		self::save_gallery_options( $postid, $gallery_ids, $options, $type );
787
+		self::save_gallery_options($postid, $gallery_ids, $options, $type);
788 788
 
789
-        echo json_encode( array('message' => 'gallery-updated') );
789
+        echo json_encode(array('message' => 'gallery-updated'));
790 790
 
791 791
         exit;
792 792
 	}
793 793
     
794
-    public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) {
794
+    public function save_gallery_options($postid, $gallery_ids, $options, $type = false) {
795 795
 
796 796
 		// gallery width
797
-		$gallery_width = isset( $options['width'] ) ? $options['width'] : false;
797
+		$gallery_width = isset($options['width']) ? $options['width'] : false;
798 798
 
799 799
 		// gallery grid item width
800
-		$item_width = isset( $options['itemwidth'] ) ? $options['itemwidth'] : false;
800
+		$item_width = isset($options['itemwidth']) ? $options['itemwidth'] : false;
801 801
 
802 802
 		// caption
803
-		$caption = isset( $options['caption'] ) ? $options['caption'] : false;
803
+		$caption = isset($options['caption']) ? $options['caption'] : false;
804 804
 
805 805
 		// gallery transition
806
-		$transition = isset( $options['transition'] ) ? $options['transition'] : false;
806
+		$transition = isset($options['transition']) ? $options['transition'] : false;
807 807
 
808 808
 		// gallery transition speed
809
-		$transitionSpeed = isset( $options['speed'] ) ? $options['speed'] : false;
809
+		$transitionSpeed = isset($options['speed']) ? $options['speed'] : false;
810 810
 
811 811
 		// gallery hide thumbs
812
-		$hideThumbs = isset( $options['hideThumbs'] ) ? $options['hideThumbs'] : false;
812
+		$hideThumbs = isset($options['hideThumbs']) ? $options['hideThumbs'] : false;
813 813
 
814 814
 		// photoset layout hardwired to on for now
815
-		$psLayout = isset( $options['pslayout'] ) ? $options['pslayout'] : false;
815
+		$psLayout = isset($options['pslayout']) ? $options['pslayout'] : false;
816 816
 
817 817
 		// photoset layout
818
-		$psLightbox = 'on';//isset( $options['pslightbox'] ) ? $options['pslightbox'] : false;
818
+		$psLightbox = 'on'; //isset( $options['pslightbox'] ) ? $options['pslightbox'] : false;
819 819
 		
820 820
 		// hero gallery height
821
-		$gallery_height = isset( $options['height'] ) ? $options['height'] : false;
821
+		$gallery_height = isset($options['height']) ? $options['height'] : false;
822 822
 
823 823
 		// update gallery ids
824
-		if ( !empty( $gallery_ids ) ) {
824
+		if (!empty($gallery_ids)) {
825 825
 
826
-			update_post_meta( $postid, '_ase_gallery_images', $gallery_ids );
826
+			update_post_meta($postid, '_ase_gallery_images', $gallery_ids);
827 827
 
828 828
 		}
829 829
 
830
-		update_post_meta( $postid, 'aesop_gallery_type', sanitize_text_field( trim( $type ) ) );
830
+		update_post_meta($postid, 'aesop_gallery_type', sanitize_text_field(trim($type)));
831 831
 
832
-		update_post_meta( $postid, 'aesop_gallery_width', sanitize_text_field( trim( $gallery_width ) ) );
832
+		update_post_meta($postid, 'aesop_gallery_width', sanitize_text_field(trim($gallery_width)));
833 833
 
834
-		update_post_meta( $postid, 'aesop_grid_gallery_width', sanitize_text_field( trim( $item_width ) ) );
834
+		update_post_meta($postid, 'aesop_grid_gallery_width', sanitize_text_field(trim($item_width)));
835 835
 
836
-		update_post_meta( $postid, 'aesop_gallery_caption', sanitize_text_field( trim( $caption ) ) );
836
+		update_post_meta($postid, 'aesop_gallery_caption', sanitize_text_field(trim($caption)));
837 837
 
838
-		update_post_meta( $postid, 'aesop_thumb_gallery_transition', sanitize_text_field( trim( $transition ) ) );
838
+		update_post_meta($postid, 'aesop_thumb_gallery_transition', sanitize_text_field(trim($transition)));
839 839
 
840
-		update_post_meta( $postid, 'aesop_thumb_gallery_transition_speed', absint( trim( $transitionSpeed ) ) );
840
+		update_post_meta($postid, 'aesop_thumb_gallery_transition_speed', absint(trim($transitionSpeed)));
841 841
 
842
-		update_post_meta( $postid, 'aesop_thumb_gallery_hide_thumbs', sanitize_text_field( trim( $hideThumbs ) ) );
842
+		update_post_meta($postid, 'aesop_thumb_gallery_hide_thumbs', sanitize_text_field(trim($hideThumbs)));
843 843
 
844
-		update_post_meta( $postid, 'aesop_photoset_gallery_layout', sanitize_text_field( trim( $psLayout ) ) );
844
+		update_post_meta($postid, 'aesop_photoset_gallery_layout', sanitize_text_field(trim($psLayout)));
845 845
 
846
-		update_post_meta( $postid, 'aesop_photoset_gallery_lightbox', sanitize_text_field( trim( $psLightbox ) ) );
846
+		update_post_meta($postid, 'aesop_photoset_gallery_lightbox', sanitize_text_field(trim($psLightbox)));
847 847
 		
848
-		update_post_meta( $postid, 'aesop_hero_gallery_height', sanitize_text_field( trim( $gallery_height ) ) );
848
+		update_post_meta($postid, 'aesop_hero_gallery_height', sanitize_text_field(trim($gallery_height)));
849 849
 		
850 850
 		//hardwired for now
851 851
 		
852
-		update_post_meta( $postid, 'aesop_hero_gallery_transition_speed', 300 );
852
+		update_post_meta($postid, 'aesop_hero_gallery_transition_speed', 300);
853 853
 
854 854
 	}
855 855
 	
856
-	function getEnglishMonthName($foreignMonthName){
856
+	function getEnglishMonthName($foreignMonthName) {
857 857
 
858 858
 		  setlocale(LC_ALL, 'en_US');
859 859
 
860
-		  $month_numbers = range(1,12);
860
+		  $month_numbers = range(1, 12);
861 861
 
862
-		  foreach($month_numbers as $month)
863
-			$english_months[] = strftime('%B',mktime(0,0,0,$month,1,2011));
862
+		  foreach ($month_numbers as $month)
863
+			$english_months[] = strftime('%B', mktime(0, 0, 0, $month, 1, 2011));
864 864
 
865 865
 		  setlocale(LC_ALL, get_locale());
866 866
 
867
-		  foreach($month_numbers as $month)
868
-			$foreign_months[] = utf8_encode(strftime('%B',mktime(0,0,0,$month,1,2011)));
867
+		  foreach ($month_numbers as $month)
868
+			$foreign_months[] = utf8_encode(strftime('%B', mktime(0, 0, 0, $month, 1, 2011)));
869 869
 
870 870
 		  return str_replace($foreign_months, $english_months, $foreignMonthName);
871 871
 	}
872 872
 
873 873
 
874 874
 	
875
-	public function set_date( $postid, $value) {
876
-		if( $value ) {
877
-			$value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time( 'timestamp', 1 ));
875
+	public function set_date($postid, $value) {
876
+		if ($value) {
877
+			$value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time('timestamp', 1));
878 878
             wp_update_post(
879
-				array (
879
+				array(
880 880
 					'ID'            => $postid, // ID of the post to update
881
-					'post_date'     => date( 'Y-m-d H:i:s',  strtotime($value) ),
882
-					'post_date_gmt'     => gmdate( 'Y-m-d H:i:s',  strtotime($value) ),
881
+					'post_date'     => date('Y-m-d H:i:s', strtotime($value)),
882
+					'post_date_gmt'     => gmdate('Y-m-d H:i:s', strtotime($value)),
883 883
 				)
884 884
 			);
885 885
 		}
Please login to merge, or discard this patch.
public/includes/assets.php 2 patches
Indentation   +86 added lines, -86 removed lines patch added patch discarded remove patch
@@ -15,29 +15,29 @@  discard block
 block discarded – undo
15 15
 		add_action('wp_enqueue_scripts', array($this,'scripts'));
16 16
 	}
17 17
     
18
-    function is_multipage()
19
-    {
20
-        global $post;
21
-        $pos = strpos($post->post_content, "<!--nextpage-->");
22
-        if (!$pos) return -1;
18
+	function is_multipage()
19
+	{
20
+		global $post;
21
+		$pos = strpos($post->post_content, "<!--nextpage-->");
22
+		if (!$pos) return -1;
23 23
         
24
-        global $wp;
25
-        $url =  home_url( $wp->request );
26
-        $index = intval(basename($url)) == 0 ? 0 : intval(basename($url))-1;
27
-        return $index;        
28
-    }
24
+		global $wp;
25
+		$url =  home_url( $wp->request );
26
+		$index = intval(basename($url)) == 0 ? 0 : intval(basename($url))-1;
27
+		return $index;        
28
+	}
29 29
 
30 30
 	public function scripts(){
31 31
 
32 32
 	
33 33
 		global $post;
34 34
 		if ( lasso_user_can('edit_posts') 
35
-		     /* uncomment this line to disable Editus on Gutenberg posts*/
36
-             /* && !( function_exists( 'has_blocks' ) && has_blocks( $post->post_content)  && !is_home()) */              
37
-             ) {
35
+			 /* uncomment this line to disable Editus on Gutenberg posts*/
36
+			 /* && !( function_exists( 'has_blocks' ) && has_blocks( $post->post_content)  && !is_home()) */              
37
+			 ) {
38 38
 			
39 39
 			/**    Returns the time offset from UTC
40
-			*/
40
+			 */
41 41
 			function get_UTC_offset() {
42 42
 				$timezone_string = get_option( 'timezone_string' );
43 43
 				if (empty( $timezone_string ) ) {
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
 			wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true);
54 54
 
55
-            //don't load autocomplete if it's a stockholm theme
55
+			//don't load autocomplete if it's a stockholm theme
56 56
 			$themename  	= wp_get_theme()->get('Name');
57 57
 			if ($themename !='Stockholm' ) {
58 58
 				wp_enqueue_script('jquery-ui-autocomplete');
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
 			$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor','b');
91 91
 			$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor','i');
92 92
             
93
-            $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
93
+			$use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
94 94
             
95
-            $use_wpimgblock = false;
95
+			$use_wpimgblock = false;
96 96
             
97
-            $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor', 'off');
97
+			$link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor', 'off');
98 98
 
99 99
 			
100 100
 			//text alignement
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 			// allow change date for post
110 110
 			$allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor');
111 111
             
112
-            // support custom taxonomy
112
+			// support custom taxonomy
113 113
 			$support_custom_taxonomy = lasso_editor_get_option('support_custom_taxonomy', 'lasso_editor');
114 114
 			
115 115
 			if ($show_color) {
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 			$tz_offset = get_UTC_offset();
136 136
 			$post_date = get_the_time('U', $postid);
137 137
 			$time = (time()+$tz_offset);
138
-            $delta = $time - $post_date;
138
+			$delta = $time - $post_date;
139 139
             
140 140
 			$strings = array(
141 141
 				'save' 				=> __('Save','lasso'),
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 				
180 180
 				'catsPlaceholder'     => __('add categories...'),
181 181
 				'tagsPlaceholder'     => __('add tags...'),
182
-                'taxoPlaceholder'     => __('add taxonomy terms...'),
182
+				'taxoPlaceholder'     => __('add taxonomy terms...'),
183 183
 				
184 184
 				
185 185
 			);
@@ -191,11 +191,11 @@  discard block
 block discarded – undo
191 191
 			$gallery_nonce = wp_create_nonce( $gallery_nonce_action );
192 192
 			
193 193
 			
194
-            if ($allow_change_date) {
195
-			    $permalink = get_site_url().'/?p='.$postid;
196
-            } else {
197
-                $permalink = get_permalink($postid);
198
-            }
194
+			if ($allow_change_date) {
195
+				$permalink = get_site_url().'/?p='.$postid;
196
+			} else {
197
+				$permalink = get_permalink($postid);
198
+			}
199 199
 			
200 200
 			// rest api
201 201
 			$rest_nonce = '';
@@ -215,17 +215,17 @@  discard block
 block discarded – undo
215 215
 				}
216 216
 			}
217 217
             
218
-            //excerpt
219
-            $post_excerpt = "";
220
-            $post_excerpt = wp_strip_all_tags($post->post_excerpt,true);
218
+			//excerpt
219
+			$post_excerpt = "";
220
+			$post_excerpt = wp_strip_all_tags($post->post_excerpt,true);
221 221
             
222
-            //find if this is multi page. -1 if not
223
-            $multipage = self::is_multipage();
224
-            $post_content = "";
225
-            //pass post_content if we need to process multipage. In future we may need to pass this for other purposes
226
-            //if ($multipage != -1) {
227
-               $post_content = $post->post_content;
228
-            //}
222
+			//find if this is multi page. -1 if not
223
+			$multipage = self::is_multipage();
224
+			$post_content = "";
225
+			//pass post_content if we need to process multipage. In future we may need to pass this for other purposes
226
+			//if ($multipage != -1) {
227
+			   $post_content = $post->post_content;
228
+			//}
229 229
 			
230 230
 			//get custom taxonomy
231 231
 			$custom_taxonomies         = array_diff(get_object_taxonomies( get_post_type( $postid ), 'names' ), ['category','post_tag','post_format']);
@@ -238,8 +238,8 @@  discard block
 block discarded – undo
238 238
 				$existing_taxo_arr[$taxonomy] = lasso_get_objects( $taxonomy );
239 239
 			}
240 240
             
241
-            $new_post_text    = lasso_editor_get_option( 'new_post_text', 'lasso_editor' );        
242
-            $new_post_text  = !empty($new_post_text) ? $new_post_text : wp_strip_all_tags(apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso')));
241
+			$new_post_text    = lasso_editor_get_option( 'new_post_text', 'lasso_editor' );        
242
+			$new_post_text  = !empty($new_post_text) ? $new_post_text : wp_strip_all_tags(apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso')));
243 243
 
244 244
 
245 245
 			// localized objects
@@ -319,19 +319,19 @@  discard block
 block discarded – undo
319 319
 				'customFields'      => $custom_fields,
320 320
 				'clickToInsert'     => ($insert_comp_ui =='click'),
321 321
 				'buttonOnEmptyP'     => ($insert_comp_ui =='mediumcom'),      // auto show a button to insert components on an empty paragraph      
322
-                'rtl'               => is_rtl(),				
322
+				'rtl'               => is_rtl(),				
323 323
 				'skipToEdit'        =>( $delta < 10 && $delta >=0 ), // if it's a new post, skip to edit mode
324 324
 				'linksEditable'    => $links_editable,
325 325
 				'supportPendingStatus' => !$no_pending_status,
326 326
 				'tableCode' => apply_filters( 'lasso_table_html_code','<table><tr><th>Cell 1</th><th>Cell 2</th></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table><p></p>'),
327
-                'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) || self::gutenberg_active(),//,
328
-                'multipages'=> $multipage,
329
-                'post_content'=>$post_content,
330
-                'post_excerpt'=>$post_excerpt,
331
-                'supCustTaxo' => $support_custom_taxonomy == 'on',
332
-                'oldWPimg'=> $use_old_wpimg =='on',
333
-                'useWPImgBlk'=> $use_wpimgblock,
334
-                'prefixHTTP'=> $link_prefix_http =='on'
327
+				'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) || self::gutenberg_active(),//,
328
+				'multipages'=> $multipage,
329
+				'post_content'=>$post_content,
330
+				'post_excerpt'=>$post_excerpt,
331
+				'supCustTaxo' => $support_custom_taxonomy == 'on',
332
+				'oldWPimg'=> $use_old_wpimg =='on',
333
+				'useWPImgBlk'=> $use_wpimgblock,
334
+				'prefixHTTP'=> $link_prefix_http =='on'
335 335
 			);
336 336
 
337 337
 
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 			
340 340
 			
341 341
 			if (!$using_restapiv2) {
342
-               // enqueue REST API V1
342
+			   // enqueue REST API V1
343 343
 			   wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
344 344
 			   $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) );
345 345
 			   wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings );
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
 			if ($show_color) {
356 356
 				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true);
357 357
 			} else {
358
-			    wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
358
+				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
359 359
 			}
360 360
 			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) );
361 361
 
@@ -364,44 +364,44 @@  discard block
 block discarded – undo
364 364
 
365 365
 	}
366 366
     
367
-    function gutenberg_active() {
367
+	function gutenberg_active() {
368 368
         
369
-        // Gutenberg plugin is installed and activated.
370
-        $gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) );
371
-
372
-        // Block editor since 5.0.
373
-        $block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' );
374
-
375
-        if ( ! $gutenberg && ! $block_editor ) {
376
-            return false;
377
-        }
378
-
379
-        if ( self::is_classic_editor_plugin_active() ) {
380
-            $editor_option       = get_option( 'classic-editor-replace' );
381
-            $block_editor_active = array( 'no-replace', 'block' );
382
-
383
-            return in_array( $editor_option, $block_editor_active, true );
384
-        }
385
-
386
-        return true;
387
-    }
388
-
389
-    /**
390
-     * Check if Classic Editor plugin is active.
391
-     *
392
-     * @return bool
393
-     */
394
-    function is_classic_editor_plugin_active() {
395
-        if ( ! function_exists( 'is_plugin_active' ) ) {
396
-            include_once ABSPATH . 'wp-admin/includes/plugin.php';
397
-        }
398
-
399
-        if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) {
400
-            return true;
401
-        }
402
-
403
-        return false;
404
-    }
369
+		// Gutenberg plugin is installed and activated.
370
+		$gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) );
371
+
372
+		// Block editor since 5.0.
373
+		$block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' );
374
+
375
+		if ( ! $gutenberg && ! $block_editor ) {
376
+			return false;
377
+		}
378
+
379
+		if ( self::is_classic_editor_plugin_active() ) {
380
+			$editor_option       = get_option( 'classic-editor-replace' );
381
+			$block_editor_active = array( 'no-replace', 'block' );
382
+
383
+			return in_array( $editor_option, $block_editor_active, true );
384
+		}
385
+
386
+		return true;
387
+	}
388
+
389
+	/**
390
+	 * Check if Classic Editor plugin is active.
391
+	 *
392
+	 * @return bool
393
+	 */
394
+	function is_classic_editor_plugin_active() {
395
+		if ( ! function_exists( 'is_plugin_active' ) ) {
396
+			include_once ABSPATH . 'wp-admin/includes/plugin.php';
397
+		}
398
+
399
+		if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) {
400
+			return true;
401
+		}
402
+
403
+		return false;
404
+	}
405 405
 
406 406
 }
407 407
 
Please login to merge, or discard this patch.
Spacing   +116 added lines, -116 removed lines patch added patch discarded remove patch
@@ -10,9 +10,9 @@  discard block
 block discarded – undo
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 18
     function is_multipage()
@@ -22,16 +22,16 @@  discard block
 block discarded – undo
22 22
         if (!$pos) return -1;
23 23
         
24 24
         global $wp;
25
-        $url =  home_url( $wp->request );
26
-        $index = intval(basename($url)) == 0 ? 0 : intval(basename($url))-1;
25
+        $url = home_url($wp->request);
26
+        $index = intval(basename($url)) == 0 ? 0 : intval(basename($url)) - 1;
27 27
         return $index;        
28 28
     }
29 29
 
30
-	public function scripts(){
30
+	public function scripts() {
31 31
 
32 32
 	
33 33
 		global $post;
34
-		if ( lasso_user_can('edit_posts') 
34
+		if (lasso_user_can('edit_posts') 
35 35
 		     /* uncomment this line to disable Editus on Gutenberg posts*/
36 36
              /* && !( function_exists( 'has_blocks' ) && has_blocks( $post->post_content)  && !is_home()) */              
37 37
              ) {
@@ -39,9 +39,9 @@  discard block
 block discarded – undo
39 39
 			/**    Returns the time offset from UTC
40 40
 			*/
41 41
 			function get_UTC_offset() {
42
-				$timezone_string = get_option( 'timezone_string' );
43
-				if (empty( $timezone_string ) ) {
44
-					return get_option('gmt_offset')*3600;
42
+				$timezone_string = get_option('timezone_string');
43
+				if (empty($timezone_string)) {
44
+					return get_option('gmt_offset') * 3600;
45 45
 				}
46 46
 				
47 47
 				$origin_dtz = new \DateTimeZone($timezone_string);				
@@ -53,8 +53,8 @@  discard block
 block discarded – undo
53 53
 			wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true);
54 54
 
55 55
             //don't load autocomplete if it's a stockholm theme
56
-			$themename  	= wp_get_theme()->get('Name');
57
-			if ($themename !='Stockholm' ) {
56
+			$themename = wp_get_theme()->get('Name');
57
+			if ($themename != 'Stockholm') {
58 58
 				wp_enqueue_script('jquery-ui-autocomplete');
59 59
 			}
60 60
 			wp_enqueue_script('jquery-ui-draggable');
@@ -67,30 +67,30 @@  discard block
 block discarded – undo
67 67
 			// url for json api
68 68
 			$home_url = function_exists('json_get_url_prefix') ? json_get_url_prefix() : false;
69 69
 
70
-			$article_object 	= lasso_editor_get_option('article_class','lasso_editor');
70
+			$article_object 	= lasso_editor_get_option('article_class', 'lasso_editor');
71 71
 
72
-			$article_object 	= empty( $article_object ) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object;
72
+			$article_object 	= empty($article_object) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object;
73 73
 
74
-			$featImgClass 		= lasso_editor_get_option('featimg_class','lasso_editor');
75
-			if (empty( $featImgClass )) {
74
+			$featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor');
75
+			if (empty($featImgClass)) {
76 76
 				$featImgClass = lasso_get_supported_theme_featured_image_class();
77 77
 			}
78
-			$titleClass 		= lasso_editor_get_option('title_class','lasso_editor');
79
-			if (empty( $titleClass )) {
78
+			$titleClass = lasso_editor_get_option('title_class', 'lasso_editor');
79
+			if (empty($titleClass)) {
80 80
 				$titleClass = lasso_get_supported_theme_title_class();
81 81
 			}
82
-			$toolbar_headings  	= lasso_editor_get_option('toolbar_headings', 'lasso_editor');
83
-			$toolbar_headings_h4  	= lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
82
+			$toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor');
83
+			$toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
84 84
 			$objectsNoSave  	= lasso_editor_get_option('dont_save', 'lasso_editor');
85
-			$objectsNonEditable  	= lasso_editor_get_option('non_editable', 'lasso_editor');
85
+			$objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor');
86 86
 			$disableRESTSave = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor');
87
-			$save_to_post_disabled  = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' );
88
-			$edit_post_disabled  = lasso_editor_get_option( 'post_edit_disabled', 'lasso_editor' );
87
+			$save_to_post_disabled = lasso_editor_get_option('post_save_disabled', 'lasso_editor');
88
+			$edit_post_disabled = lasso_editor_get_option('post_edit_disabled', 'lasso_editor');
89 89
 			
90
-			$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor','b');
91
-			$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor','i');
90
+			$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor', 'b');
91
+			$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor', 'i');
92 92
             
93
-            $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
93
+            $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor', 'off');
94 94
             
95 95
             $use_wpimgblock = false;
96 96
             
@@ -114,8 +114,8 @@  discard block
 block discarded – undo
114 114
 			
115 115
 			if ($show_color) {
116 116
 				//color picker
117
-				wp_enqueue_style( 'wp-color-picker' );
118
-				wp_enqueue_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 );
117
+				wp_enqueue_style('wp-color-picker');
118
+				wp_enqueue_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), false, 1);
119 119
 			}
120 120
 			
121 121
 			// click to insert components, not drag and drop
@@ -127,54 +127,54 @@  discard block
 block discarded – undo
127 127
 			
128 128
 			// custom fields
129 129
 			
130
-			$custom_fields = apply_filters( 'editus_custom_fields', null ); 
130
+			$custom_fields = apply_filters('editus_custom_fields', null); 
131 131
 
132 132
 
133 133
 			// post id reference
134 134
 			$postid 			= get_the_ID();
135 135
 			$tz_offset = get_UTC_offset();
136 136
 			$post_date = get_the_time('U', $postid);
137
-			$time = (time()+$tz_offset);
137
+			$time = (time() + $tz_offset);
138 138
             $delta = $time - $post_date;
139 139
             
140 140
 			$strings = array(
141
-				'save' 				=> __('Save','lasso'),
142
-				'selectText'	  	=> __('Please Select Text First.','lasso'),
143
-				'cancel' 			=> __('Cancel','lasso'),
144
-				'exiteditor' 		=> __('Exit Editor','lasso'),
145
-				'saving' 			=> __('Saving...','lasso'),
146
-				'saved'				=> __('Saved!','lasso'),
147
-				'adding' 			=> __('Adding...','lasso'),
148
-				'added'				=> __('Added!','lasso'),
149
-				'loading' 			=> __('Loading...','lasso'),
150
-				'loadMore'			=> __('Load More','lasso'),
151
-				'close'			=> __('Close','lasso'),
152
-				'noPostsFound'		=> __('No more posts found','lasso'),
153
-				'fetchFail'	    	=> __('Fetching failed.','lasso'),
154
-				'galleryCreated' 	=> __('Gallery Created!','lasso'),
155
-				'galleryUpdated' 	=> __('Gallery Updated!','lasso'),
156
-				'justWrite'			=> __('Just write...','lasso'),
157
-				'chooseImage'		=> __('Choose an image','lasso'),
158
-				'updateImage'		=> __('Update Image','lasso'),
159
-				'insertImage'		=> __('Insert Image','lasso'),
160
-				'selectImage'		=> __('Select Image','lasso'),
161
-				'removeFeatImg'     => __('Remove featured image?','lasso'),
162
-				'updateSelectedImg' => __('Update Selected Image','lasso'),
163
-				'chooseImages'		=> __('Choose images','lasso'),
164
-				'editImage'			=> __('Edit Image','lasso'),
165
-				'addImages'			=> __('Add Images','lasso'),
166
-				'addNewGallery'		=> __('Add New Gallery','lasso'),
167
-				'selectGallery'		=> __('Select Editus Gallery Image','lasso'),
168
-				'useSelectedImages' => __('Use Selected Images','lasso'),
169
-				'publishPost'		=> __('Publish Post?','lasso'),
170
-				'publishYes'		=> __('Yes, publish it!','lasso'),
171
-				'deletePost'		=> __('Trash Post?','lasso'),
172
-				'deleteYes'			=> __('Yes, trash it!','lasso'),
173
-				'warning'			=> __('Oh snap!','laso'),
174
-				'cancelText'		=> __('O.K. got it!','lasso'),
175
-				'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'),
141
+				'save' 				=> __('Save', 'lasso'),
142
+				'selectText'	  	=> __('Please Select Text First.', 'lasso'),
143
+				'cancel' 			=> __('Cancel', 'lasso'),
144
+				'exiteditor' 		=> __('Exit Editor', 'lasso'),
145
+				'saving' 			=> __('Saving...', 'lasso'),
146
+				'saved'				=> __('Saved!', 'lasso'),
147
+				'adding' 			=> __('Adding...', 'lasso'),
148
+				'added'				=> __('Added!', 'lasso'),
149
+				'loading' 			=> __('Loading...', 'lasso'),
150
+				'loadMore'			=> __('Load More', 'lasso'),
151
+				'close'			=> __('Close', 'lasso'),
152
+				'noPostsFound'		=> __('No more posts found', 'lasso'),
153
+				'fetchFail'	    	=> __('Fetching failed.', 'lasso'),
154
+				'galleryCreated' 	=> __('Gallery Created!', 'lasso'),
155
+				'galleryUpdated' 	=> __('Gallery Updated!', 'lasso'),
156
+				'justWrite'			=> __('Just write...', 'lasso'),
157
+				'chooseImage'		=> __('Choose an image', 'lasso'),
158
+				'updateImage'		=> __('Update Image', 'lasso'),
159
+				'insertImage'		=> __('Insert Image', 'lasso'),
160
+				'selectImage'		=> __('Select Image', 'lasso'),
161
+				'removeFeatImg'     => __('Remove featured image?', 'lasso'),
162
+				'updateSelectedImg' => __('Update Selected Image', 'lasso'),
163
+				'chooseImages'		=> __('Choose images', 'lasso'),
164
+				'editImage'			=> __('Edit Image', 'lasso'),
165
+				'addImages'			=> __('Add Images', 'lasso'),
166
+				'addNewGallery'		=> __('Add New Gallery', 'lasso'),
167
+				'selectGallery'		=> __('Select Editus Gallery Image', 'lasso'),
168
+				'useSelectedImages' => __('Use Selected Images', 'lasso'),
169
+				'publishPost'		=> __('Publish Post?', 'lasso'),
170
+				'publishYes'		=> __('Yes, publish it!', 'lasso'),
171
+				'deletePost'		=> __('Trash Post?', 'lasso'),
172
+				'deleteYes'			=> __('Yes, trash it!', 'lasso'),
173
+				'warning'			=> __('Oh snap!', 'laso'),
174
+				'cancelText'		=> __('O.K. got it!', 'lasso'),
175
+				'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'),
176 176
 				'missingConfirm'	=> __('Update Settings', 'lasso'),
177
-				'helperText'		=> __('one more letter','lasso'),
177
+				'helperText'		=> __('one more letter', 'lasso'),
178 178
 				'editingBackup'  	=> __('You are currently editing a backup copy of this post.'),
179 179
 				
180 180
 				'catsPlaceholder'     => __('add categories...'),
@@ -184,11 +184,11 @@  discard block
 block discarded – undo
184 184
 				
185 185
 			);
186 186
 
187
-			$api_url = trailingslashit( home_url() ) . 'lasso-internal-api';
187
+			$api_url = trailingslashit(home_url()).'lasso-internal-api';
188 188
 
189 189
 			$gallery_class = new gallery();
190 190
 			$gallery_nonce_action = $gallery_class->nonce_action;
191
-			$gallery_nonce = wp_create_nonce( $gallery_nonce_action );
191
+			$gallery_nonce = wp_create_nonce($gallery_nonce_action);
192 192
 			
193 193
 			
194 194
             if ($allow_change_date) {
@@ -203,13 +203,13 @@  discard block
 block discarded – undo
203 203
 			  
204 204
 			if (function_exists('rest_url')) {
205 205
 				//$rest_root = esc_url_raw( rest_url());
206
-				$rest_nonce = wp_create_nonce( 'wp_rest' );
207
-				$settings = array( 'root' => $rest_root, 'nonce' => $rest_nonce );
208
-				wp_enqueue_script( 'wp-api', '', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
209
-				wp_localize_script( 'wp-api', 'wpApiSettings', $settings );
210
-				wp_localize_script( 'wp-api', 'WP_API_Settings', $settings );
206
+				$rest_nonce = wp_create_nonce('wp_rest');
207
+				$settings = array('root' => $rest_root, 'nonce' => $rest_nonce);
208
+				wp_enqueue_script('wp-api', '', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true);
209
+				wp_localize_script('wp-api', 'wpApiSettings', $settings);
210
+				wp_localize_script('wp-api', 'WP_API_Settings', $settings);
211 211
 				
212
-				if ( class_exists( 'WP_REST_Controller' )) {
212
+				if (class_exists('WP_REST_Controller')) {
213 213
 					// we are using REST API V2
214 214
 					$using_restapiv2 = true;
215 215
 				}
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
             
218 218
             //excerpt
219 219
             $post_excerpt = "";
220
-            $post_excerpt = wp_strip_all_tags($post->post_excerpt,true);
220
+            $post_excerpt = wp_strip_all_tags($post->post_excerpt, true);
221 221
             
222 222
             //find if this is multi page. -1 if not
223 223
             $multipage = self::is_multipage();
@@ -228,24 +228,24 @@  discard block
 block discarded – undo
228 228
             //}
229 229
 			
230 230
 			//get custom taxonomy
231
-			$custom_taxonomies         = array_diff(get_object_taxonomies( get_post_type( $postid ), 'names' ), ['category','post_tag','post_format']);
232
-			$post_taxo_arr    = array();
231
+			$custom_taxonomies         = array_diff(get_object_taxonomies(get_post_type($postid), 'names'), ['category', 'post_tag', 'post_format']);
232
+			$post_taxo_arr = array();
233 233
 			foreach ($custom_taxonomies as $taxonomy) {
234
-				$post_taxo_arr[$taxonomy] = lasso_get_post_objects( $postid, $taxonomy );
234
+				$post_taxo_arr[$taxonomy] = lasso_get_post_objects($postid, $taxonomy);
235 235
 			}
236
-			$existing_taxo_arr    = array();
236
+			$existing_taxo_arr = array();
237 237
 			foreach ($custom_taxonomies as $taxonomy) {
238
-				$existing_taxo_arr[$taxonomy] = lasso_get_objects( $taxonomy );
238
+				$existing_taxo_arr[$taxonomy] = lasso_get_objects($taxonomy);
239 239
 			}
240 240
             
241
-            $new_post_text    = lasso_editor_get_option( 'new_post_text', 'lasso_editor' );        
242
-            $new_post_text  = !empty($new_post_text) ? $new_post_text : wp_strip_all_tags(apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso')));
241
+            $new_post_text = lasso_editor_get_option('new_post_text', 'lasso_editor');        
242
+            $new_post_text = !empty($new_post_text) ? $new_post_text : wp_strip_all_tags(apply_filters('lasso_new_object_content', __('Once upon a time...', 'lasso')));
243 243
 
244 244
 
245 245
 			// localized objects
246 246
 			$objects = array(
247
-				'ajaxurl' 			=> esc_url( $api_url ),
248
-				'ajaxurl2' 			=> esc_url( admin_url( 'admin-ajax.php' )),
247
+				'ajaxurl' 			=> esc_url($api_url),
248
+				'ajaxurl2' 			=> esc_url(admin_url('admin-ajax.php')),
249 249
 				'siteUrl'           => site_url(),
250 250
 				'rest_root'         => $rest_root,
251 251
 				'rest_nonce'        => $rest_nonce,
@@ -254,13 +254,13 @@  discard block
 block discarded – undo
254 254
 				'featImgClass'		=> $featImgClass,
255 255
 				'titleClass'		=> $titleClass,
256 256
 				'strings'			=> $strings,
257
-				'settingsLink'		=> function_exists('is_multisite') && is_multisite() ? network_admin_url( 'settings.php?page=lasso-editor' ) : admin_url( 'admin.php?page=lasso-editor-settings' ),
258
-				'post_status'		=> get_post_status( $postid ),
257
+				'settingsLink'		=> function_exists('is_multisite') && is_multisite() ? network_admin_url('settings.php?page=lasso-editor') : admin_url('admin.php?page=lasso-editor-settings'),
258
+				'post_status'		=> get_post_status($postid),
259 259
 				'postid'			=> $postid,
260 260
 				'permalink'			=> $permalink,
261 261
 				'edit_others_pages'	=> current_user_can('edit_others_pages') ? true : false,
262 262
 				'edit_others_posts'	=> current_user_can('edit_others_posts') ? true : false,
263
-				'userCanEdit'		=> current_user_can('edit_post', $postid ),
263
+				'userCanEdit'		=> current_user_can('edit_post', $postid),
264 264
 				'can_publish'		=> is_page() ? current_user_can('publish_pages') : current_user_can('publish_posts'),
265 265
 				//'can_publish_posts'	=> current_user_can('publish_posts'),
266 266
 				//'can_publish_pages'	=> current_user_can('publish_pages'),
@@ -299,39 +299,39 @@  discard block
 block discarded – undo
299 299
 				'extCusTaxonomies' => $existing_taxo_arr,
300 300
 				'noResultsDiv'		=> lasso_editor_empty_results(),
301 301
 				'noRevisionsDiv'	=> lasso_editor_empty_results('revision'),
302
-				'mapTileProvider'   => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider( $postid ) : false,
303
-				'mapLocations'		=> get_post_meta( $postid, 'ase_map_component_locations' ),
304
-				'mapStart'			=> get_post_meta( $postid, 'ase_map_component_start_point', true ),
305
-				'mapZoom'			=> get_post_meta( $postid, 'ase_map_component_zoom', true ),
302
+				'mapTileProvider'   => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider($postid) : false,
303
+				'mapLocations'		=> get_post_meta($postid, 'ase_map_component_locations'),
304
+				'mapStart'			=> get_post_meta($postid, 'ase_map_component_start_point', true),
305
+				'mapZoom'			=> get_post_meta($postid, 'ase_map_component_zoom', true),
306 306
 				'revisionModal' 	=> lasso_editor_revision_modal(),
307 307
 				'isMobile'          => wp_is_mobile(),
308
-				'enableAutoSave'    => lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ),
308
+				'enableAutoSave'    => lasso_editor_get_option('enable_autosave', 'lasso_editor'),
309 309
 				'showColor'         => $show_color,
310 310
 				'showAlignment'     => $show_align,
311 311
 				'showIgnoredItems'  => lasso_editor_get_option('show_ignored_items', 'lasso_editor'),
312 312
 				'restapi2'          => $using_restapiv2,
313 313
 				'saveusingrest'     => $using_restapiv2 && !$disableRESTSave,
314
-				'newObjectContent'  => '<p class="editus-firstp" placeholder="'. $new_post_text . '"></p>',
314
+				'newObjectContent'  => '<p class="editus-firstp" placeholder="'.$new_post_text.'"></p>',
315 315
 				'disableSavePost'   => $save_to_post_disabled,
316 316
 				'disableEditPost'   => $edit_post_disabled,
317 317
 				'boldTag'           => $bold_tag,
318 318
 				'iTag'           	=> $i_tag, 
319 319
 				'customFields'      => $custom_fields,
320
-				'clickToInsert'     => ($insert_comp_ui =='click'),
321
-				'buttonOnEmptyP'     => ($insert_comp_ui =='mediumcom'),      // auto show a button to insert components on an empty paragraph      
320
+				'clickToInsert'     => ($insert_comp_ui == 'click'),
321
+				'buttonOnEmptyP'     => ($insert_comp_ui == 'mediumcom'), // auto show a button to insert components on an empty paragraph      
322 322
                 'rtl'               => is_rtl(),				
323
-				'skipToEdit'        =>( $delta < 10 && $delta >=0 ), // if it's a new post, skip to edit mode
323
+				'skipToEdit'        =>($delta < 10 && $delta >= 0), // if it's a new post, skip to edit mode
324 324
 				'linksEditable'    => $links_editable,
325 325
 				'supportPendingStatus' => !$no_pending_status,
326
-				'tableCode' => apply_filters( 'lasso_table_html_code','<table><tr><th>Cell 1</th><th>Cell 2</th></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table><p></p>'),
327
-                'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) || self::gutenberg_active(),//,
326
+				'tableCode' => apply_filters('lasso_table_html_code', '<table><tr><th>Cell 1</th><th>Cell 2</th></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table><p></p>'),
327
+                'hasGutenberg' => (function_exists('has_blocks') && has_blocks($post->post_content)) || self::gutenberg_active(), //,
328 328
                 'multipages'=> $multipage,
329 329
                 'post_content'=>$post_content,
330 330
                 'post_excerpt'=>$post_excerpt,
331 331
                 'supCustTaxo' => $support_custom_taxonomy == 'on',
332
-                'oldWPimg'=> $use_old_wpimg =='on',
332
+                'oldWPimg'=> $use_old_wpimg == 'on',
333 333
                 'useWPImgBlk'=> $use_wpimgblock,
334
-                'prefixHTTP'=> $link_prefix_http =='on'
334
+                'prefixHTTP'=> $link_prefix_http == 'on'
335 335
 			);
336 336
 
337 337
 
@@ -340,9 +340,9 @@  discard block
 block discarded – undo
340 340
 			
341 341
 			if (!$using_restapiv2) {
342 342
                // enqueue REST API V1
343
-			   wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
344
-			   $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) );
345
-			   wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings );
343
+			   wp_enqueue_script('wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true);
344
+			   $settings = array('root' => home_url($home_url), 'nonce' => wp_create_nonce('wp_json'));
345
+			   wp_localize_script('wp-api-js', 'WP_API_Settings', $settings);
346 346
 			}
347 347
 			
348 348
 			if ($allow_change_date) {
@@ -351,13 +351,13 @@  discard block
 block discarded – undo
351 351
 				wp_enqueue_style('jquery-ui');
352 352
 			}
353 353
 
354
-			$postfix = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? '' : '.min';
354
+			$postfix = (defined('SCRIPT_DEBUG') && true === SCRIPT_DEBUG) ? '' : '.min';
355 355
 			if ($show_color) {
356
-				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true);
356
+				wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api', 'iris'), LASSO_VERSION, true);
357 357
 			} else {
358
-			    wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
358
+			    wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
359 359
 			}
360
-			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) );
360
+			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects));
361 361
 
362 362
 
363 363
 		}
@@ -367,20 +367,20 @@  discard block
 block discarded – undo
367 367
     function gutenberg_active() {
368 368
         
369 369
         // Gutenberg plugin is installed and activated.
370
-        $gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) );
370
+        $gutenberg = !(false === has_filter('replace_editor', 'gutenberg_init'));
371 371
 
372 372
         // Block editor since 5.0.
373
-        $block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' );
373
+        $block_editor = version_compare($GLOBALS['wp_version'], '5.0-beta', '>');
374 374
 
375
-        if ( ! $gutenberg && ! $block_editor ) {
375
+        if (!$gutenberg && !$block_editor) {
376 376
             return false;
377 377
         }
378 378
 
379
-        if ( self::is_classic_editor_plugin_active() ) {
380
-            $editor_option       = get_option( 'classic-editor-replace' );
381
-            $block_editor_active = array( 'no-replace', 'block' );
379
+        if (self::is_classic_editor_plugin_active()) {
380
+            $editor_option       = get_option('classic-editor-replace');
381
+            $block_editor_active = array('no-replace', 'block');
382 382
 
383
-            return in_array( $editor_option, $block_editor_active, true );
383
+            return in_array($editor_option, $block_editor_active, true);
384 384
         }
385 385
 
386 386
         return true;
@@ -392,11 +392,11 @@  discard block
 block discarded – undo
392 392
      * @return bool
393 393
      */
394 394
     function is_classic_editor_plugin_active() {
395
-        if ( ! function_exists( 'is_plugin_active' ) ) {
396
-            include_once ABSPATH . 'wp-admin/includes/plugin.php';
395
+        if (!function_exists('is_plugin_active')) {
396
+            include_once ABSPATH.'wp-admin/includes/plugin.php';
397 397
         }
398 398
 
399
-        if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) {
399
+        if (is_plugin_active('classic-editor/classic-editor.php')) {
400 400
             return true;
401 401
         }
402 402
 
Please login to merge, or discard this patch.
admin/includes/menus/settings.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -98,8 +98,8 @@  discard block
 block discarded – undo
98 98
 		if ( !is_user_logged_in() )
99 99
 			return;
100 100
         
101
-        // check for lasso story engine and add a class doniting this
102
-        $ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active';
101
+		// check for lasso story engine and add a class doniting this
102
+		$ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active';
103 103
 
104 104
 		$article_object   = lasso_editor_get_option( 'article_class', 'lasso_editor' );
105 105
 		$featImgClass    = lasso_editor_get_option( 'featimg_class', 'lasso_editor' );
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 		$edit_post_disabled  = lasso_editor_get_option( 'post_edit_disabled', 'lasso_editor' );
111 111
 		$post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' );
112 112
 		$allow_change_date = lasso_editor_get_option( 'allow_change_date', 'lasso_editor' );
113
-        $allow_edit_excerpt = lasso_editor_get_option( 'allow_edit_excerpt', 'lasso_editor' );
113
+		$allow_edit_excerpt = lasso_editor_get_option( 'allow_edit_excerpt', 'lasso_editor' );
114 114
 		$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
115 115
 		$shortcodify_disabled  = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' );
116 116
 		$enable_autosave  = lasso_editor_get_option( 'enable_autosave', 'lasso_editor' );
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 		$bold_tag = lasso_editor_get_option( 'bold_tag', 'lasso_editor',  "b");
136 136
 		$i_tag = lasso_editor_get_option( 'i_tag', 'lasso_editor',  "i");
137 137
         
138
-        $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
138
+		$add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
139 139
 		
140 140
 		// do we support pending status
141 141
 		$no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor');
@@ -147,14 +147,14 @@  discard block
 block discarded – undo
147 147
 			$insert_comp_ui = 'drag';
148 148
 		}
149 149
         
150
-        $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor');
150
+		$link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor');
151 151
         
152
-        $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
153
-        $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
152
+		$use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
153
+		$use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
154 154
 		
155 155
 		$support_custom_taxonomy   = lasso_editor_get_option( 'support_custom_taxonomy', 'lasso_editor' );
156 156
         
157
-        $new_post_text    = lasso_editor_get_option( 'new_post_text', 'lasso_editor' );
157
+		$new_post_text    = lasso_editor_get_option( 'new_post_text', 'lasso_editor' );
158 158
 
159 159
 ?>
160 160
 		<div class="wrap">
Please login to merge, or discard this patch.
Spacing   +180 added lines, -180 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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();
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 	}
81 81
 	
82 82
 	function create_section_for_color_picker($id, $title, $defvalue) { 
83
-		$color_value = lasso_editor_get_option( $id, 'lasso_editor',$defvalue );
83
+		$color_value = lasso_editor_get_option($id, 'lasso_editor', $defvalue);
84 84
 	 
85 85
 		echo '<div lass="lasso-editor-settings--option-inner">'."\n";
86 86
 		echo '<label>'.$title.'</label>';
@@ -95,45 +95,45 @@  discard block
 block discarded – undo
95 95
 	 */
96 96
 	function lasso_editor_settings_form() {
97 97
 
98
-		if ( !is_user_logged_in() )
98
+		if (!is_user_logged_in())
99 99
 			return;
100 100
         
101 101
         // check for lasso story engine and add a class doniting this
102
-        $ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active';
103
-
104
-		$article_object   = lasso_editor_get_option( 'article_class', 'lasso_editor' );
105
-		$featImgClass    = lasso_editor_get_option( 'featimg_class', 'lasso_editor' );
106
-		$titleClass    = lasso_editor_get_option( 'title_class', 'lasso_editor' );
107
-
108
-		$post_new_disabled   = lasso_editor_get_option( 'post_adding_disabled', 'lasso_editor' );
109
-		$save_to_post_disabled  = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' );
110
-		$edit_post_disabled  = lasso_editor_get_option( 'post_edit_disabled', 'lasso_editor' );
111
-		$post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' );
112
-		$allow_change_date = lasso_editor_get_option( 'allow_change_date', 'lasso_editor' );
113
-        $allow_edit_excerpt = lasso_editor_get_option( 'allow_edit_excerpt', 'lasso_editor' );
114
-		$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
115
-		$shortcodify_disabled  = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' );
116
-		$enable_autosave  = lasso_editor_get_option( 'enable_autosave', 'lasso_editor' );
117
-
118
-		$use_old_ui      = lasso_editor_get_option( 'use_old_ui', 'lasso_editor' );
119
-		$toolbar_headings      = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' );
120
-		$toolbar_headings_h4      = lasso_editor_get_option( 'toolbar_headings_h4', 'lasso_editor' );
121
-		$toolbar_list      = lasso_editor_get_option( 'toolbar_list', 'lasso_editor' );
122
-		$toolbar_show_color      = lasso_editor_get_option( 'toolbar_show_color', 'lasso_editor' );
123
-		$toolbar_show_alignment  = lasso_editor_get_option( 'toolbar_show_alignment', 'lasso_editor' );
102
+        $ase_status = class_exists('Aesop_Core') || defined('LASSO_CUSTOM') ? 'ase-active' : 'ase-not-active';
103
+
104
+		$article_object   = lasso_editor_get_option('article_class', 'lasso_editor');
105
+		$featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor');
106
+		$titleClass = lasso_editor_get_option('title_class', 'lasso_editor');
107
+
108
+		$post_new_disabled   = lasso_editor_get_option('post_adding_disabled', 'lasso_editor');
109
+		$save_to_post_disabled  = lasso_editor_get_option('post_save_disabled', 'lasso_editor');
110
+		$edit_post_disabled  = lasso_editor_get_option('post_edit_disabled', 'lasso_editor');
111
+		$post_settings_disabled = lasso_editor_get_option('post_settings_disabled', 'lasso_editor');
112
+		$allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor');
113
+        $allow_edit_excerpt = lasso_editor_get_option('allow_edit_excerpt', 'lasso_editor');
114
+		$allow_new_category = lasso_editor_get_option('allow_new_category', 'lasso_editor');
115
+		$shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor');
116
+		$enable_autosave = lasso_editor_get_option('enable_autosave', 'lasso_editor');
117
+
118
+		$use_old_ui = lasso_editor_get_option('use_old_ui', 'lasso_editor');
119
+		$toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor');
120
+		$toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
121
+		$toolbar_list = lasso_editor_get_option('toolbar_list', 'lasso_editor');
122
+		$toolbar_show_color      = lasso_editor_get_option('toolbar_show_color', 'lasso_editor');
123
+		$toolbar_show_alignment  = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor');
124 124
 		
125
-		$objectsNoSave  	= lasso_editor_get_option('dont_save', 'lasso_editor');
126
-		$objectsNonEditable  	= lasso_editor_get_option('non_editable', 'lasso_editor');
125
+		$objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor');
126
+		$objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor');
127 127
 		$disable_tour = lasso_editor_get_option('disable_tour', 'lasso_editor');
128 128
 		$show_ignored_items = lasso_editor_get_option('show_ignored_items', 'lasso_editor');
129 129
 		$save_using_rest_disabled = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor');
130 130
 		
131
-		$default_post_types = apply_filters( 'lasso_allowed_post_types', array( 'post', 'page'));
132
-		$allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor',  $default_post_types);
131
+		$default_post_types = apply_filters('lasso_allowed_post_types', array('post', 'page'));
132
+		$allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', $default_post_types);
133 133
 		
134 134
 		$links_editable = lasso_editor_get_option('links_editable', 'lasso_editor', false);
135
-		$bold_tag = lasso_editor_get_option( 'bold_tag', 'lasso_editor',  "b");
136
-		$i_tag = lasso_editor_get_option( 'i_tag', 'lasso_editor',  "i");
135
+		$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor', "b");
136
+		$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor', "i");
137 137
         
138 138
         $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
139 139
 		
@@ -149,41 +149,41 @@  discard block
 block discarded – undo
149 149
         
150 150
         $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor');
151 151
         
152
-        $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
153
-        $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
152
+        $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor', 'off');
153
+        $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor', 'off');
154 154
 		
155
-		$support_custom_taxonomy   = lasso_editor_get_option( 'support_custom_taxonomy', 'lasso_editor' );
155
+		$support_custom_taxonomy = lasso_editor_get_option('support_custom_taxonomy', 'lasso_editor');
156 156
         
157
-        $new_post_text    = lasso_editor_get_option( 'new_post_text', 'lasso_editor' );
157
+        $new_post_text = lasso_editor_get_option('new_post_text', 'lasso_editor');
158 158
 
159 159
 ?>
160 160
 		<div class="wrap">
161 161
         
162
-	    	<h2><?php _e( 'Editus Settings', 'lasso' );?></h2>
162
+	    	<h2><?php _e('Editus Settings', 'lasso'); ?></h2>
163 163
             
164 164
 			<form id="lasso-editor-settings-form" class="lasso--form-settings" method="post" enctype="multipart/form-data">
165 165
 
166
-				<?php do_action('lasso_settings_before');?>
166
+				<?php do_action('lasso_settings_before'); ?>
167 167
 				
168 168
 				
169 169
 				
170
-				<h3><?php _e( 'Enable for:', 'lasso' );?></h3>
170
+				<h3><?php _e('Enable for:', 'lasso'); ?></h3>
171 171
 				<div class="lasso-editor-settings--option-wrap">
172 172
 					<div class="lasso-editor-settings--option-inner">
173 173
 						
174
-						<span class="lasso--setting-description"><?php _e( 'Enable Editus for the following post types.', 'lasso' );?></span>
174
+						<span class="lasso--setting-description"><?php _e('Enable Editus for the following post types.', 'lasso'); ?></span>
175 175
 						<?php
176 176
 						$args = array(
177 177
 							'public'   => true
178 178
 						);
179 179
 						 
180
-						$allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
181
-						$post_types = get_post_types( $args, 'objects' );
180
+						$allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types);
181
+						$post_types = get_post_types($args, 'objects');
182 182
 						 
183
-						foreach ( $post_types  as $post_type ) {
183
+						foreach ($post_types  as $post_type) {
184 184
 						   if ($post_type->name == 'attachment') continue;
185
-						   $checked ="";
186
-						   if (  in_array( $post_type->name, $allowed_post_types )  ) {
185
+						   $checked = "";
186
+						   if (in_array($post_type->name, $allowed_post_types)) {
187 187
 								$checked = 'checked="checked"';
188 188
 						   }
189 189
 						   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>';
@@ -193,126 +193,126 @@  discard block
 block discarded – undo
193 193
 				</div>
194 194
 				
195 195
 
196
-				<h3><?php _e( 'Internal Settings', 'lasso' );?></h3>
196
+				<h3><?php _e('Internal Settings', 'lasso'); ?></h3>
197 197
 				<div class="lasso-editor-settings--option-wrap">
198 198
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
199
-						<label><?php _e( 'Article Class', 'lasso' );?></label>
200
-						<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>
201
-						<input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr( $article_object );?>" placeholder=".entry-content">
199
+						<label><?php _e('Article Class', 'lasso'); ?></label>
200
+						<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>
201
+						<input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr($article_object); ?>" placeholder=".entry-content">
202 202
 					</div>
203 203
 				
204 204
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
205
-						<label><?php _e( 'Featured Image Class', 'lasso' );?></label>
206
-						<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>
207
-						<input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr( $featImgClass );?>" placeholder=".entry-content">
205
+						<label><?php _e('Featured Image Class', 'lasso'); ?></label>
206
+						<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>
207
+						<input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr($featImgClass); ?>" placeholder=".entry-content">
208 208
 					</div>
209 209
 				
210 210
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
211
-						<label><?php _e( 'Article Title Class', 'lasso' );?></label>
212
-						<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>
213
-						<input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr( $titleClass );?>" placeholder=".entry-content">
211
+						<label><?php _e('Article Title Class', 'lasso'); ?></label>
212
+						<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>
213
+						<input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr($titleClass); ?>" placeholder=".entry-content">
214 214
 					</div>
215 215
 				
216 216
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
217
-						<label><?php _e( 'Ignored Items to Save', 'lasso' );?></label>
218
-						<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>
219
-						<textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNoSave );?></textarea>
217
+						<label><?php _e('Ignored Items to Save', 'lasso'); ?></label>
218
+						<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>
219
+						<textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr($objectsNoSave); ?></textarea>
220 220
 					</div>
221 221
 				
222 222
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
223
-						<label><?php _e( 'Read Only Items', 'lasso' );?></label>
224
-						<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>
225
-						<textarea name="lasso_editor[non_editable]" id="lasso_editor[non_editable]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNonEditable );?></textarea>
223
+						<label><?php _e('Read Only Items', 'lasso'); ?></label>
224
+						<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>
225
+						<textarea name="lasso_editor[non_editable]" id="lasso_editor[non_editable]" placeholder=".classname, .another-class"><?php echo esc_attr($objectsNonEditable); ?></textarea>
226 226
 					</div>
227 227
 				
228 228
 					<div class="lasso-editor-settings--option-inner" >
229
-						<input type="checkbox" class="checkbox" name="lasso_editor[show_ignored_items]" id="lasso_editor[show_ignored_items]" <?php echo checked( $show_ignored_items, 'on' );?> >
230
-						<label for="lasso_editor[show_ignored_items]"> <?php _e( 'Show Ignored Items', 'lasso' );?></label>
231
-						<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>
229
+						<input type="checkbox" class="checkbox" name="lasso_editor[show_ignored_items]" id="lasso_editor[show_ignored_items]" <?php echo checked($show_ignored_items, 'on'); ?> >
230
+						<label for="lasso_editor[show_ignored_items]"> <?php _e('Show Ignored Items', 'lasso'); ?></label>
231
+						<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>
232 232
 					</div>
233 233
 				</div>
234 234
 
235
-				<h3><?php _e( 'Editor UI', 'lasso' );?></h3>
235
+				<h3><?php _e('Editor UI', 'lasso'); ?></h3>
236 236
 				<div class="lasso-editor-settings--option-wrap">
237 237
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
238
-						<input type="checkbox" class="checkbox" name="lasso_editor[use_old_ui]" id="lasso_editor_use_old_ui" <?php echo checked( $use_old_ui, 'on' );?> >
239
-						<label for="lasso_editor[use_old_ui]"><?php _e( 'Use the Old Toolbar', 'lasso' );?></label>
240
-						<span class="lasso--setting-description"><?php _e( 'Use this option to disable the new color options and use the pre-1.0 toolbar.', 'lasso' );?></span>
238
+						<input type="checkbox" class="checkbox" name="lasso_editor[use_old_ui]" id="lasso_editor_use_old_ui" <?php echo checked($use_old_ui, 'on'); ?> >
239
+						<label for="lasso_editor[use_old_ui]"><?php _e('Use the Old Toolbar', 'lasso'); ?></label>
240
+						<span class="lasso--setting-description"><?php _e('Use this option to disable the new color options and use the pre-1.0 toolbar.', 'lasso'); ?></span>
241 241
 					</div>
242 242
 				    <div id="lasso-editor-settings--colors">
243 243
 					<?php
244
-					self::create_section_for_color_picker('button-color1', _e( 'Editor Bar Color Top', 'lasso' ), '#0000ff');
245
-					self::create_section_for_color_picker('button-color2', _e( 'Editor Bar Color Bottom', 'lasso' ), '#000030');
246
-					self::create_section_for_color_picker('dialog-color', _e( 'Dialog Color', 'lasso' ), '#000055');
247
-					self::create_section_for_color_picker('text-color', _e( 'Icon/Text Color', 'lasso' ), '#ffffff');
244
+					self::create_section_for_color_picker('button-color1', _e('Editor Bar Color Top', 'lasso'), '#0000ff');
245
+					self::create_section_for_color_picker('button-color2', _e('Editor Bar Color Bottom', 'lasso'), '#000030');
246
+					self::create_section_for_color_picker('dialog-color', _e('Dialog Color', 'lasso'), '#000055');
247
+					self::create_section_for_color_picker('text-color', _e('Icon/Text Color', 'lasso'), '#ffffff');
248 248
 					?>
249
-					<button type="button" id="lasso-editor-settings--default-colors" ><?php _e( 'Default Colors', 'lasso' );?></button>
249
+					<button type="button" id="lasso-editor-settings--default-colors" ><?php _e('Default Colors', 'lasso'); ?></button>
250 250
 				    <div style="height:50px;"></div>
251 251
 					</div>
252 252
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
253
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked( $toolbar_headings, 'on' );?> >
254
-						<label for="lasso_editor[toolbar_headings]"><?php _e( 'Enable H2 and H3 Buttons', 'lasso' );?></label>
255
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set H2 and H3 settings.', 'lasso' );?></span>
253
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked($toolbar_headings, 'on'); ?> >
254
+						<label for="lasso_editor[toolbar_headings]"><?php _e('Enable H2 and H3 Buttons', 'lasso'); ?></label>
255
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set H2 and H3 settings.', 'lasso'); ?></span>
256 256
 
257 257
 					</div>
258 258
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
259
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings_h4]" id="lasso_editor[toolbar_headings_h4]" <?php echo checked( $toolbar_headings_h4, 'on' );?> >
260
-						<label for="lasso_editor[toolbar_headings_h4]"><?php _e( 'Enable H4/H5/H6 Buttons', 'lasso' );?></label>
261
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set H4/H5/H6 settings.', 'lasso' );?></span>
259
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings_h4]" id="lasso_editor[toolbar_headings_h4]" <?php echo checked($toolbar_headings_h4, 'on'); ?> >
260
+						<label for="lasso_editor[toolbar_headings_h4]"><?php _e('Enable H4/H5/H6 Buttons', 'lasso'); ?></label>
261
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set H4/H5/H6 settings.', 'lasso'); ?></span>
262 262
 
263 263
 					</div>
264 264
 					
265 265
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
266
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_list]" id="lasso_editor[toolbar_list]" <?php echo checked( $toolbar_list, 'on' );?> >
267
-						<label for="lasso_editor[toolbar_list]"><?php _e( 'Enable OL/UL Buttons', 'lasso' );?></label>
268
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to create Ordered and Unordered Lists from text selection.', 'lasso' );?></span>
266
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_list]" id="lasso_editor[toolbar_list]" <?php echo checked($toolbar_list, 'on'); ?> >
267
+						<label for="lasso_editor[toolbar_list]"><?php _e('Enable OL/UL Buttons', 'lasso'); ?></label>
268
+						<span class="lasso--setting-description"><?php _e('Show the buttons to create Ordered and Unordered Lists from text selection.', 'lasso'); ?></span>
269 269
 					</div>
270 270
 					
271 271
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
272
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_color]" id="lasso_editor[toolbar_show_color]" <?php echo checked( $toolbar_show_color, 'on' );?> >
273
-						<label for="lasso_editor[toolbar_show_color]"><?php _e( 'Enable Text Color Buttons', 'lasso' );?></label>
274
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set text colors.', 'lasso' );?></span>
272
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_color]" id="lasso_editor[toolbar_show_color]" <?php echo checked($toolbar_show_color, 'on'); ?> >
273
+						<label for="lasso_editor[toolbar_show_color]"><?php _e('Enable Text Color Buttons', 'lasso'); ?></label>
274
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set text colors.', 'lasso'); ?></span>
275 275
 
276 276
 					</div>
277 277
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
278
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_alignment]" id="lasso_editor[toolbar_show_alignment]" <?php echo checked( $toolbar_show_alignment, 'on' );?> >
279
-						<label for="lasso_editor[toolbar_show_alignment]"><?php _e( 'Enable Text Align Buttons', 'lasso' );?></label>
280
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set text alignment.', 'lasso' );?></span>
278
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_alignment]" id="lasso_editor[toolbar_show_alignment]" <?php echo checked($toolbar_show_alignment, 'on'); ?> >
279
+						<label for="lasso_editor[toolbar_show_alignment]"><?php _e('Enable Text Align Buttons', 'lasso'); ?></label>
280
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set text alignment.', 'lasso'); ?></span>
281 281
 
282 282
 					</div>
283 283
 					
284 284
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
285
-						<input type="checkbox" class="checkbox" name="lasso_editor[links_editable]" id="lasso_editor[links_editable]" <?php echo checked( $links_editable, 'on' );?> >
286
-						<label for="lasso_editor[links_editable]"><?php _e( 'Make links editable under the Editing Mode', 'lasso' );?></label>
287
-						<span class="lasso--setting-description"><?php _e( 'Make links editable under the Editing Mode. Turning this on will make the links non-clickable while editing.', 'lasso' );?></span>
285
+						<input type="checkbox" class="checkbox" name="lasso_editor[links_editable]" id="lasso_editor[links_editable]" <?php echo checked($links_editable, 'on'); ?> >
286
+						<label for="lasso_editor[links_editable]"><?php _e('Make links editable under the Editing Mode', 'lasso'); ?></label>
287
+						<span class="lasso--setting-description"><?php _e('Make links editable under the Editing Mode. Turning this on will make the links non-clickable while editing.', 'lasso'); ?></span>
288 288
 
289 289
 					</div>
290 290
 					<div class="lasso-editor-settings--option-inner">
291
-					    <label for="lasso_editor[insert_comp_ui]"> <?php _e( 'Insert Component UI', 'lasso' );?></label>
292
-						<span class="lasso--setting-description"><?php _e( 'UI mechanism to insert components', 'lasso' );?></span>
291
+					    <label for="lasso_editor[insert_comp_ui]"> <?php _e('Insert Component UI', 'lasso'); ?></label>
292
+						<span class="lasso--setting-description"><?php _e('UI mechanism to insert components', 'lasso'); ?></span>
293 293
 						<div class="lasso-editor-settings--option-inner" style="border:none;">
294
-					       <input type="radio" name="lasso_editor[insert_comp_ui]" value='drag' <?php echo checked( $insert_comp_ui, 'drag' );?>> <?php _e( 'Drag and Drop', 'lasso' );?>
294
+					       <input type="radio" name="lasso_editor[insert_comp_ui]" value='drag' <?php echo checked($insert_comp_ui, 'drag'); ?>> <?php _e('Drag and Drop', 'lasso'); ?>
295 295
 						</div>
296 296
 						<div class="lasso-editor-settings--option-inner" style="border:none;">
297
-						<input type="radio" name="lasso_editor[insert_comp_ui]" value="click" <?php echo checked( $insert_comp_ui, 'click' );?>> <?php _e( 'Click', 'lasso' );?>
297
+						<input type="radio" name="lasso_editor[insert_comp_ui]" value="click" <?php echo checked($insert_comp_ui, 'click'); ?>> <?php _e('Click', 'lasso'); ?>
298 298
 						</div>
299 299
 						<div class="lasso-editor-settings--option-inner" style="border:none;">
300
-						<input type="radio" name="lasso_editor[insert_comp_ui]" value="mediumcom" <?php echo checked( $insert_comp_ui, 'mediumcom' );?>> <?php _e( 'Auto Button on Empty Paragraph. medium.com-like UI.', 'lasso' );?>
300
+						<input type="radio" name="lasso_editor[insert_comp_ui]" value="mediumcom" <?php echo checked($insert_comp_ui, 'mediumcom'); ?>> <?php _e('Auto Button on Empty Paragraph. medium.com-like UI.', 'lasso'); ?>
301 301
 						</div>
302 302
 					</div>
303 303
                     
304 304
 				</div>
305 305
 				
306
-				<h3><?php _e( 'Component', 'lasso' );?></h3>
306
+				<h3><?php _e('Component', 'lasso'); ?></h3>
307 307
                 <div class="lasso-editor-settings--option-wrap" style="border:none;" >
308 308
                     <div class="lasso-editor-settings--option-inner" style="border:none">
309
-						<input type="checkbox" class="checkbox" name="lasso_editor[add_table]" id="lasso_editor[add_table]" <?php echo checked( $add_table, 'on' );?> >
310
-						<label for="lasso_editor[add_table]"><?php _e( 'Additional Component: Table', 'lasso' );?></label>
311
-						<span class="lasso--setting-description"><?php _e( 'Allow user to add and edit tables.', 'lasso' );?></span>
309
+						<input type="checkbox" class="checkbox" name="lasso_editor[add_table]" id="lasso_editor[add_table]" <?php echo checked($add_table, 'on'); ?> >
310
+						<label for="lasso_editor[add_table]"><?php _e('Additional Component: Table', 'lasso'); ?></label>
311
+						<span class="lasso--setting-description"><?php _e('Allow user to add and edit tables.', 'lasso'); ?></span>
312 312
 
313 313
 					</div>
314 314
                 
315
-                <?php if ( 'ase-active' != $ase_status ) { ?>
315
+                <?php if ('ase-active' != $ase_status) { ?>
316 316
                     <script>
317 317
                     $(document).ready(function(){
318 318
                         $("#lasso_editor\\[use_old_wpimg\\]").on('change', function(){                        
@@ -338,143 +338,143 @@  discard block
 block discarded – undo
338 338
                     </script>
339 339
                 
340 340
                     <div class="lasso-editor-settings--option-inner" style="border:none">
341
-						<input type="checkbox" class="checkbox" name="lasso_editor[use_old_wpimg]" id="lasso_editor[use_old_wpimg]" <?php echo checked( $use_old_wpimg, 'on' );?> >
342
-						<label for="lasso_editor[use_old_wpimg]"><?php _e( 'Use Simple Image', 'lasso' );?></label>
343
-						<span class="lasso--setting-description"><?php _e( 'Use Simple Image Component without Extra Options.', 'lasso' );?></span>
341
+						<input type="checkbox" class="checkbox" name="lasso_editor[use_old_wpimg]" id="lasso_editor[use_old_wpimg]" <?php echo checked($use_old_wpimg, 'on'); ?> >
342
+						<label for="lasso_editor[use_old_wpimg]"><?php _e('Use Simple Image', 'lasso'); ?></label>
343
+						<span class="lasso--setting-description"><?php _e('Use Simple Image Component without Extra Options.', 'lasso'); ?></span>
344 344
 
345 345
 					</div>
346 346
                 
347 347
                 
348 348
                     <div class="lasso-editor-settings--option-inner" style="border:none">
349
-						<input type="checkbox" class="checkbox" name="lasso_editor[use_wp_block_image]" id="lasso_editor[use_wp_block_image]" <?php echo checked( $use_wp_block_image, 'on' );?> >
350
-						<label for="lasso_editor[use_wp_block_image]"><?php _e( 'Use WP Image Block', 'lasso' );?></label>
351
-						<span class="lasso--setting-description"><?php _e( 'Use WP Image Block as the image component. Gutenberg Block Editor needs to be enabled.', 'lasso' );?></span>
349
+						<input type="checkbox" class="checkbox" name="lasso_editor[use_wp_block_image]" id="lasso_editor[use_wp_block_image]" <?php echo checked($use_wp_block_image, 'on'); ?> >
350
+						<label for="lasso_editor[use_wp_block_image]"><?php _e('Use WP Image Block', 'lasso'); ?></label>
351
+						<span class="lasso--setting-description"><?php _e('Use WP Image Block as the image component. Gutenberg Block Editor needs to be enabled.', 'lasso'); ?></span>
352 352
 
353 353
 					</div>
354 354
                 <?php }?>
355 355
                 </div>
356 356
 				
357 357
 
358
-				<h3><?php _e( 'Post Settings UI', 'lasso' );?></h3>
358
+				<h3><?php _e('Post Settings UI', 'lasso'); ?></h3>
359 359
 				<div class="lasso-editor-settings--option-wrap"  >
360 360
 					<div class="lasso-editor-settings--option-inner" style="border:none">
361
-						<input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked( $post_settings_disabled, 'on' );?> >
362
-						<label for="lasso_editor[post_settings_disabled]"> <?php _e( 'Disable Post Settings', 'lasso' );?></label>
363
-						<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>
361
+						<input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked($post_settings_disabled, 'on'); ?> >
362
+						<label for="lasso_editor[post_settings_disabled]"> <?php _e('Disable Post Settings', 'lasso'); ?></label>
363
+						<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>
364 364
 					</div>
365 365
 					
366 366
 					<div class="lasso-editor-settings--option-inner" style="border:none">
367
-						<input type="checkbox" class="checkbox" name="lasso_editor[allow_change_date]" id="lasso_editor[allow_change_date]" <?php echo checked( $allow_change_date, 'on' );?> >
368
-						<label for="lasso_editor[allow_change_date]"> <?php _e( 'Allow Changing Post Date', 'lasso' );?></label>
369
-						<span class="lasso--setting-description"><?php _e( 'Add the date selector to change the post\'s date to the Post Setting dialog', 'lasso' );?></span>
367
+						<input type="checkbox" class="checkbox" name="lasso_editor[allow_change_date]" id="lasso_editor[allow_change_date]" <?php echo checked($allow_change_date, 'on'); ?> >
368
+						<label for="lasso_editor[allow_change_date]"> <?php _e('Allow Changing Post Date', 'lasso'); ?></label>
369
+						<span class="lasso--setting-description"><?php _e('Add the date selector to change the post\'s date to the Post Setting dialog', 'lasso'); ?></span>
370 370
 					</div>
371 371
                     
372 372
                     <div class="lasso-editor-settings--option-inner" style="border:none">
373
-						<input type="checkbox" class="checkbox" name="lasso_editor[allow_edit_excerpt]" id="lasso_editor[allow_edit_excerpt]" <?php echo checked( $allow_edit_excerpt, 'on' );?> >
374
-						<label for="lasso_editor[allow_edit_excerpt]"> <?php _e( 'Allow Editing Excerpt', 'lasso' );?></label>
375
-						<span class="lasso--setting-description"><?php _e( 'Allow the post\'s excerpt to be edited in the Post Setting dialog', 'lasso' );?></span>
373
+						<input type="checkbox" class="checkbox" name="lasso_editor[allow_edit_excerpt]" id="lasso_editor[allow_edit_excerpt]" <?php echo checked($allow_edit_excerpt, 'on'); ?> >
374
+						<label for="lasso_editor[allow_edit_excerpt]"> <?php _e('Allow Editing Excerpt', 'lasso'); ?></label>
375
+						<span class="lasso--setting-description"><?php _e('Allow the post\'s excerpt to be edited in the Post Setting dialog', 'lasso'); ?></span>
376 376
 					</div>
377 377
 					
378 378
 					<div class="lasso-editor-settings--option-inner" style="border:none">
379
-						<input type="checkbox" class="checkbox" name="lasso_editor[allow_new_category]" id="lasso_editor[allow_new_category]" <?php echo checked( $allow_new_category, 'on' );?> >
380
-						<label for="lasso_editor[allow_new_category]"> <?php _e( 'Allow Adding New Category', 'lasso' );?></label>
381
-						<span class="lasso--setting-description"><?php _e( 'Add the user to create new, previously non-existing categories for posts.', 'lasso' );?></span>
379
+						<input type="checkbox" class="checkbox" name="lasso_editor[allow_new_category]" id="lasso_editor[allow_new_category]" <?php echo checked($allow_new_category, 'on'); ?> >
380
+						<label for="lasso_editor[allow_new_category]"> <?php _e('Allow Adding New Category', 'lasso'); ?></label>
381
+						<span class="lasso--setting-description"><?php _e('Add the user to create new, previously non-existing categories for posts.', 'lasso'); ?></span>
382 382
 					</div>
383 383
 					
384 384
 					<div class="lasso-editor-settings--option-inner" style="border:none">
385
-						<input type="checkbox" class="checkbox" name="lasso_editor[no_pending_status]" id="lasso_editor[no_pending_status]" <?php echo checked( $no_pending_status, 'on' );?> >
386
-						<label for="lasso_editor[no_pending_status]"> <?php _e( 'Do Not Allow "Pending" Status', 'lasso' );?></label>
387
-						<span class="lasso--setting-description"><?php _e( 'Remove the Option to Set the Status to Pending.', 'lasso' );?></span>
385
+						<input type="checkbox" class="checkbox" name="lasso_editor[no_pending_status]" id="lasso_editor[no_pending_status]" <?php echo checked($no_pending_status, 'on'); ?> >
386
+						<label for="lasso_editor[no_pending_status]"> <?php _e('Do Not Allow "Pending" Status', 'lasso'); ?></label>
387
+						<span class="lasso--setting-description"><?php _e('Remove the Option to Set the Status to Pending.', 'lasso'); ?></span>
388 388
 					</div>
389 389
 					
390 390
 					<div class="lasso-editor-settings--option-inner" style="border:none">
391
-						<input type="checkbox" class="checkbox" name="lasso_editor[no_url_setting]" id="lasso_editor[no_slug_setting]" <?php echo checked( $no_url_setting, 'on' );?> >
392
-						<label for="lasso_editor[no_url_setting]"> <?php _e( 'Remove POST URL Option', 'lasso' );?></label>
393
-						<span class="lasso--setting-description"><?php _e( 'Remove the Option to Set the URL for the Post.', 'lasso' );?></span>
391
+						<input type="checkbox" class="checkbox" name="lasso_editor[no_url_setting]" id="lasso_editor[no_slug_setting]" <?php echo checked($no_url_setting, 'on'); ?> >
392
+						<label for="lasso_editor[no_url_setting]"> <?php _e('Remove POST URL Option', 'lasso'); ?></label>
393
+						<span class="lasso--setting-description"><?php _e('Remove the Option to Set the URL for the Post.', 'lasso'); ?></span>
394 394
 					</div>
395 395
 				
396 396
 					<div class="lasso-editor-settings--option-inner" style="border:none">
397
-						<input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked( $post_new_disabled, 'on' );?> >
398
-						<label for="lasso_editor[post_adding_disabled]"><?php _e( 'Disable Post Adding', 'lasso' );?></label>
399
-						<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>
397
+						<input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked($post_new_disabled, 'on'); ?> >
398
+						<label for="lasso_editor[post_adding_disabled]"><?php _e('Disable Post Adding', 'lasso'); ?></label>
399
+						<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>
400 400
 					</div>
401 401
 					
402 402
 					<div class="lasso-editor-settings--option-inner" >
403
-						<input type="checkbox" class="checkbox" name="lasso_editor[support_custom_taxonomy]" id="lasso_editor[support_custom_taxonomy]" <?php echo checked( $support_custom_taxonomy, 'on' );?> >
404
-						<label for="lasso_editor[support_custom_taxonomy]"><?php _e( 'Support Custom Taxonomy', 'lasso' );?></label>
405
-						<span class="lasso--setting-description"><?php _e( 'Allow editing custom taxonomies.', 'lasso' );?></span>
403
+						<input type="checkbox" class="checkbox" name="lasso_editor[support_custom_taxonomy]" id="lasso_editor[support_custom_taxonomy]" <?php echo checked($support_custom_taxonomy, 'on'); ?> >
404
+						<label for="lasso_editor[support_custom_taxonomy]"><?php _e('Support Custom Taxonomy', 'lasso'); ?></label>
405
+						<span class="lasso--setting-description"><?php _e('Allow editing custom taxonomies.', 'lasso'); ?></span>
406 406
 					</div>
407 407
 					
408 408
 
409 409
 				</div>
410 410
 				
411
-				<h3><?php _e( 'Misc', 'lasso' );?></h3>
411
+				<h3><?php _e('Misc', 'lasso'); ?></h3>
412 412
 				<div class="lasso-editor-settings--option-wrap">
413 413
 					<div class="lasso-editor-settings--option-inner" style="border:none">
414
-						<input type="checkbox" class="checkbox" name="lasso_editor[disable_tour]" id="lasso_editor[disable_tour]" <?php echo checked( $disable_tour, 'on' );?> >
415
-						<label for="lasso_editor[disable_tour]"> <?php _e( 'Do Not Show Tour Dialog', 'lasso' );?></label>
416
-						<span class="lasso--setting-description"><?php _e( 'Check this box to disable the tour dialog box for all users.', 'lasso' );?></span>
414
+						<input type="checkbox" class="checkbox" name="lasso_editor[disable_tour]" id="lasso_editor[disable_tour]" <?php echo checked($disable_tour, 'on'); ?> >
415
+						<label for="lasso_editor[disable_tour]"> <?php _e('Do Not Show Tour Dialog', 'lasso'); ?></label>
416
+						<span class="lasso--setting-description"><?php _e('Check this box to disable the tour dialog box for all users.', 'lasso'); ?></span>
417 417
 					</div>
418 418
                     
419 419
                     <div class="lasso-editor-settings--option-inner" style="border:none;">
420
-						<label><?php _e( 'Placeholder Text for New Post', 'lasso' );?></label>
421
-						<span class="lasso--setting-description"><?php _e( 'Placeholder text to be displayed when a new post is created.', 'lasso' );?></span>
422
-						<input type="text" name="lasso_editor[new_post_text]" id="lasso_editor[new_post_text]" value="<?php echo esc_attr( $new_post_text );?>" placeholder="<?php $def = wp_strip_all_tags(apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso')));echo $def;?>", true)>
420
+						<label><?php _e('Placeholder Text for New Post', 'lasso'); ?></label>
421
+						<span class="lasso--setting-description"><?php _e('Placeholder text to be displayed when a new post is created.', 'lasso'); ?></span>
422
+						<input type="text" name="lasso_editor[new_post_text]" id="lasso_editor[new_post_text]" value="<?php echo esc_attr($new_post_text); ?>" placeholder="<?php $def = wp_strip_all_tags(apply_filters('lasso_new_object_content', __('Once upon a time...', 'lasso'))); echo $def; ?>", true)>
423 423
 					</div>
424 424
 
425 425
 					<div class="lasso-editor-settings--option-inner" style="border:none">
426
-					    <label for="lasso_editor[bold_tag]"> <?php _e( '"Bold" Tag', 'lasso' );?></label>
427
-						<span class="lasso--setting-description"><?php _e( 'Choose the HTML tag used for the "Bold" style.', 'lasso' );?></span>
428
-					    <input type="radio" name="lasso_editor[bold_tag]" value='b' <?php echo checked( $bold_tag, 'b' );?>> b
429
-						<input type="radio" name="lasso_editor[bold_tag]" value="strong" <?php echo checked( $bold_tag, 'strong' );?>> strong
426
+					    <label for="lasso_editor[bold_tag]"> <?php _e('"Bold" Tag', 'lasso'); ?></label>
427
+						<span class="lasso--setting-description"><?php _e('Choose the HTML tag used for the "Bold" style.', 'lasso'); ?></span>
428
+					    <input type="radio" name="lasso_editor[bold_tag]" value='b' <?php echo checked($bold_tag, 'b'); ?>> b
429
+						<input type="radio" name="lasso_editor[bold_tag]" value="strong" <?php echo checked($bold_tag, 'strong'); ?>> strong
430 430
 					</div>
431 431
 					<div class="lasso-editor-settings--option-inner" style="border:none">
432
-					    <label for="lasso_editor[i_tag]"> <?php _e( '"Italic" Tag', 'lasso' );?></label>
433
-						<span class="lasso--setting-description"><?php _e( 'Choose the HTML tag used for the "Italic" style.', 'lasso' );?></span>
434
-					    <input type="radio" name="lasso_editor[i_tag]" value='i' <?php echo checked( $i_tag, 'i' );?>> i
435
-						<input type="radio" name="lasso_editor[i_tag]" value="em" <?php echo checked( $i_tag, 'em' );?>> em
432
+					    <label for="lasso_editor[i_tag]"> <?php _e('"Italic" Tag', 'lasso'); ?></label>
433
+						<span class="lasso--setting-description"><?php _e('Choose the HTML tag used for the "Italic" style.', 'lasso'); ?></span>
434
+					    <input type="radio" name="lasso_editor[i_tag]" value='i' <?php echo checked($i_tag, 'i'); ?>> i
435
+						<input type="radio" name="lasso_editor[i_tag]" value="em" <?php echo checked($i_tag, 'em'); ?>> em
436 436
 					</div>
437 437
                     <div class="lasso-editor-settings--option-inner" >
438
-						<input type="checkbox" class="checkbox" name="lasso_editor[link_prefix_http]" id="lasso_editor[link_prefix_http]" <?php echo checked( $link_prefix_http, 'on' );?> >
439
-						<label for="lasso_editor[link_prefix_http]"><?php _e( 'Auto Prefix HTTP to links', 'lasso' );?></label>
440
-						<span class="lasso--setting-description"><?php _e( 'When user adds a hyperlink, automatically add http:// if the user does not specify it explicitly.', 'lasso' );?></span>
438
+						<input type="checkbox" class="checkbox" name="lasso_editor[link_prefix_http]" id="lasso_editor[link_prefix_http]" <?php echo checked($link_prefix_http, 'on'); ?> >
439
+						<label for="lasso_editor[link_prefix_http]"><?php _e('Auto Prefix HTTP to links', 'lasso'); ?></label>
440
+						<span class="lasso--setting-description"><?php _e('When user adds a hyperlink, automatically add http:// if the user does not specify it explicitly.', 'lasso'); ?></span>
441 441
 					</div>
442 442
 				</div>
443 443
 
444
-				<h3><?php _e( 'Advanced Options', 'lasso' );?></h3>
445
-                <span class="lasso--setting-description"><?php _e( 'Suggested not to turn these options on without consulting the developer.', 'lasso' );?></span>
444
+				<h3><?php _e('Advanced Options', 'lasso'); ?></h3>
445
+                <span class="lasso--setting-description"><?php _e('Suggested not to turn these options on without consulting the developer.', 'lasso'); ?></span>
446 446
                 <span class="lasso--setting-description"> </span>
447 447
 				<div class="lasso-editor-settings--option-wrap ">
448 448
 					<div class="lasso-editor-settings--option-inner" style="border:none">
449
-						<input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked( $shortcodify_disabled, 'on' );?> >
450
-						<label for="lasso_editor[shortcodify_disabled]"><?php _e( 'Disable Aesop Component Conversion', 'lasso' );?></label>
451
-						<span class="lasso--setting-description"><?php _e( 'Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso' );?></span>
449
+						<input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked($shortcodify_disabled, 'on'); ?> >
450
+						<label for="lasso_editor[shortcodify_disabled]"><?php _e('Disable Aesop Component Conversion', 'lasso'); ?></label>
451
+						<span class="lasso--setting-description"><?php _e('Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso'); ?></span>
452 452
 					</div>
453 453
 				
454 454
 					<div class="lasso-editor-settings--option-inner" style="border:none">
455
-						<input type="checkbox" class="checkbox" name="lasso_editor[enable_autosave]" id="lasso_editor[enable_autosave]" <?php echo checked( $enable_autosave, 'on' );?> >
456
-						<label for="lasso_editor[enable_autosave]"><?php _e( 'Enable Auto Save', 'lasso' );?></label>
457
-						<span class="lasso--setting-description"><?php _e( 'Check this box to enable auto save.', 'lasso' );?></span>
455
+						<input type="checkbox" class="checkbox" name="lasso_editor[enable_autosave]" id="lasso_editor[enable_autosave]" <?php echo checked($enable_autosave, 'on'); ?> >
456
+						<label for="lasso_editor[enable_autosave]"><?php _e('Enable Auto Save', 'lasso'); ?></label>
457
+						<span class="lasso--setting-description"><?php _e('Check this box to enable auto save.', 'lasso'); ?></span>
458 458
 					</div>
459 459
 				
460 460
 					<div class="lasso-editor-settings--option-inner" style="border:none">
461
-						<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' );?> >
462
-						<label for="lasso_editor[post_save_disabled]"><?php _e( 'Disable Post Saving', 'lasso' );?></label>
463
-						<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>
461
+						<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'); ?> >
462
+						<label for="lasso_editor[post_save_disabled]"><?php _e('Disable Post Saving', 'lasso'); ?></label>
463
+						<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>
464 464
 
465 465
 					</div>
466 466
 					
467 467
 					<div class="lasso-editor-settings--option-inner" style="border:none">
468
-						<input type="checkbox" class="checkbox" name="lasso_editor[post_edit_disabled]" id="lasso_editor[post_edit_disabled]" <?php echo checked( $edit_post_disabled, 'on' );?> >
469
-						<label for="lasso_editor[post_edit_disabled]"><?php _e( 'Disable Post Editing', 'lasso' );?></label>
470
-						<span class="lasso--setting-description"><?php _e( 'You may use this option if you only want to edit custom fields. Refer <a href="https://edituswp.com/editing-and-updating-custom-fields-from-frontend/">here</a> for more information. The custom fields you specify will be still editable under the editing mode.', 'lasso' );?></span>
468
+						<input type="checkbox" class="checkbox" name="lasso_editor[post_edit_disabled]" id="lasso_editor[post_edit_disabled]" <?php echo checked($edit_post_disabled, 'on'); ?> >
469
+						<label for="lasso_editor[post_edit_disabled]"><?php _e('Disable Post Editing', 'lasso'); ?></label>
470
+						<span class="lasso--setting-description"><?php _e('You may use this option if you only want to edit custom fields. Refer <a href="https://edituswp.com/editing-and-updating-custom-fields-from-frontend/">here</a> for more information. The custom fields you specify will be still editable under the editing mode.', 'lasso'); ?></span>
471 471
 
472 472
 					</div>
473 473
 				
474 474
 					<div class="lasso-editor-settings--option-inner">
475
-						<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' );?> >
476
-						<label for="lasso_editor[save_using_rest_disabled]"><?php _e( "Don't Use REST API to Save", 'lasso' );?></label>
477
-						<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>
475
+						<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'); ?> >
476
+						<label for="lasso_editor[save_using_rest_disabled]"><?php _e("Don't Use REST API to Save", 'lasso'); ?></label>
477
+						<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>
478 478
 
479 479
 					</div>
480 480
 				</div>
@@ -484,11 +484,11 @@  discard block
 block discarded – undo
484 484
 
485 485
 				<div class="lasso-editor-settings--submit">
486 486
 				    <input type="hidden" name="action" value="lasso-editor-settings" />
487
-				    <input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save Settings', 'lasso' );?>" />
488
-					<?php wp_nonce_field( 'nonce', 'lasso_editor_settings' ); ?>
487
+				    <input type="submit" class="button-primary" value="<?php esc_attr_e('Save Settings', 'lasso'); ?>" />
488
+					<?php wp_nonce_field('nonce', 'lasso_editor_settings'); ?>
489 489
 				</div>
490 490
 				
491
-				<?php do_action('lasso_settings_after');?>
491
+				<?php do_action('lasso_settings_after'); ?>
492 492
 			</form>
493 493
 
494 494
 		</div><?php
Please login to merge, or discard this patch.
lasso.php 1 patch
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -18,27 +18,27 @@  discard block
 block discarded – undo
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', '1.4.1' );
27
-define( 'LASSO_DIR', plugin_dir_path( __FILE__ ) );
28
-define( 'LASSO_URL', plugins_url( '', __FILE__ ) );
29
-define( 'LASSO_FILE', __FILE__ );
26
+define('LASSO_VERSION', '1.4.1');
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>Editus requires PHP 5.4 or higher.</p></div>');
44 44
 
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
@@ -88,17 +88,17 @@  discard block
 block discarded – undo
88 88
 ));
89 89
 
90 90
 // Gutenberg
91
-if( function_exists( 'is_gutenberg_page' ) ) {
92
-	function add_raw_to_post( $response, $post, $request ) {
91
+if (function_exists('is_gutenberg_page')) {
92
+	function add_raw_to_post($response, $post, $request) {
93 93
 		$response_data = $response->get_data();
94
-		if ( is_array( $response_data['content'] )) {
95
-			$response_data['content']['raw'] =  $post->post_content ;
96
-			$response->set_data( $response_data );
94
+		if (is_array($response_data['content'])) {
95
+			$response_data['content']['raw'] = $post->post_content;
96
+			$response->set_data($response_data);
97 97
 		}
98 98
 
99 99
 		return $response;
100 100
 	}
101
-	add_filter( "rest_prepare_post", 'add_raw_to_post', 10, 3 );
101
+	add_filter("rest_prepare_post", 'add_raw_to_post', 10, 3);
102 102
 }
103 103
 
104 104
 
@@ -106,32 +106,32 @@  discard block
 block discarded – undo
106 106
 //table codes to be added
107 107
 class editus_table {
108 108
     
109
-    public function __construct(){
109
+    public function __construct() {
110 110
         $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
111 111
         if ($add_table) {
112
-            add_action('wp_enqueue_scripts', array($this,'scripts'));
112
+            add_action('wp_enqueue_scripts', array($this, 'scripts'));
113 113
             
114 114
         }
115 115
 	}
116 116
     
117 117
     function scripts()
118 118
     {
119
-        add_action('lasso_editor_controls_after_outside', array($this,'editus_table_edit_menu'));
120
-            add_filter('lasso_components',array($this,'editus_components_add_table'),10,1);
121
-            add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_table'), 10 );
122
-            wp_enqueue_style( 'editus-table-style', LASSO_URL.  '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true );
123
-            wp_enqueue_script( 'editus_table',  LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true );
119
+        add_action('lasso_editor_controls_after_outside', array($this, 'editus_table_edit_menu'));
120
+            add_filter('lasso_components', array($this, 'editus_components_add_table'), 10, 1);
121
+            add_action('lasso_toolbar_components', array($this, 'editus_toolbar_components_add_table'), 10);
122
+            wp_enqueue_style('editus-table-style', LASSO_URL.'/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true);
123
+            wp_enqueue_script('editus_table', LASSO_URL.'/public/assets/js/editus-table-edit-public.js', array('jquery'), LASSO_VERSION, true);
124 124
     }
125 125
     
126 126
     function editus_table_edit_menu()
127 127
     { ?>
128 128
 
129 129
         <ul class='editus-table-menu'>
130
-          <li data-action="insertcol"><?php echo __('Insert Column','lasso')?></li>
131
-          <li data-action="insertrow"><?php echo __('Insert Row','lasso')?></li>
132
-          <li data-action="delcol"><?php echo __('Delete Column','lasso')?></li>
133
-          <li data-action="delrow"><?php echo __('Delete Row','lasso')?></li>
134
-          <li data-action="deltable"><?php echo __('Delete Table','lasso')?></li
130
+          <li data-action="insertcol"><?php echo __('Insert Column', 'lasso')?></li>
131
+          <li data-action="insertrow"><?php echo __('Insert Row', 'lasso')?></li>
132
+          <li data-action="delcol"><?php echo __('Delete Column', 'lasso')?></li>
133
+          <li data-action="delrow"><?php echo __('Delete Row', 'lasso')?></li>
134
+          <li data-action="deltable"><?php echo __('Delete Table', 'lasso')?></li
135 135
         </ul>
136 136
     <?php
137 137
     }
@@ -143,20 +143,20 @@  discard block
 block discarded – undo
143 143
     }
144 144
 
145 145
 
146
-    function editus_components_add_table( $array ){
146
+    function editus_components_add_table($array) {
147 147
         $custom = array(
148 148
                'htmltable' => array(
149
-                         'name'    => __('HTML Table','lasso'),
149
+                         'name'    => __('HTML Table', 'lasso'),
150 150
                           'content' => self::editus_html_table(),
151 151
                 )
152 152
         );
153
-        return array_merge( $array, $custom );
153
+        return array_merge($array, $custom);
154 154
     }
155 155
 
156 156
 
157 157
     function editus_toolbar_components_add_table( ) {
158 158
           ?>
159
-          <li data-type="htmltable" title="<?php esc_attr_e( 'HTML Table', 'lasso' );?>" class="quote lasso-toolbar--component__htmltable dashicons dashicons-grid-view"></li>
159
+          <li data-type="htmltable" title="<?php esc_attr_e('HTML Table', 'lasso'); ?>" class="quote lasso-toolbar--component__htmltable dashicons dashicons-grid-view"></li>
160 160
           <?php
161 161
     }
162 162
 }
@@ -169,27 +169,27 @@  discard block
 block discarded – undo
169 169
 //table codes to be added
170 170
 class editus_paragraph {
171 171
     
172
-    public function __construct(){
173
-        add_action('wp_enqueue_scripts', array($this,'scripts'));
172
+    public function __construct() {
173
+        add_action('wp_enqueue_scripts', array($this, 'scripts'));
174 174
 	}
175 175
     
176 176
     function scripts()
177 177
     {
178
-            add_action('lasso_editor_controls_after_outside', array($this,'editus_paragraph_style'));
179
-            add_filter('lasso_components',array($this,'editus_components_add_paragraph'),10,1);
180
-            add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_paragraph'), 10 );
178
+            add_action('lasso_editor_controls_after_outside', array($this, 'editus_paragraph_style'));
179
+            add_filter('lasso_components', array($this, 'editus_components_add_paragraph'), 10, 1);
180
+            add_action('lasso_toolbar_components', array($this, 'editus_toolbar_components_add_paragraph'), 10);
181 181
             //wp_enqueue_style( 'editus-table-style', LASSO_URL.  '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true );
182 182
             //wp_enqueue_script( 'editus_table',  LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true );
183 183
     }
184 184
    
185
-    function editus_components_add_paragraph( $array ){
185
+    function editus_components_add_paragraph($array) {
186 186
         $custom = array(
187 187
                'htmlparagraph' => array(
188
-                         'name'    => __('HTML Paragraph','lasso'),
188
+                         'name'    => __('HTML Paragraph', 'lasso'),
189 189
                           'content' => self::editus_html_paragraph(),
190 190
                 )
191 191
         );
192
-        return array_merge( $array, $custom );
192
+        return array_merge($array, $custom);
193 193
     }
194 194
     
195 195
     
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 
214 214
     function editus_toolbar_components_add_paragraph( ) {
215 215
           ?>
216
-          <li data-type="htmlparagraph" title="<?php esc_attr_e( 'HTML Paragraph', 'lasso' );?>" class="quote lasso-toolbar--component__htmlparagraph dashicons dashicons-editor-paragraph"></li>
216
+          <li data-type="htmlparagraph" title="<?php esc_attr_e('HTML Paragraph', 'lasso'); ?>" class="quote lasso-toolbar--component__htmlparagraph dashicons dashicons-editor-paragraph"></li>
217 217
           <?php
218 218
     }
219 219
 }
Please login to merge, or discard this patch.
includes/process/new_object.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,8 +34,8 @@
 block discarded – undo
34 34
 
35 35
 		$object = is_null( $data[ 'object'] ) ? false : $data[ 'object' ];
36 36
         
37
-        $new_post_text    = lasso_editor_get_option( 'new_post_text', 'lasso_editor' );        
38
-        $new_post_text  = !empty($new_post_text) ? $new_post_text : wp_strip_all_tags(apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso')));
37
+		$new_post_text    = lasso_editor_get_option( 'new_post_text', 'lasso_editor' );        
38
+		$new_post_text  = !empty($new_post_text) ? $new_post_text : wp_strip_all_tags(apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso')));
39 39
 
40 40
 		// insert a new post
41 41
 		$args = array(
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -28,29 +28,29 @@  discard block
 block discarded – undo
28 28
 	 *
29 29
 	 * @since 1.0
30 30
 	 */
31
-	public function post( $data ) {
31
+	public function post($data) {
32 32
 
33
-		$title  = $data[ 'story_title' ];
33
+		$title  = $data['story_title'];
34 34
 
35
-		$object = is_null( $data[ 'object'] ) ? false : $data[ 'object' ];
35
+		$object = is_null($data['object']) ? false : $data['object'];
36 36
         
37
-        $new_post_text    = lasso_editor_get_option( 'new_post_text', 'lasso_editor' );        
38
-        $new_post_text  = !empty($new_post_text) ? $new_post_text : wp_strip_all_tags(apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso')));
37
+        $new_post_text = lasso_editor_get_option('new_post_text', 'lasso_editor');        
38
+        $new_post_text = !empty($new_post_text) ? $new_post_text : wp_strip_all_tags(apply_filters('lasso_new_object_content', __('Once upon a time...', 'lasso')));
39 39
 
40 40
 		// insert a new post
41 41
 		$args = array(
42 42
 			'post_title'    => $title,
43 43
 			'post_status'   => 'draft',
44 44
 			'post_type'    	=> $object,
45
-			'post_content'  =>'<p class="editus-firstp" placeholder="'. $new_post_text. '"></p>' 
45
+			'post_content'  =>'<p class="editus-firstp" placeholder="'.$new_post_text.'"></p>' 
46 46
 		);
47 47
 
48
-		$postid = wp_insert_post( apply_filters( 'lasso_insert_object_args', $args ) );
48
+		$postid = wp_insert_post(apply_filters('lasso_insert_object_args', $args));
49 49
 
50
-		do_action( 'lasso_new_object', $postid, $object, $title, get_current_user_ID() );
50
+		do_action('lasso_new_object', $postid, $object, $title, get_current_user_ID());
51 51
 
52 52
 		return array(
53
-			'postlink' => get_permalink( $postid )
53
+			'postlink' => get_permalink($postid)
54 54
 		);
55 55
 
56 56
 	}
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
 	 * @return array Array of keys to pull from $_POST per action and their sanitization callback
64 64
 	 */
65 65
 	public static function params() {
66
-		$params[ 'process_new_object_post' ] = array(
67
-			'story_title' => array( 'wp_strip_all_tags', 'trim' ),
66
+		$params['process_new_object_post'] = array(
67
+			'story_title' => array('wp_strip_all_tags', 'trim'),
68 68
 			'object' => 'trim'
69 69
 		);
70 70
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 	 * @return array Array of additional functions to use to authorize action.
81 81
 	 */
82 82
 	public static function auth_callbacks() {
83
-		$params[ 'process_new_object_post' ] = array();
83
+		$params['process_new_object_post'] = array();
84 84
 
85 85
 		return $params;
86 86
 
Please login to merge, or discard this patch.