Completed
Push — master ( 99c38a...8d9355 )
by
unknown
01:40
created
public/includes/lasso.php 1 patch
Indentation   +98 added lines, -98 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,10 +69,10 @@  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');
@@ -272,14 +272,14 @@  discard block
 block discarded – undo
272 272
 		$out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' );
273 273
 	}
274 274
 	
275
-    // new ajax function to lock post for editing
275
+	// new ajax function to lock post for editing
276 276
 	public function editus_lock_post()
277 277
 	{
278 278
 		$post_id= $_POST["postid"];
279 279
 		$locked = wp_check_post_lock($post_id);
280 280
 		
281 281
 		if (!$locked) {
282
-		    wp_set_post_lock($post_id);
282
+			wp_set_post_lock($post_id);
283 283
 			echo "true";
284 284
 		} else {
285 285
 			$user_info = get_userdata($locked);
@@ -292,9 +292,9 @@  discard block
 block discarded – undo
292 292
 	{
293 293
 		$post_id= $_POST["postid"];
294 294
 		$locked = wp_check_post_lock($post_id);
295
-        if (!$locked) {
296
-            delete_post_meta( $post_id, '_edit_lock');
297
-        }
295
+		if (!$locked) {
296
+			delete_post_meta( $post_id, '_edit_lock');
297
+		}
298 298
 		echo "true";
299 299
 		
300 300
 		exit;
@@ -324,14 +324,14 @@  discard block
 block discarded – undo
324 324
 		$status = isset( $data['status'] ) ? $data['status'] : false;
325 325
 		$postid = isset( $data['postid'] ) ? $data['postid'] : false;
326 326
 		$slug   = isset( $data['story_slug'] ) ? $data['story_slug'] : false;
327
-        $excerpt   = isset( $data['excerpt'] ) ? $data['excerpt'] : false;
327
+		$excerpt   = isset( $data['excerpt'] ) ? $data['excerpt'] : false;
328 328
 	
329 329
 
330 330
 		$args = array(
331 331
 			'ID'   			=> (int) $postid,
332 332
 			'post_name'  	=> $slug,
333 333
 			'post_status' 	=> $status,
334
-            'post_excerpt'  => $excerpt
334
+			'post_excerpt'  => $excerpt
335 335
 		);
336 336
 		
337 337
 		
@@ -399,12 +399,12 @@  discard block
 block discarded – undo
399 399
 		exit;
400 400
 	}
401 401
     
402
-    public function editus_do_block()
402
+	public function editus_do_block()
403 403
 	{
404 404
 		
405 405
 		$code= $_POST["code"];
406 406
 
407
-        $out = do_blocks( $code );
407
+		$out = do_blocks( $code );
408 408
 		
409 409
 		echo $out;
410 410
 		exit;
@@ -423,60 +423,60 @@  discard block
 block discarded – undo
423 423
 			}
424 424
 		}
425 425
 		if ($code == "aesop_video") {
426
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
427
-		    echo aesop_video_shortcode($atts);
426
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
427
+			echo aesop_video_shortcode($atts);
428 428
 		}
429 429
 		else if ($code == "aesop_image") {
430
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
431
-		    echo aesop_image_shortcode($atts);
430
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
431
+			echo aesop_image_shortcode($atts);
432 432
 		}
433 433
 		else if ($code == "aesop_quote") {
434
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
435
-		    echo aesop_quote_shortcode($atts);
434
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
435
+			echo aesop_quote_shortcode($atts);
436 436
 		}
437 437
 		else if ($code == "aesop_parallax") {
438
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
439
-		    echo aesop_parallax_shortcode($atts);
438
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
439
+			echo aesop_parallax_shortcode($atts);
440 440
 		}
441 441
 		else if ($code == "aesop_character") {
442
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
443
-		    echo aesop_character_shortcode($atts);
442
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
443
+			echo aesop_character_shortcode($atts);
444 444
 		}
445 445
 		else if ($code == "aesop_collection") {
446
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
447
-		    echo aesop_collection_shortcode($atts);
446
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
447
+			echo aesop_collection_shortcode($atts);
448 448
 		}
449 449
 		else if ($code == "aesop_chapter") {
450
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
451
-		    echo aesop_chapter_shortcode($atts);
450
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
451
+			echo aesop_chapter_shortcode($atts);
452 452
 		}
453 453
 		else if ($code == "aesop_content") {
454
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
455
-		    echo aesop_content_shortcode($atts, $atts['content_data']);
454
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
455
+			echo aesop_content_shortcode($atts, $atts['content_data']);
456 456
 		}
457 457
 		else if ($code == "aesop_gallery") {
458
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
459
-		    echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
458
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
459
+			echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
460 460
 		}
461 461
 		else if ($code == "aesop_audio") {
462
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
463
-		    echo aesop_audio_shortcode($atts);
462
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
463
+			echo aesop_audio_shortcode($atts);
464 464
 		}
465 465
 		else if ($code == "aesop_document") {
466
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php');
467
-		    echo aesop_document_shortcode($atts);
466
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php');
467
+			echo aesop_document_shortcode($atts);
468 468
 		}
469
-        /*else if ($code == "aesop_content") {
469
+		/*else if ($code == "aesop_content") {
470 470
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-content.php');
471 471
 		    echo aesop_content_shortcode($atts);
472 472
 		}*/
473
-        else if ($code == "aesop_wpimg") {
474
-            self::wpimg($atts);
473
+		else if ($code == "aesop_wpimg") {
474
+			self::wpimg($atts);
475 475
 		}
476 476
 		else {
477 477
 			$code = '['.$code.' ';
478 478
 			foreach ($atts as $key => $value) {
479
-			    $code = ''.$key.'="'.$value.'" ';
479
+				$code = ''.$key.'="'.$value.'" ';
480 480
 			}
481 481
 			$code = $code.']';
482 482
 			echo do_shortcode($code);
@@ -485,63 +485,63 @@  discard block
 block discarded – undo
485 485
 		exit; 
486 486
 	}
487 487
     
488
-    public static function wpimg($atts) {
488
+	public static function wpimg($atts) {
489 489
 
490
-        echo '<figure data-component-type="wpimg"';
490
+		echo '<figure data-component-type="wpimg"';
491 491
         
492
-        $extra = "";
492
+		$extra = "";
493 493
         
494
-        // try to use srcset and sizes on new WP installs
494
+		// try to use srcset and sizes on new WP installs
495 495
 		if ( function_exists('wp_get_attachment_image_srcset') && $attachment_id = attachment_url_to_postid( $atts['img'] ) ) {
496 496
 			$srcset = wp_get_attachment_image_srcset( $attachment_id, 'full' );
497 497
 			$sizes = wp_get_attachment_image_sizes( $attachment_id, 'full' );
498
-            $extra = "srcset='$srcset' sizes='$sizes' ";
499
-        }
500
-        if ($atts['align']=="left") {
501
-            $extra .= 'class="alignleft';
502
-        } else if ($atts['align']=="right") {
503
-            $extra .= 'class="alignright';
504
-        } else {
505
-            $extra .= 'class="aligncenter';
506
-        }
507
-        if ($atts['imgwidth'] || $atts['imgheight']) {
508
-            if ($atts['imgwidth']) {
509
-                $extra .= 'width:'. $atts['imgwidth'].';';
510
-            }
511
-            if ($atts['imgheight']) {
512
-                $extra .= 'height:'. $atts['imgheight'].';';
513
-            }
498
+			$extra = "srcset='$srcset' sizes='$sizes' ";
499
+		}
500
+		if ($atts['align']=="left") {
501
+			$extra .= 'class="alignleft';
502
+		} else if ($atts['align']=="right") {
503
+			$extra .= 'class="alignright';
504
+		} else {
505
+			$extra .= 'class="aligncenter';
506
+		}
507
+		if ($atts['imgwidth'] || $atts['imgheight']) {
508
+			if ($atts['imgwidth']) {
509
+				$extra .= 'width:'. $atts['imgwidth'].';';
510
+			}
511
+			if ($atts['imgheight']) {
512
+				$extra .= 'height:'. $atts['imgheight'].';';
513
+			}
514 514
             
515
-        }
516
-        $extra .= '"';
515
+		}
516
+		$extra .= '"';
517 517
         
518
-        foreach ($atts as $key => $value) {
518
+		foreach ($atts as $key => $value) {
519 519
 			 echo ' data-'.$key.'="'.$value.'"';
520 520
 		}
521
-        //echo ' class="wp-image- lasso--wpimg__wrap lasso-component">';
522
-        echo ' class="wp-caption lasso-component">';
523
-        $hrefset = false;
524
-        if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption']=="url" ))
525
-        {
526
-            echo '<a href="' . $atts['link'] . '">';
527
-            $hrefset = true;
528
-        } else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img' ) {
529
-            echo '<a href="' . $atts['img'] . '">';
530
-            $hrefset = true;
531
-        }
532
-        echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  .  '" '. $extra. '>';
533
-        if ($hrefset)
534
-        {
535
-            echo '</a>';
536
-        }
537
-        if ($atts['caption'])
538
-        {
539
-            echo '<figcaption class="wp-caption-text">'.$atts['caption'].'</figcaption>';
540
-        }
541
-        echo '</figure>';
542
-        echo '<p> </p>';
543
-        return;
544
-    }
521
+		//echo ' class="wp-image- lasso--wpimg__wrap lasso-component">';
522
+		echo ' class="wp-caption lasso-component">';
523
+		$hrefset = false;
524
+		if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption']=="url" ))
525
+		{
526
+			echo '<a href="' . $atts['link'] . '">';
527
+			$hrefset = true;
528
+		} else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img' ) {
529
+			echo '<a href="' . $atts['img'] . '">';
530
+			$hrefset = true;
531
+		}
532
+		echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  .  '" '. $extra. '>';
533
+		if ($hrefset)
534
+		{
535
+			echo '</a>';
536
+		}
537
+		if ($atts['caption'])
538
+		{
539
+			echo '<figcaption class="wp-caption-text">'.$atts['caption'].'</figcaption>';
540
+		}
541
+		echo '</figure>';
542
+		echo '<p> </p>';
543
+		return;
544
+	}
545 545
 	
546 546
 	
547 547
 	public function get_ase_options()
@@ -577,12 +577,12 @@  discard block
 block discarded – undo
577 577
 		exit;
578 578
 	}
579 579
     
580
-    /* This function doesn't actually publish post, but should be called when a post is published */
581
-    public function on_publish_post( ) {
580
+	/* This function doesn't actually publish post, but should be called when a post is published */
581
+	public function on_publish_post( ) {
582 582
 
583 583
 		$post_id = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
584 584
         
585
-        do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) );
585
+		do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) );
586 586
 
587 587
 		exit;
588 588
 	}
@@ -640,14 +640,14 @@  discard block
 block discarded – undo
640 640
 			$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
641 641
 			
642 642
 			if ($taxonomy =='category') {
643
-                // convert from names to category ids
643
+				// convert from names to category ids
644 644
 				$cats = array();
645 645
 				foreach ($value as $cat) {
646 646
 					$cat_id = get_cat_ID($cat);
647 647
 					if ($cat_id !=0) {
648 648
 						$cats [] = $cat_id;
649 649
 					} else if ($allow_new_category) {
650
-					    $cats [] = wp_create_category($cat);
650
+						$cats [] = wp_create_category($cat);
651 651
 					}
652 652
 				}
653 653
 				$value = $cats;
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
 		}
668 668
 	}
669 669
     
670
-    public function create_gallery( ) {
670
+	public function create_gallery( ) {
671 671
 
672 672
 		$postid  	= isset( $_POST['postid'] ) ? $_POST['postid'] : false;
673 673
         
@@ -721,10 +721,10 @@  discard block
 block discarded – undo
721 721
 			'message' => 'gallery-created',
722 722
 			'id' => $postid)
723 723
 		);
724
-        exit;
724
+		exit;
725 725
 	}
726 726
     
727
-    public function update_gallery( ) {
727
+	public function update_gallery( ) {
728 728
         
729 729
 		$options      = isset( $_POST['fields'] ) ? $_POST['fields'] : false;
730 730
         
@@ -740,12 +740,12 @@  discard block
 block discarded – undo
740 740
 
741 741
 		self::save_gallery_options( $postid, $gallery_ids, $options, $type );
742 742
 
743
-        echo json_encode( array('message' => 'gallery-updated') );
743
+		echo json_encode( array('message' => 'gallery-updated') );
744 744
 
745
-        exit;
745
+		exit;
746 746
 	}
747 747
     
748
-    public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) {
748
+	public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) {
749 749
 
750 750
 		// gallery width
751 751
 		$gallery_width = isset( $options['width'] ) ? $options['width'] : false;
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
 	public function set_date( $postid, $value) {
830 830
 		if( $value ) {
831 831
 			$value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time( 'timestamp', 1 ));
832
-            wp_update_post(
832
+			wp_update_post(
833 833
 				array (
834 834
 					'ID'            => $postid, // ID of the post to update
835 835
 					'post_date'     => date( 'Y-m-d H:i:s',  strtotime($value) ),
Please login to merge, or discard this patch.
public/includes/editor-modules.php 1 patch
Indentation   +118 added lines, -118 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 				height: 42px;
115 115
 			}
116 116
 		<?php
117
-            } 
117
+			} 
118 118
 		} else { 
119 119
 		?> 
120 120
 
@@ -123,8 +123,8 @@  discard block
 block discarded – undo
123 123
             }
124 124
             
125 125
         <?php
126
-        }
127
-        ?>
126
+		}
127
+		?>
128 128
         </style>
129 129
 		<div id="lasso--controls" class="lasso-post-status--<?php echo sanitize_html_class( $status );?> <?php echo sanitize_html_class( $custom_classes );?>" data-post-id="<?php echo get_the_ID();?>" >
130 130
 
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 	$toolbar_class  = $toolbar_headings ? 'toolbar-extended' : false;
234 234
 	
235 235
 	// mobile styles
236
-    $mobile_class = $is_mobile ? 'lasso-mobile' : false;
236
+	$mobile_class = $is_mobile ? 'lasso-mobile' : false;
237 237
 	$mobile_style =$is_mobile ? 'style="bottom:0px;"' : null;
238 238
 	
239 239
 	//show color
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
 	
457 457
 	//editor options
458 458
 	$allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor');
459
-    $allow_edit_excerpt = lasso_editor_get_option('allow_edit_excerpt', 'lasso_editor');
459
+	$allow_edit_excerpt = lasso_editor_get_option('allow_edit_excerpt', 'lasso_editor');
460 460
 	$no_url_setting = lasso_editor_get_option('no_url_setting', 'lasso_editor');
461 461
 
462 462
 	// are we singular
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
 	// do we support pending status
470 470
 	$no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor');
471 471
     
472
-    $excerpt = $post->post_excerpt;
472
+	$excerpt = $post->post_excerpt;
473 473
 
474 474
 ?>
475 475
 	<div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>">
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
 						}?>
549 549
 						<?php 
550 550
 						if ($allow_change_date) { 
551
-						    $dateformat = get_option( 'date_format' ); 
551
+							$dateformat = get_option( 'date_format' ); 
552 552
 						?>
553 553
 						    <label><?php _e( 'Post Date', 'lasso' ); ?></label>
554 554
 							<input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/>
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
 						if ( !empty( $types ) ) {
664 664
 							// get the first element
665 665
 							$keys = array_keys($types);
666
-						    $type =$keys[0];						
666
+							$type =$keys[0];						
667 667
 							$type = preg_replace( '/s\b/','', $type );
668 668
 							printf( '<input type="hidden" name="object" value="%s">', lcfirst( esc_attr( $type ) ) );		
669 669
 						}
@@ -691,8 +691,8 @@  discard block
 block discarded – undo
691 691
 	global $post;
692 692
 	
693 693
 	global $wp_post_types;
694
-    $labels = &$wp_post_types['post']->labels;
695
-    $labels->name = 'Articles';
694
+	$labels = &$wp_post_types['post']->labels;
695
+	$labels->name = 'Articles';
696 696
 
697 697
 	ob_start();
698 698
 
@@ -752,7 +752,7 @@  discard block
 block discarded – undo
752 752
 	ob_start();
753 753
 
754 754
 
755
-    $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
755
+	$use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
756 756
     
757 757
 	// let users add custom css classes
758 758
 	$custom_classes = apply_filters( 'lasso_wpimg_classes', '' );
@@ -840,8 +840,8 @@  discard block
 block discarded – undo
840 840
 function lasso_editor_options_blob() {
841 841
 
842 842
 	$codes   = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : array();
843
-    $codes   = add_wpimg_options( $codes );
844
-    $codes   = apply_filters( 'lasso_custom_options', $codes );
843
+	$codes   = add_wpimg_options( $codes );
844
+	$codes   = apply_filters( 'lasso_custom_options', $codes );
845 845
 	$galleries  = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery';
846 846
 
847 847
 	$nonce = wp_create_nonce( 'lasso_gallery' );
@@ -943,9 +943,9 @@  discard block
 block discarded – undo
943 943
 		$return .= '</form>';
944 944
 
945 945
 		// extra JS codes
946
-        if (isset($shortcode['codes'])) {
947
-		    $return .= $shortcode['codes'];
948
-        }
946
+		if (isset($shortcode['codes'])) {
947
+			$return .= $shortcode['codes'];
948
+		}
949 949
 		$blob[$slug] = $return;
950 950
 	}
951 951
 
@@ -954,95 +954,95 @@  discard block
 block discarded – undo
954 954
 
955 955
 
956 956
 function add_wpimg_options( $shortcodes ) {
957
-    $custom = array(
958
-        'wpimg'    => array(
959
-            'name'     => __( 'Image', 'lasso' ),
960
-            'type'     => 'single',
961
-            'atts'     => array(
962
-                'img'    => array(
963
-                    'type'  => 'media_upload',
964
-                    'default'  => '',
965
-                    'desc'   => __( 'Image URL', 'lasso' ),
966
-                    'tip'  => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' )
967
-                ),
968
-                'align'    => array(
969
-                    'type'  => 'select',
970
-                    'values'  => array(						
971
-                        array(
972
-                            'value' => 'center',
973
-                            'name' => __( 'Center', 'aesop-core' )
974
-                        ),
975
-                        array(
976
-                            'value' => 'left',
977
-                            'name' => __( 'Left', 'aesop-core' )
978
-                        ),
979
-                        array(
980
-                            'value' => 'right',
981
-                            'name' => __( 'Right', 'aesop-core' )
982
-                        ),
983
-                    ),
984
-                    'default'  => 'center',
985
-                    'desc'   => __( 'Alignment', 'lasso' ),
986
-                    'tip'=>''
987
-                ),			
957
+	$custom = array(
958
+		'wpimg'    => array(
959
+			'name'     => __( 'Image', 'lasso' ),
960
+			'type'     => 'single',
961
+			'atts'     => array(
962
+				'img'    => array(
963
+					'type'  => 'media_upload',
964
+					'default'  => '',
965
+					'desc'   => __( 'Image URL', 'lasso' ),
966
+					'tip'  => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' )
967
+				),
968
+				'align'    => array(
969
+					'type'  => 'select',
970
+					'values'  => array(						
971
+						array(
972
+							'value' => 'center',
973
+							'name' => __( 'Center', 'aesop-core' )
974
+						),
975
+						array(
976
+							'value' => 'left',
977
+							'name' => __( 'Left', 'aesop-core' )
978
+						),
979
+						array(
980
+							'value' => 'right',
981
+							'name' => __( 'Right', 'aesop-core' )
982
+						),
983
+					),
984
+					'default'  => 'center',
985
+					'desc'   => __( 'Alignment', 'lasso' ),
986
+					'tip'=>''
987
+				),			
988 988
                 
989
-                'imgwidth'    => array(
990
-                    'type'  => 'text_small',
991
-                    'default'  => '300px',
992
-                    'desc'   => __( 'Image Width', 'lasso' ),
993
-                    'tip'  => __( 'Width of the image. You can enter the size in pixels or percentage such as <code>40%</code> or <code>500px</code>.', 'aesop-core' )
994
-                ),
995
-                'imgheight'    => array(
996
-                    'type'  => 'text_small',
997
-                    'default'  => '',
998
-                    'desc'   => __( 'Image Height', 'lasso' ),
999
-                    'tip'  => __( 'Used only for the Panorama mode. Can be set using pixel values such as <code>500px</code>. If unspecified, the original height would be used. ', 'aesop-core' )
1000
-                ),	
1001
-                'linkoption'    => array(
1002
-                    'type'  => 'select',
1003
-                    'values'  => array(						
1004
-                        array(
1005
-                            'value' => 'none',
1006
-                            'name' => __( 'None', 'aesop-core' )
1007
-                        ),
1008
-                        array(
1009
-                            'value' => 'img',
1010
-                            'name' => __( 'Image', 'aesop-core' )
1011
-                        ),
1012
-                        array(
1013
-                            'value' => 'url',
1014
-                            'name' => __( 'URL', 'aesop-core' )
1015
-                        ),
1016
-                    ),
1017
-                    'default'  => 'none',
1018
-                    'desc'   => __( 'Link', 'lasso' ),
1019
-                    'tip'  => __( 'Click leads to:', 'lasso' )
1020
-                ),				
989
+				'imgwidth'    => array(
990
+					'type'  => 'text_small',
991
+					'default'  => '300px',
992
+					'desc'   => __( 'Image Width', 'lasso' ),
993
+					'tip'  => __( 'Width of the image. You can enter the size in pixels or percentage such as <code>40%</code> or <code>500px</code>.', 'aesop-core' )
994
+				),
995
+				'imgheight'    => array(
996
+					'type'  => 'text_small',
997
+					'default'  => '',
998
+					'desc'   => __( 'Image Height', 'lasso' ),
999
+					'tip'  => __( 'Used only for the Panorama mode. Can be set using pixel values such as <code>500px</code>. If unspecified, the original height would be used. ', 'aesop-core' )
1000
+				),	
1001
+				'linkoption'    => array(
1002
+					'type'  => 'select',
1003
+					'values'  => array(						
1004
+						array(
1005
+							'value' => 'none',
1006
+							'name' => __( 'None', 'aesop-core' )
1007
+						),
1008
+						array(
1009
+							'value' => 'img',
1010
+							'name' => __( 'Image', 'aesop-core' )
1011
+						),
1012
+						array(
1013
+							'value' => 'url',
1014
+							'name' => __( 'URL', 'aesop-core' )
1015
+						),
1016
+					),
1017
+					'default'  => 'none',
1018
+					'desc'   => __( 'Link', 'lasso' ),
1019
+					'tip'  => __( 'Click leads to:', 'lasso' )
1020
+				),				
1021 1021
                 
1022
-                'link'    => array(
1023
-                    'type'  => 'text',
1024
-                    'default'  => '',
1025
-                    'desc'   => __( 'URL Link', 'lasso' ),
1026
-                    'tip'  => __( 'URL link', 'lasso' )
1027
-                ),
1028
-                'alt'    => array(
1029
-                    'type'  => 'text',
1030
-                    'default'  => '',
1031
-                    'desc'   => __( 'Image ALT', 'lasso' ),
1032
-                    'tip'  => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' )
1033
-                ),
1022
+				'link'    => array(
1023
+					'type'  => 'text',
1024
+					'default'  => '',
1025
+					'desc'   => __( 'URL Link', 'lasso' ),
1026
+					'tip'  => __( 'URL link', 'lasso' )
1027
+				),
1028
+				'alt'    => array(
1029
+					'type'  => 'text',
1030
+					'default'  => '',
1031
+					'desc'   => __( 'Image ALT', 'lasso' ),
1032
+					'tip'  => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' )
1033
+				),
1034 1034
                 
1035
-                'caption'    => array(
1036
-                    'type'  => 'text_area',
1037
-                    'default'  => '',
1038
-                    'desc'   => __( 'Caption', 'lasso' ),
1039
-                    'tip'  => __( 'Optional caption for the image.', 'lasso' )
1040
-                ),
1035
+				'caption'    => array(
1036
+					'type'  => 'text_area',
1037
+					'default'  => '',
1038
+					'desc'   => __( 'Caption', 'lasso' ),
1039
+					'tip'  => __( 'Optional caption for the image.', 'lasso' )
1040
+				),
1041 1041
                 
1042 1042
 
1043
-            ),
1044
-            'desc'     => __( 'An image.', 'aesop-core' ),
1045
-            'codes'    => '<script>	            
1043
+			),
1044
+			'desc'     => __( 'An image.', 'aesop-core' ),
1045
+			'codes'    => '<script>	            
1046 1046
 						jQuery(document).ready(function($){
1047 1047
                             function linkSetting(l){								
1048 1048
 							    if ( l=="url") {
@@ -1062,10 +1062,10 @@  discard block
 block discarded – undo
1062 1062
 							})
1063 1063
 						});
1064 1064
 			           </script>'
1065
-        )
1066
-    );
1065
+		)
1066
+	);
1067 1067
 
1068
-    return array_merge( $shortcodes, $custom );
1068
+	return array_merge( $shortcodes, $custom );
1069 1069
 }
1070 1070
 
1071 1071
 /**
@@ -1110,23 +1110,23 @@  discard block
 block discarded – undo
1110 1110
  * @return string
1111 1111
  */
1112 1112
 function lasso_editor_adjustBrightness($hex, $steps) { 
1113
-    $steps = max(-255, min(255, $steps));
1113
+	$steps = max(-255, min(255, $steps));
1114 1114
 
1115
-    // Normalize into a six character long hex string
1116
-    $hex = str_replace('#', '', $hex);
1117
-    if (strlen($hex) == 3) {
1118
-        $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2);
1119
-    }
1115
+	// Normalize into a six character long hex string
1116
+	$hex = str_replace('#', '', $hex);
1117
+	if (strlen($hex) == 3) {
1118
+		$hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2);
1119
+	}
1120 1120
 
1121
-    // Split into three parts: R, G and B
1122
-    $color_parts = str_split($hex, 2);
1123
-    $return = '#';
1121
+	// Split into three parts: R, G and B
1122
+	$color_parts = str_split($hex, 2);
1123
+	$return = '#';
1124 1124
 
1125
-    foreach ($color_parts as $color) {
1126
-        $color   = hexdec($color); // Convert to decimal
1127
-        $color   = max(0,min(255,$color + $steps)); // Adjust color
1128
-        $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code
1129
-    }
1125
+	foreach ($color_parts as $color) {
1126
+		$color   = hexdec($color); // Convert to decimal
1127
+		$color   = max(0,min(255,$color + $steps)); // Adjust color
1128
+		$return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code
1129
+	}
1130 1130
 
1131
-    return $return;
1131
+	return $return;
1132 1132
 }
Please login to merge, or discard this patch.
lasso.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 add_filter('register_post_type_args', 'lasso_show_in_rest', 10, 2);
49 49
 function lasso_show_in_rest($args, $post_type){
50 50
  
51
-    $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( ) );
51
+	$allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( ) );
52 52
 	$allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
53 53
 	if (in_array( $post_type,$allowed_post_types)) {
54 54
 		$args['show_in_rest'] = true;
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 		}
58 58
 	}
59 59
  
60
-    return $args;
60
+	return $args;
61 61
 }
62 62
 
63 63
 
@@ -106,25 +106,25 @@  discard block
 block discarded – undo
106 106
 //table codes to be added
107 107
 class editus_table {
108 108
     
109
-    public function __construct(){
110
-        $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
111
-        if ($add_table) {
112
-            add_action('wp_enqueue_scripts', array($this,'scripts'));
109
+	public function __construct(){
110
+		$add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
111
+		if ($add_table) {
112
+			add_action('wp_enqueue_scripts', array($this,'scripts'));
113 113
             
114
-        }
114
+		}
115 115
 	}
116 116
     
117
-    function scripts()
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 );
124
-    }
117
+	function scripts()
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 );
124
+	}
125 125
     
126
-    function editus_table_edit_menu()
127
-    { ?>
126
+	function editus_table_edit_menu()
127
+	{ ?>
128 128
 
129 129
         <ul class='editus-table-menu'>
130 130
           <li data-action="insertcol"><?php echo __('Insert Column','lasso')?></li>
@@ -134,31 +134,31 @@  discard block
 block discarded – undo
134 134
           <li data-action="deltable"><?php echo __('Delete Table','lasso')?></li
135 135
         </ul>
136 136
     <?php
137
-    }
137
+	}
138 138
     
139 139
     
140
-    function editus_html_table()
141
-    {   
142
-        return '<figure class="wp-block-table"><table><tr><th>Cell 1</th><th>Cell 2</th></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table></figure><p></p>';
143
-    }
140
+	function editus_html_table()
141
+	{   
142
+		return '<figure class="wp-block-table"><table><tr><th>Cell 1</th><th>Cell 2</th></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table></figure><p></p>';
143
+	}
144 144
 
145 145
 
146
-    function editus_components_add_table( $array ){
147
-        $custom = array(
148
-               'htmltable' => array(
149
-                         'name'    => __('HTML Table','lasso'),
150
-                          'content' => self::editus_html_table(),
151
-                )
152
-        );
153
-        return array_merge( $array, $custom );
154
-    }
146
+	function editus_components_add_table( $array ){
147
+		$custom = array(
148
+			   'htmltable' => array(
149
+						 'name'    => __('HTML Table','lasso'),
150
+						  'content' => self::editus_html_table(),
151
+				)
152
+		);
153
+		return array_merge( $array, $custom );
154
+	}
155 155
 
156 156
 
157
-    function editus_toolbar_components_add_table( ) {
158
-          ?>
157
+	function editus_toolbar_components_add_table( ) {
158
+		  ?>
159 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
 }
163 163
 
164 164
 
Please login to merge, or discard this patch.