Completed
Push — master ( c34fb4...51d4c2 )
by
unknown
01:31
created
public/includes/editor-modules.php 4 patches
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -188,8 +188,11 @@  discard block
 block discarded – undo
188 188
 						<?php if ( class_exists ('Aesop_Events') ) { ?>
189 189
 						     <li data-type="events" title="<?php esc_attr_e( 'Event', 'lasso' );?>"  class="lasso-toolbar--component__event"></li>
190 190
 						<?php }?>
191
-					<?php else: ?>
192
-						<li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li>
191
+					<?php else {
192
+	: ?>
193
+						<li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );
194
+}
195
+?>" class="image lasso-toolbar--component__image"></li>
193 196
 						<li data-type="wpquote" title="<?php esc_attr_e( 'WordPress Quote', 'lasso' );?>" class="quote lasso-toolbar--component__quote"></li>
194 197
 						<!--li data-type="wpvideo" title="<?php esc_attr_e( 'WordPress Video', 'lasso' );?>" class="video lasso-toolbar--component__video"></li-->
195 198
 					<?php endif; ?>
@@ -712,8 +715,9 @@  discard block
 block discarded – undo
712 715
 
713 716
 	$blob = array();
714 717
 
715
-	if ( empty( $codes ) )
716
-		return;
718
+	if ( empty( $codes ) ) {
719
+			return;
720
+	}
717 721
 
718 722
 	foreach ( $codes as $slug => $shortcode ) {
719 723
 		$return = '';
Please login to merge, or discard this patch.
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 	$toolbar_class  = $toolbar_headings ? 'toolbar-extended' : false;
205 205
 	
206 206
 	// mobile styles
207
-    $mobile_class = $is_mobile ? 'lasso-mobile' : false;
207
+	$mobile_class = $is_mobile ? 'lasso-mobile' : false;
208 208
 	$mobile_style =$is_mobile ? 'style="bottom:0px;"' : null;
209 209
 	
210 210
 	//show color
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
 						</div>
485 485
 						<?php 
486 486
 						if ($allow_change_date) { 
487
-						    $dateformat = get_option( 'date_format' ); 
487
+							$dateformat = get_option( 'date_format' ); 
488 488
 						?>
489 489
 						    <label><?php _e( 'Post Date', 'lasso' ); ?></label>
490 490
 							<input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/>
@@ -598,7 +598,7 @@  discard block
 block discarded – undo
598 598
 						if ( !empty( $types ) ) {
599 599
 							// get the first element
600 600
 							$keys = array_keys($types);
601
-						    $type =$keys[0];						
601
+							$type =$keys[0];						
602 602
 							$type = preg_replace( '/s\b/','', $type );
603 603
 							printf( '<input type="hidden" name="object" value="%s">', lcfirst( esc_attr( $type ) ) );		
604 604
 						}
@@ -626,8 +626,8 @@  discard block
 block discarded – undo
626 626
 	global $post;
627 627
 	
628 628
 	global $wp_post_types;
629
-    $labels = &$wp_post_types['post']->labels;
630
-    $labels->name = 'Articles';
629
+	$labels = &$wp_post_types['post']->labels;
630
+	$labels->name = 'Articles';
631 631
 
632 632
 	ob_start();
633 633
 
@@ -870,9 +870,9 @@  discard block
 block discarded – undo
870 870
 		$return .= '</form>';
871 871
 
872 872
 		// extra JS codes
873
-        if (isset($shortcode['codes'])) {
874
-		    $return .= $shortcode['codes'];
875
-        }
873
+		if (isset($shortcode['codes'])) {
874
+			$return .= $shortcode['codes'];
875
+		}
876 876
 		$blob[$slug] = $return;
877 877
 	}
878 878
 
@@ -921,23 +921,23 @@  discard block
 block discarded – undo
921 921
  * @return string
922 922
  */
923 923
 function lasso_editor_adjustBrightness($hex, $steps) { 
924
-    $steps = max(-255, min(255, $steps));
924
+	$steps = max(-255, min(255, $steps));
925 925
 
926
-    // Normalize into a six character long hex string
927
-    $hex = str_replace('#', '', $hex);
928
-    if (strlen($hex) == 3) {
929
-        $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2);
930
-    }
926
+	// Normalize into a six character long hex string
927
+	$hex = str_replace('#', '', $hex);
928
+	if (strlen($hex) == 3) {
929
+		$hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2);
930
+	}
931 931
 
932
-    // Split into three parts: R, G and B
933
-    $color_parts = str_split($hex, 2);
934
-    $return = '#';
932
+	// Split into three parts: R, G and B
933
+	$color_parts = str_split($hex, 2);
934
+	$return = '#';
935 935
 
936
-    foreach ($color_parts as $color) {
937
-        $color   = hexdec($color); // Convert to decimal
938
-        $color   = max(0,min(255,$color + $steps)); // Adjust color
939
-        $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code
940
-    }
936
+	foreach ($color_parts as $color) {
937
+		$color   = hexdec($color); // Convert to decimal
938
+		$color   = max(0,min(255,$color + $steps)); // Adjust color
939
+		$return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code
940
+	}
941 941
 
942
-    return $return;
942
+	return $return;
943 943
 }
Please login to merge, or discard this patch.
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -923,6 +923,7 @@
 block discarded – undo
923 923
  * Takes a color code and returns an adjusted value
924 924
  * @since 1.0.0
925 925
  * Steps should be between -255 and 255. Negative = darker, positive = lighter
926
+ * @param integer $steps
926 927
  * @return string
927 928
  */
928 929
 function lasso_editor_adjustBrightness($hex, $steps) { 
Please login to merge, or discard this patch.
Spacing   +260 added lines, -260 removed lines patch added patch discarded remove patch
@@ -11,39 +11,39 @@  discard block
 block discarded – undo
11 11
  *
12 12
  * @since 1.0
13 13
  */
14
-add_action( 'wp_footer', 'lasso_editor_controls' );
14
+add_action('wp_footer', 'lasso_editor_controls');
15 15
 function lasso_editor_controls() {
16 16
 
17 17
 	global $post;
18 18
 
19
-	if ( lasso_user_can('edit_posts') ) {
19
+	if (lasso_user_can('edit_posts')) {
20 20
 
21
-		$status = get_post_status( get_the_ID() );
22
-		$use_old_ui   = lasso_editor_get_option( 'use_old_ui', 'lasso_editor' );
23
-		$button_color1 = lasso_editor_get_option('button-color1', 'lasso_editor','#0000ff');
24
-		$button_color2 = lasso_editor_get_option('button-color2', 'lasso_editor','#000000');
25
-		$dialog_color = lasso_editor_get_option('dialog-color', 'lasso_editor','#000055');
26
-		$text_color = lasso_editor_get_option('text-color', 'lasso_editor','#ffffff');
21
+		$status = get_post_status(get_the_ID());
22
+		$use_old_ui   = lasso_editor_get_option('use_old_ui', 'lasso_editor');
23
+		$button_color1 = lasso_editor_get_option('button-color1', 'lasso_editor', '#0000ff');
24
+		$button_color2 = lasso_editor_get_option('button-color2', 'lasso_editor', '#000000');
25
+		$dialog_color = lasso_editor_get_option('dialog-color', 'lasso_editor', '#000055');
26
+		$text_color = lasso_editor_get_option('text-color', 'lasso_editor', '#ffffff');
27 27
 		$hover_color1 = lasso_editor_adjustBrightness($button_color1, 50);
28 28
 		$hover_color2 = lasso_editor_adjustBrightness($button_color2, 50);
29 29
 
30 30
 		// let users add custom css classes
31
-		$custom_classes = apply_filters( 'lasso_control_classes', '' );
31
+		$custom_classes = apply_filters('lasso_control_classes', '');
32 32
 
33 33
 		$post_access_class   = '';
34
-		$post_new_disabled   = lasso_editor_get_option( 'post_adding_disabled', 'lasso_editor' );
35
-		$post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' );
36
-		$shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' );
34
+		$post_new_disabled   = lasso_editor_get_option('post_adding_disabled', 'lasso_editor');
35
+		$post_settings_disabled = lasso_editor_get_option('post_settings_disabled', 'lasso_editor');
36
+		$shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor');
37 37
 
38 38
 
39 39
 		// CSS class if adding new post objects is disabled
40
-		if ( 'on' == $post_new_disabled ) { $post_access_class = 'lasso--post-new-disabled'; }
40
+		if ('on' == $post_new_disabled) { $post_access_class = 'lasso--post-new-disabled'; }
41 41
 
42 42
 		// CSS class if adjust settings is disabled
43
-		if ( 'on' == $post_settings_disabled ) { $post_access_class = 'lasso--post-settings-disabled'; }
43
+		if ('on' == $post_settings_disabled) { $post_access_class = 'lasso--post-settings-disabled'; }
44 44
 
45 45
 		// CSS class if adding new post objects AND settings are disabled
46
-		if ( 'on' == $post_new_disabled && 'on' == $post_settings_disabled ) { $post_access_class = 'lasso--post-all-disabled'; }
46
+		if ('on' == $post_new_disabled && 'on' == $post_settings_disabled) { $post_access_class = 'lasso--post-all-disabled'; }
47 47
 
48 48
 		// CSS class if shortcodify or (Aesop Shortcode Conversion) is disabled
49 49
 		$sc_saving_class = 'on' == $shortcodify_disabled ? 'shortcodify-disabled' : 'shortcodify-enabled';
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 		?>
58 58
 		<style>
59 59
 		#lasso-html--table:before {
60
-			content: "<?php esc_attr_e( 'Table', 'lasso' );?>";
60
+			content: "<?php esc_attr_e('Table', 'lasso'); ?>";
61 61
 		}
62 62
 		</style>
63 63
 		
@@ -68,31 +68,31 @@  discard block
 block discarded – undo
68 68
 		<style>
69 69
 		
70 70
 		.lasso-editor-controls--wrap, #lasso--post-settings2,#lasso--save,#lasso--post-delete,#lasso--exit,#lasso--publish {
71
-			background-image: -webkit-linear-gradient(top,<?php echo $button_color1;?> 0,<?php echo $button_color2;?> 100%);
72
-			background-image: -o-linear-gradient(top,<?php echo $button_color1;?> 0,<?php echo $button_color2;?> 100%);
73
-			background-image: linear-gradient(to bottom,<?php echo $button_color1;?> 0,<?php echo $button_color2;?> 100%);
74
-			color: <?php echo $text_color;?>;
71
+			background-image: -webkit-linear-gradient(top,<?php echo $button_color1; ?> 0,<?php echo $button_color2; ?> 100%);
72
+			background-image: -o-linear-gradient(top,<?php echo $button_color1; ?> 0,<?php echo $button_color2; ?> 100%);
73
+			background-image: linear-gradient(to bottom,<?php echo $button_color1; ?> 0,<?php echo $button_color2; ?> 100%);
74
+			color: <?php echo $text_color; ?>;
75 75
 		}
76 76
 		
77 77
 		.lasso--controls__right a:before, #lasso-toolbar--html__footer_desc {
78
-			color: <?php echo $text_color;?> !important;
78
+			color: <?php echo $text_color; ?> !important;
79 79
 		}
80 80
 		
81 81
 		
82 82
 		
83 83
 		ul.lasso-editor-controls li:hover, #lasso--exit:hover,#lasso--post-settings2:hover,#lasso--post-delete:hover,#lasso--publish:hover,#lasso--save:hover {
84
-			background-image: -webkit-linear-gradient(top,<?php echo $hover_color1;?> 0,<?php echo $hover_color2;?> 100%);
85
-			background-image: -o-linear-gradient(top,<?php echo $hover_color1;?> 0,<?php echo $hover_color2;?> 100%);
86
-			background-image: linear-gradient(to bottom,<?php echo $hover_color1;?> 0,<?php echo $hover_color2;?> 100%);
84
+			background-image: -webkit-linear-gradient(top,<?php echo $hover_color1; ?> 0,<?php echo $hover_color2; ?> 100%);
85
+			background-image: -o-linear-gradient(top,<?php echo $hover_color1; ?> 0,<?php echo $hover_color2; ?> 100%);
86
+			background-image: linear-gradient(to bottom,<?php echo $hover_color1; ?> 0,<?php echo $hover_color2; ?> 100%);
87 87
 		}
88 88
 		
89 89
 		.lasso--modal__inner,.sweet-alert,#lasso-toolbar--components.toolbar--drop-up ul,#lasso-toolbar--components__list,#lasso-toolbar--html.html--drop-up #lasso-toolbar--html__wrap,
90 90
 		#lasso-toolbar--link.link--drop-up #lasso-toolbar--link__wrap		{
91
-			background: <?php echo $dialog_color;?>;
92
-			color: <?php echo $text_color;?>;
91
+			background: <?php echo $dialog_color; ?>;
92
+			color: <?php echo $text_color; ?>;
93 93
 		}
94 94
 		.sweet-alert p,.lasso--modal__inner label,.lasso--toolbar__inner label {
95
-			color: <?php echo $text_color;?> !important;
95
+			color: <?php echo $text_color; ?> !important;
96 96
 		}
97 97
 		
98 98
 		<?php if (!$is_mobile) { ?>
@@ -122,48 +122,48 @@  discard block
 block discarded – undo
122 122
 		<?php
123 123
 		} 
124 124
 		?>
125
-		<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();?>" >
125
+		<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(); ?>" >
126 126
 
127
-			<ul class="lasso--controls__center lasso-editor-controls lasso-editor-controls--wrap <?php echo $post_access_class;?> "  <?php echo $mobile_style ?> >
127
+			<ul class="lasso--controls__center lasso-editor-controls lasso-editor-controls--wrap <?php echo $post_access_class; ?> "  <?php echo $mobile_style ?> >
128 128
 
129
-				<?php do_action( 'lasso_editor_controls_before' );
129
+				<?php do_action('lasso_editor_controls_before');
130 130
 
131
-				if ( $is_capable ) { ?>
131
+				if ($is_capable) { ?>
132 132
 
133
-					<li id="lasso--edit" title="<?php esc_attr_e( 'Edit Post', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
133
+					<li id="lasso--edit" title="<?php esc_attr_e('Edit Post', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
134 134
 
135
-					<?php if ( 'off' == $post_settings_disabled || empty( $post_settings_disabled ) ) { ?>
136
-						<li id="lasso--post-settings" title="<?php esc_attr_e( 'Post Settings', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
135
+					<?php if ('off' == $post_settings_disabled || empty($post_settings_disabled)) { ?>
136
+						<li id="lasso--post-settings" title="<?php esc_attr_e('Post Settings', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
137 137
 					<?php }
138 138
 
139 139
 				} ?>
140 140
 
141
-				<li id="lasso--post-all" title="<?php esc_attr_e( 'All Posts', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
141
+				<li id="lasso--post-all" title="<?php esc_attr_e('All Posts', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
142 142
 
143
-				<?php if ( $is_capable && wp_revisions_enabled( $post ) ) { ?>
144
-					<li id="lasso--post-revisions" title="<?php esc_attr_e( 'Revisions', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
143
+				<?php if ($is_capable && wp_revisions_enabled($post)) { ?>
144
+					<li id="lasso--post-revisions" title="<?php esc_attr_e('Revisions', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
145 145
 				<?php } ?>
146 146
 
147
-				<?php if ( ( 'off' == $post_new_disabled || empty( $post_new_disabled ) && lasso_user_can('edit_posts') ) ) { ?>
148
-					<li id="lasso--post-new" title="<?php esc_attr_e( 'Add Post', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
147
+				<?php if (('off' == $post_new_disabled || empty($post_new_disabled) && lasso_user_can('edit_posts'))) { ?>
148
+					<li id="lasso--post-new" title="<?php esc_attr_e('Add Post', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
149 149
 				<?php } ?>
150 150
 
151
-				<?php do_action( 'lasso_editor_controls_after' );?>
151
+				<?php do_action('lasso_editor_controls_after'); ?>
152 152
 
153 153
 			</ul>
154 154
 
155
-			<?php if ( is_singular() && !$is_mobile ) { ?>
155
+			<?php if (is_singular() && !$is_mobile) { ?>
156 156
 
157
-				<div class="lasso--controls__right" data-posttype="<?php echo get_post_type( get_the_ID() );?>" data-status="<?php echo $status;?>">
157
+				<div class="lasso--controls__right" data-posttype="<?php echo get_post_type(get_the_ID()); ?>" data-status="<?php echo $status; ?>">
158 158
 				
159
-					<a href="#" title="<?php esc_attr_e( 'Delete Post', 'lasso' );?>" id="lasso--post-delete" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a>
160
-					<a href="#" title="<?php esc_attr_e( 'Post Settings', 'lasso' );?>" id="lasso--post-settings2" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a>
159
+					<a href="#" title="<?php esc_attr_e('Delete Post', 'lasso'); ?>" id="lasso--post-delete" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a>
160
+					<a href="#" title="<?php esc_attr_e('Post Settings', 'lasso'); ?>" id="lasso--post-settings2" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a>
161 161
 
162 162
 
163
-					<a href="#" title="<?php esc_attr_e( 'Save Post', 'lasso' );?>" id="lasso--save" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a>
163
+					<a href="#" title="<?php esc_attr_e('Save Post', 'lasso'); ?>" id="lasso--save" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a>
164 164
 
165
-					<?php if ( ('draft' == $status ) || ('pending' == $status && $can_publish) ) { ?>
166
-						<a href="#" title="<?php $can_publish ? esc_attr_e( 'Publish Post', 'lasso' ) : esc_attr_e( 'Submit For Review', 'lasso' );?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class;?>"></a>
165
+					<?php if (('draft' == $status) || ('pending' == $status && $can_publish)) { ?>
166
+						<a href="#" title="<?php $can_publish ? esc_attr_e('Publish Post', 'lasso') : esc_attr_e('Submit For Review', 'lasso'); ?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class; ?>"></a>
167 167
 					<?php } ?>
168 168
 					
169 169
 
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 		</div>
175 175
 		
176 176
 		
177
-		<?php do_action( 'lasso_editor_controls_after_outside' );?>
177
+		<?php do_action('lasso_editor_controls_after_outside'); ?>
178 178
 
179 179
 	<?php }
180 180
 }
@@ -192,9 +192,9 @@  discard block
 block discarded – undo
192 192
 
193 193
 
194 194
 	// let users add custom css classes
195
-	$custom_classes = apply_filters( 'lasso_sidebar_classes', '' );
195
+	$custom_classes = apply_filters('lasso_sidebar_classes', '');
196 196
 	?>
197
-	<div id="lasso--sidebar" class="<?php echo sanitize_html_class( $custom_classes );?>" >
197
+	<div id="lasso--sidebar" class="<?php echo sanitize_html_class($custom_classes); ?>" >
198 198
 		<div class="lasso--sidebar__inner">
199 199
 			<div id="aesop-generator-settings"><div id="lasso--component__settings"></div></div>
200 200
 		</div>
@@ -216,21 +216,21 @@  discard block
 block discarded – undo
216 216
 	$is_mobile = wp_is_mobile();
217 217
 
218 218
 	// check for lasso story engine and add a class doniting this
219
-	$ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active';
219
+	$ase_status = class_exists('Aesop_Core') || defined('LASSO_CUSTOM') ? 'ase-active' : 'ase-not-active';
220 220
 
221 221
 	// let users add custom css classes
222
-	$custom_classes = apply_filters( 'lasso_toolbar_classes', '' );
222
+	$custom_classes = apply_filters('lasso_toolbar_classes', '');
223 223
 
224 224
 	// are toolbar headings enabled
225
-	$toolbar_headings      = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' );
226
-	$toolbar_headings_h4      = lasso_editor_get_option( 'toolbar_headings_h4', 'lasso_editor' );
227
-	$toolbar_list      = lasso_editor_get_option( 'toolbar_list', 'lasso_editor' );
225
+	$toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor');
226
+	$toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
227
+	$toolbar_list = lasso_editor_get_option('toolbar_list', 'lasso_editor');
228 228
 
229
-	$toolbar_class  = $toolbar_headings ? 'toolbar-extended' : false;
229
+	$toolbar_class = $toolbar_headings ? 'toolbar-extended' : false;
230 230
 	
231 231
 	// mobile styles
232 232
     $mobile_class = $is_mobile ? 'lasso-mobile' : false;
233
-	$mobile_style =$is_mobile ? 'style="bottom:0px;"' : null;
233
+	$mobile_style = $is_mobile ? 'style="bottom:0px;"' : null;
234 234
 	
235 235
 	//show color
236 236
 	$show_color = lasso_editor_get_option('toolbar_show_color', 'lasso_editor');
@@ -238,126 +238,126 @@  discard block
 block discarded – undo
238 238
 	//show alignment
239 239
 	$show_align = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor');
240 240
 	
241
-	$status = get_post_status( get_the_ID() );
241
+	$status = get_post_status(get_the_ID());
242 242
 	
243
-	$shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' );
243
+	$shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor');
244 244
 	
245 245
 	$sc_saving_class = 'on' == $shortcodify_disabled ? 'shortcodify-disabled' : 'shortcodify-enabled';
246 246
 
247 247
 
248 248
 	?>
249
-	<div class="lasso--toolbar_wrap lasso-editor-controls--wrap <?php echo $toolbar_class.' '.$mobile_class.' '.$ase_status.' '.sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style ?>>
250
-		<ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"';}?>>
251
-			<?php do_action( 'lasso_toolbar_components_before' );?>
252
-		    <li id="lasso-toolbar--bold" title="<?php esc_attr_e( 'Bold', 'lasso' );?>"></li>
253
-		    <li id="lasso-toolbar--underline" title="<?php esc_attr_e( 'Underline', 'lasso' );?>"></li>
254
-		    <li id="lasso-toolbar--italic" title="<?php esc_attr_e( 'Italicize', 'lasso' );?>"></li>
255
-		    <li id="lasso-toolbar--strike" title="<?php esc_attr_e( 'Strikethrough', 'lasso' );?>"></li>
256
-			<li id="lasso-toolbar--components" class="lasso-toolbar--components" title="<?php esc_attr_e( 'Insert Component', 'lasso' );?>" style="color:#ffffa0;">
249
+	<div class="lasso--toolbar_wrap lasso-editor-controls--wrap <?php echo $toolbar_class.' '.$mobile_class.' '.$ase_status.' '.sanitize_html_class($custom_classes); ?>" <?php echo $mobile_style ?>>
250
+		<ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"'; }?>>
251
+			<?php do_action('lasso_toolbar_components_before'); ?>
252
+		    <li id="lasso-toolbar--bold" title="<?php esc_attr_e('Bold', 'lasso'); ?>"></li>
253
+		    <li id="lasso-toolbar--underline" title="<?php esc_attr_e('Underline', 'lasso'); ?>"></li>
254
+		    <li id="lasso-toolbar--italic" title="<?php esc_attr_e('Italicize', 'lasso'); ?>"></li>
255
+		    <li id="lasso-toolbar--strike" title="<?php esc_attr_e('Strikethrough', 'lasso'); ?>"></li>
256
+			<li id="lasso-toolbar--components" class="lasso-toolbar--components" title="<?php esc_attr_e('Insert Component', 'lasso'); ?>" style="color:#ffffa0;">
257 257
 			    <ul id="lasso-toolbar--components__list" style="display:none;color:white;">
258
-			    	<?php if ( 'ase-active' == $ase_status ): ?>
259
-						<li data-type="image" title="<?php esc_attr_e( 'Image', 'lasso' );?>" class="lasso-toolbar--component__image"></li>
260
-						<li data-type="character" title="<?php esc_attr_e( 'Character', 'lasso' );?>" class="lasso-toolbar--component__character"></li>
261
-						<li data-type="quote" title="<?php esc_attr_e( 'Quote', 'lasso' );?>"  class="lasso-toolbar--component__quote"></li>
262
-						<li data-type="content" title="<?php esc_attr_e( 'Content', 'lasso' );?>"  class="lasso-toolbar--component__content"></li>
263
-						<li data-type="chapter" title="<?php esc_attr_e( 'Chapter', 'lasso' );?>"  class="lasso-toolbar--component__chapter"></li>
264
-						<li data-type="parallax" title="<?php esc_attr_e( 'Parallax', 'lasso' );?>"  class="lasso-toolbar--component__parallax"></li>
265
-						<li data-type="audio" title="<?php esc_attr_e( 'Audio', 'lasso' );?>"  class="lasso-toolbar--component__audio"></li>
266
-						<li data-type="video" title="<?php esc_attr_e( 'Video', 'lasso' );?>"  class="lasso-toolbar--component__video"></li>
267
-						<li data-type="map" title="<?php esc_attr_e( 'Map', 'lasso' );?>"  class="lasso-toolbar--component__map"></li>
268
-						<li data-type="timeline_stop" title="<?php esc_attr_e( 'Timeline', 'lasso' );?>"  class="lasso-toolbar--component__timeline"></li>
269
-						<li data-type="document" title="<?php esc_attr_e( 'Document', 'lasso' );?>"  class="lasso-toolbar--component__document"></li>
270
-						<li data-type="collection" title="<?php esc_attr_e( 'Collection', 'lasso' );?>"  class="lasso-toolbar--component__collection"></li>
271
-						<li data-type="gallery" title="<?php esc_attr_e( 'Gallery', 'lasso' );?>"  class="lasso-toolbar--component__gallery"></li>
272
-						<?php if ( class_exists ('Aesop_GalleryPop') ) { ?>
273
-						     <li data-type="gallery" title="<?php esc_attr_e( 'Gallery Pop', 'lasso' );?>"  class="lasso-toolbar--component__gallerypop"></li>
258
+			    	<?php if ('ase-active' == $ase_status): ?>
259
+						<li data-type="image" title="<?php esc_attr_e('Image', 'lasso'); ?>" class="lasso-toolbar--component__image"></li>
260
+						<li data-type="character" title="<?php esc_attr_e('Character', 'lasso'); ?>" class="lasso-toolbar--component__character"></li>
261
+						<li data-type="quote" title="<?php esc_attr_e('Quote', 'lasso'); ?>"  class="lasso-toolbar--component__quote"></li>
262
+						<li data-type="content" title="<?php esc_attr_e('Content', 'lasso'); ?>"  class="lasso-toolbar--component__content"></li>
263
+						<li data-type="chapter" title="<?php esc_attr_e('Chapter', 'lasso'); ?>"  class="lasso-toolbar--component__chapter"></li>
264
+						<li data-type="parallax" title="<?php esc_attr_e('Parallax', 'lasso'); ?>"  class="lasso-toolbar--component__parallax"></li>
265
+						<li data-type="audio" title="<?php esc_attr_e('Audio', 'lasso'); ?>"  class="lasso-toolbar--component__audio"></li>
266
+						<li data-type="video" title="<?php esc_attr_e('Video', 'lasso'); ?>"  class="lasso-toolbar--component__video"></li>
267
+						<li data-type="map" title="<?php esc_attr_e('Map', 'lasso'); ?>"  class="lasso-toolbar--component__map"></li>
268
+						<li data-type="timeline_stop" title="<?php esc_attr_e('Timeline', 'lasso'); ?>"  class="lasso-toolbar--component__timeline"></li>
269
+						<li data-type="document" title="<?php esc_attr_e('Document', 'lasso'); ?>"  class="lasso-toolbar--component__document"></li>
270
+						<li data-type="collection" title="<?php esc_attr_e('Collection', 'lasso'); ?>"  class="lasso-toolbar--component__collection"></li>
271
+						<li data-type="gallery" title="<?php esc_attr_e('Gallery', 'lasso'); ?>"  class="lasso-toolbar--component__gallery"></li>
272
+						<?php if (class_exists('Aesop_GalleryPop')) { ?>
273
+						     <li data-type="gallery" title="<?php esc_attr_e('Gallery Pop', 'lasso'); ?>"  class="lasso-toolbar--component__gallerypop"></li>
274 274
 						<?php }?>
275
-						<?php if ( class_exists ('Aesop_Events') ) { ?>
276
-						     <li data-type="events" title="<?php esc_attr_e( 'Event', 'lasso' );?>"  class="lasso-toolbar--component__event"></li>
275
+						<?php if (class_exists('Aesop_Events')) { ?>
276
+						     <li data-type="events" title="<?php esc_attr_e('Event', 'lasso'); ?>"  class="lasso-toolbar--component__event"></li>
277 277
 						<?php }?>
278 278
 					<?php else: ?>
279
-						<li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li>
280
-						<li data-type="wpquote" title="<?php esc_attr_e( 'WordPress Quote', 'lasso' );?>" class="quote lasso-toolbar--component__quote"></li>
281
-						<!--li data-type="wpvideo" title="<?php esc_attr_e( 'WordPress Video', 'lasso' );?>" class="video lasso-toolbar--component__video"></li-->
279
+						<li data-type="wpimg" title="<?php esc_attr_e('WordPress Image', 'lasso'); ?>" class="image lasso-toolbar--component__image"></li>
280
+						<li data-type="wpquote" title="<?php esc_attr_e('WordPress Quote', 'lasso'); ?>" class="quote lasso-toolbar--component__quote"></li>
281
+						<!--li data-type="wpvideo" title="<?php esc_attr_e('WordPress Video', 'lasso'); ?>" class="video lasso-toolbar--component__video"></li-->
282 282
 					<?php endif; ?>
283
-					<?php do_action( 'lasso_toolbar_components' );?>
283
+					<?php do_action('lasso_toolbar_components'); ?>
284 284
 			    </ul>
285 285
 			</li>
286
-		    <?php if ( $toolbar_headings ): ?>
287
-		    <li id="lasso-toolbar--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"></li>
288
-		    <li id="lasso-toolbar--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"></li>
286
+		    <?php if ($toolbar_headings): ?>
287
+		    <li id="lasso-toolbar--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"></li>
288
+		    <li id="lasso-toolbar--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"></li>
289 289
 			<?php endif; ?>
290 290
 			
291 291
 			
292 292
 			
293
-			<?php if ( $toolbar_headings_h4 ): ?>
294
-		    <li id="lasso-toolbar--h4" title="<?php esc_attr_e( 'H4 Heading', 'lasso' );?>"></li>
295
-		    <li id="lasso-toolbar--h5" title="<?php esc_attr_e( 'H5 Heading', 'lasso' );?>"></li>
296
-			<li id="lasso-toolbar--h6" title="<?php esc_attr_e( 'H6 Heading', 'lasso' );?>"></li>
293
+			<?php if ($toolbar_headings_h4): ?>
294
+		    <li id="lasso-toolbar--h4" title="<?php esc_attr_e('H4 Heading', 'lasso'); ?>"></li>
295
+		    <li id="lasso-toolbar--h5" title="<?php esc_attr_e('H5 Heading', 'lasso'); ?>"></li>
296
+			<li id="lasso-toolbar--h6" title="<?php esc_attr_e('H6 Heading', 'lasso'); ?>"></li>
297 297
 			<?php endif; ?>
298 298
 			
299
-			<?php if ( $show_color ): ?>
300
-		    <li id="lasso-toolbar--color-set" title="<?php esc_attr_e( 'Set Color for Selected Text', 'lasso' );?>"></li>
301
-		    <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e( 'Choose Color', 'lasso' );?>"></li>
299
+			<?php if ($show_color): ?>
300
+		    <li id="lasso-toolbar--color-set" title="<?php esc_attr_e('Set Color for Selected Text', 'lasso'); ?>"></li>
301
+		    <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e('Choose Color', 'lasso'); ?>"></li>
302 302
 			<?php endif; ?>
303 303
 			
304
-			<?php if ( $toolbar_list ): ?>
305
-		    <li id="lasso-toolbar--ol" title="<?php esc_attr_e( 'Ordered List', 'lasso' );?>"></li>
306
-		    <li id="lasso-toolbar--ul" title="<?php esc_attr_e( 'Unordered List', 'lasso' );?>"></li>
304
+			<?php if ($toolbar_list): ?>
305
+		    <li id="lasso-toolbar--ol" title="<?php esc_attr_e('Ordered List', 'lasso'); ?>"></li>
306
+		    <li id="lasso-toolbar--ul" title="<?php esc_attr_e('Unordered List', 'lasso'); ?>"></li>
307 307
 			<?php endif; ?>
308 308
 					
309 309
 		    
310
-			<li id="lasso-toolbar--link" title="<?php esc_attr_e( 'Anchor Link', 'lasso' );?>">
310
+			<li id="lasso-toolbar--link" title="<?php esc_attr_e('Anchor Link', 'lasso'); ?>">
311 311
 		    	<div id="lasso-toolbar--link__wrap" <?php echo $mobile_style ?> >
312
-		    		<div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'http://url.com', 'lasso' );?>"></div>
313
-		    		<a href="#" title="<?php esc_attr_e( 'Create Link', 'lasso' );?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a>
312
+		    		<div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e('http://url.com', 'lasso'); ?>"></div>
313
+		    		<a href="#" title="<?php esc_attr_e('Create Link', 'lasso'); ?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a>
314 314
 					<input class="styled-checkbox" type="checkbox" id="aesop-toolbar--link_newtab" checked/>
315
-                    <label for="aesop-toolbar--link_newtab"><?php esc_attr_e( 'Open in a New Tab', 'lasso' );?></label>
315
+                    <label for="aesop-toolbar--link_newtab"><?php esc_attr_e('Open in a New Tab', 'lasso'); ?></label>
316 316
 		    	</div>
317 317
 		    </li>
318
-		    <?php do_action( 'lasso_toolbar_components_after' );?>
319
-		    <li id="lasso-toolbar--html" title="<?php esc_attr_e( 'Insert HTML or Code', 'lasso' );?>">
318
+		    <?php do_action('lasso_toolbar_components_after'); ?>
319
+		    <li id="lasso-toolbar--html" title="<?php esc_attr_e('Insert HTML or Code', 'lasso'); ?>">
320 320
 		    	<div id="lasso-toolbar--html__wrap" <?php echo $mobile_style ?>>
321
-		    		<div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?>"></div>
321
+		    		<div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e('Enter HTML to insert', 'lasso'); ?>"></div>
322 322
 		    		<div id="lasso-toolbar--html__footer">
323 323
 					<div id="lasso-toolbar--html__footer_desc" >
324
-					<?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?><br>
325
-					<?php esc_attr_e( 'You can also use Shortcodes', 'lasso' );?><br>
326
-					<?php esc_attr_e( 'You can also enter a URL to embed, such as Youtube, Vimeo and Twitter URLs.', 'lasso' );?>
324
+					<?php esc_attr_e('Enter HTML to insert', 'lasso'); ?><br>
325
+					<?php esc_attr_e('You can also use Shortcodes', 'lasso'); ?><br>
326
+					<?php esc_attr_e('You can also enter a URL to embed, such as Youtube, Vimeo and Twitter URLs.', 'lasso'); ?>
327 327
 					</div>
328 328
 		    			<ul class="lasso-toolbar--html-snips">
329 329
 						
330
-		    				<?php if ( !$toolbar_headings ): ?>
331
-		    				<li id="lasso-html--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>">
332
-		    				<li id="lasso-html--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>">
330
+		    				<?php if (!$toolbar_headings): ?>
331
+		    				<li id="lasso-html--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>">
332
+		    				<li id="lasso-html--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>">
333 333
 		    				<?php endif; ?>
334
-		    				<li id="lasso-html--ol" title="<?php esc_attr_e( 'Ordered List', 'lasso' );?>">
335
-							<li id="lasso-html--ul" title="<?php esc_attr_e( 'Unordered List', 'lasso' );?>">
334
+		    				<li id="lasso-html--ol" title="<?php esc_attr_e('Ordered List', 'lasso'); ?>">
335
+							<li id="lasso-html--ul" title="<?php esc_attr_e('Unordered List', 'lasso'); ?>">
336 336
 							
337
-							<li id="lasso-html--table" title="<?php esc_attr_e( 'Table', 'lasso' );?>">
337
+							<li id="lasso-html--table" title="<?php esc_attr_e('Table', 'lasso'); ?>">
338 338
 		    			</ul>
339
-		    			<a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e( 'Cancel', 'lasso' );?></a>
340
-		    			<a href="#" title="<?php esc_attr_e( 'Insert HTML or Code', 'lasso' );?>" class="lasso-toolbar--html__control" id="lasso-toolbar--html__insert" ><?php _e( 'Insert', 'lasso' );?></a>
339
+		    			<a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e('Cancel', 'lasso'); ?></a>
340
+		    			<a href="#" title="<?php esc_attr_e('Insert HTML or Code', 'lasso'); ?>" class="lasso-toolbar--html__control" id="lasso-toolbar--html__insert" ><?php _e('Insert', 'lasso'); ?></a>
341 341
 		    		</div>
342 342
 		    	</div>
343 343
 		    </li>
344
-			<?php if ( $show_align ): ?>
345
-		    <li id="lasso-toolbar--left-align" title="<?php esc_attr_e( 'Text Left Align', 'lasso' );?>"></li>
346
-		    <li id="lasso-toolbar--center-align" title="<?php esc_attr_e( 'Text Center Align', 'lasso' );?>"></li>
347
-			<li id="lasso-toolbar--right-align" title="<?php esc_attr_e( 'Text Right Align', 'lasso' );?>"></li>
344
+			<?php if ($show_align): ?>
345
+		    <li id="lasso-toolbar--left-align" title="<?php esc_attr_e('Text Left Align', 'lasso'); ?>"></li>
346
+		    <li id="lasso-toolbar--center-align" title="<?php esc_attr_e('Text Center Align', 'lasso'); ?>"></li>
347
+			<li id="lasso-toolbar--right-align" title="<?php esc_attr_e('Text Right Align', 'lasso'); ?>"></li>
348 348
 			<?php endif; ?>
349 349
 		</ul>
350
-		<?php if ( is_singular() && $is_mobile ) { ?>
350
+		<?php if (is_singular() && $is_mobile) { ?>
351 351
 
352
-				<div class="lasso--controls__right" data-posttype="<?php echo get_post_type( get_the_ID() );?>" data-status="<?php echo $status;?>" style="position:static;bottom:0px;right;0px;left:auto;">
352
+				<div class="lasso--controls__right" data-posttype="<?php echo get_post_type(get_the_ID()); ?>" data-status="<?php echo $status; ?>" style="position:static;bottom:0px;right;0px;left:auto;">
353 353
 
354
-					<a href="#" title="<?php esc_attr_e( 'Delete Post', 'lasso' );?>" id="lasso--post-delete" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a>
355
-					<a href="#" title="<?php esc_attr_e( 'Post Settings', 'lasso' );?>" id="lasso--post-settings2" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a>
354
+					<a href="#" title="<?php esc_attr_e('Delete Post', 'lasso'); ?>" id="lasso--post-delete" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a>
355
+					<a href="#" title="<?php esc_attr_e('Post Settings', 'lasso'); ?>" id="lasso--post-settings2" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a>
356 356
 
357
-					<a href="#" title="<?php esc_attr_e( 'Save Post', 'lasso' );?>" id="lasso--save" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a>
357
+					<a href="#" title="<?php esc_attr_e('Save Post', 'lasso'); ?>" id="lasso--save" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a>
358 358
 
359
-					<?php if ( 'draft' == $status && ( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') )  ) { ?>
360
-						<a href="#" title="<?php esc_attr_e( 'Publish Post', 'lasso' );?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class;?>"></a>
359
+					<?php if ('draft' == $status && (lasso_user_can('publish_posts') || lasso_user_can('publish_pages'))) { ?>
360
+						<a href="#" title="<?php esc_attr_e('Publish Post', 'lasso'); ?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class; ?>"></a>
361 361
 					<?php } ?>
362 362
 
363 363
 				</div>
@@ -375,20 +375,20 @@  discard block
 block discarded – undo
375 375
  */
376 376
 function lasso_editor_settings_toolbar() {
377 377
 
378
-	$delete_nonce = wp_create_nonce( 'lasso-delete-nonce' );
378
+	$delete_nonce = wp_create_nonce('lasso-delete-nonce');
379 379
 
380 380
 	ob_start();
381 381
 
382 382
 
383 383
 	// let users add custom css classes
384
-	$custom_classes = apply_filters( 'lasso_component_classes', '' );
384
+	$custom_classes = apply_filters('lasso_component_classes', '');
385 385
 
386 386
 	?>
387
-	<ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false">
388
-		<li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li>
389
-		<li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li>
390
-		<li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li>
391
-		<li class="lasso-delete" data-postid="<?php echo get_the_ID();?>" data-nonce="<?php echo $delete_nonce;?>" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li>
387
+	<ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false">
388
+		<li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li>
389
+		<li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li>
390
+		<li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li>
391
+		<li class="lasso-delete" data-postid="<?php echo get_the_ID(); ?>" data-nonce="<?php echo $delete_nonce; ?>" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li>
392 392
 	</ul>
393 393
 
394 394
 	<?php return ob_get_clean();
@@ -406,13 +406,13 @@  discard block
 block discarded – undo
406 406
 
407 407
 
408 408
 	// has post thumbnail
409
-	$has_thumbnail = has_post_thumbnail( get_the_ID() ) ? 'class="lasso--featImg--has-thumb"' : false;
409
+	$has_thumbnail = has_post_thumbnail(get_the_ID()) ? 'class="lasso--featImg--has-thumb"' : false;
410 410
 
411 411
 	?>
412
-	<ul id="lasso--featImgControls" <?php echo $has_thumbnail;?>>
413
-		<li id="lasso--featImgUpload"><a title="<?php esc_attr_e( 'Replace Image', 'lasso' );?>" href="#"><i class="lasso-icon-image"></i></a></li>
414
-		<li id="lasso--featImgDelete"><a title="<?php esc_attr_e( 'Delete Image', 'lasso' );?>" href="#"><i class="lasso-icon-bin2"></i></a></li>
415
-		<li id="lasso--featImgSave"><a href="#"><?php esc_attr_e( 'save', 'lasso' );?></a></li>
412
+	<ul id="lasso--featImgControls" <?php echo $has_thumbnail; ?>>
413
+		<li id="lasso--featImgUpload"><a title="<?php esc_attr_e('Replace Image', 'lasso'); ?>" href="#"><i class="lasso-icon-image"></i></a></li>
414
+		<li id="lasso--featImgDelete"><a title="<?php esc_attr_e('Delete Image', 'lasso'); ?>" href="#"><i class="lasso-icon-bin2"></i></a></li>
415
+		<li id="lasso--featImgSave"><a href="#"><?php esc_attr_e('save', 'lasso'); ?></a></li>
416 416
 	</ul>
417 417
 
418 418
 	<?php return ob_get_clean();
@@ -436,55 +436,55 @@  discard block
 block discarded – undo
436 436
 
437 437
 	$postid = get_the_ID();
438 438
 
439
-	$status = get_post_status( $postid );
440
-	$nonce = wp_create_nonce( 'lasso-update-post-settings' );
439
+	$status = get_post_status($postid);
440
+	$nonce = wp_create_nonce('lasso-update-post-settings');
441 441
 
442 442
 	// let users add custom css classes
443
-	$custom_classes = apply_filters( 'lasso_modal_settings_classes', '' );
443
+	$custom_classes = apply_filters('lasso_modal_settings_classes', '');
444 444
 
445 445
 	// objects categories
446
-	$categories 		= lasso_get_post_objects( $postid, 'category' );
447
-	$tags 				= lasso_get_post_objects( $postid, 'tag' );
446
+	$categories = lasso_get_post_objects($postid, 'category');
447
+	$tags = lasso_get_post_objects($postid, 'tag');
448 448
 
449 449
 	// modal tabs
450
-	$tabs  				= lasso_modal_addons('tab');
451
-	$content 			= lasso_modal_addons('content');
450
+	$tabs = lasso_modal_addons('tab');
451
+	$content = lasso_modal_addons('content');
452 452
 	
453 453
 	//editor options
454 454
 	$allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor');
455 455
 	$no_url_setting = lasso_editor_get_option('no_url_setting', 'lasso_editor');
456 456
 
457 457
 	// are we singular
458
-	$is_singular 		= is_singular();
458
+	$is_singular = is_singular();
459 459
 	$is_singular_class 	= $is_singular ? 'lasso--postsettings__2col' : 'lasso--postsettings__1col';
460 460
 	$has_thumb_class    = has_post_thumbnail() ? 'has-thumbnail' : 'no-thumbnail';
461 461
 	$theme_supports     = current_theme_supports('post-thumbnails');
462
-	$default_image 		= LASSO_URL.'/admin/assets/img/empty-img.png';
462
+	$default_image = LASSO_URL.'/admin/assets/img/empty-img.png';
463 463
 	
464 464
 	// do we support pending status
465 465
 	$no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor');
466 466
 
467 467
 ?>
468
-	<div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>">
468
+	<div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>">
469 469
 		<div class="lasso--modal__inner">
470 470
 
471
-			<?php if( $tabs ) { echo $tabs; } ?>
471
+			<?php if ($tabs) { echo $tabs; } ?>
472 472
 
473 473
 			<div class="lasso--modal__content modal__content--core visible" data-addon-content="core">
474
-				<form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class;?>" >
474
+				<form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class; ?>" >
475 475
 
476
-					<?php if ( $is_singular && $theme_supports ) : ?>
476
+					<?php if ($is_singular && $theme_supports) : ?>
477 477
 					<div class="lasso--postsettings__left">
478
-						<label><?php _e( 'Featured Image', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Change the featured image for this post.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label>
479
-						<div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url( $default_image );?>">
478
+						<label><?php _e('Featured Image', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Change the featured image for this post.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label>
479
+						<div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url($default_image); ?>">
480 480
 
481 481
 							<div id="lasso--post-thumb__controls" class="lasso--post-thumb__controls">
482
-								<i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image','lasso');?>" class="dashicons dashicons-edit"></i>
483
-								<i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image','lasso');?>" class="dashicons dashicons-no-alt"></i>
482
+								<i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image', 'lasso'); ?>" class="dashicons dashicons-edit"></i>
483
+								<i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image', 'lasso'); ?>" class="dashicons dashicons-no-alt"></i>
484 484
 								<i id="lasso--save-status" class="lasso-icon lasso-icon-spinner6 not-visible"></i>
485 485
 							</div>
486 486
 
487
-							<?php echo has_post_thumbnail() ? get_the_post_thumbnail( $post->ID, 'medium' ) : '<img src="'.$default_image.'">'; ?>
487
+							<?php echo has_post_thumbnail() ? get_the_post_thumbnail($post->ID, 'medium') : '<img src="'.$default_image.'">'; ?>
488 488
 
489 489
 						</div>
490 490
 						<div id="lasso--featImgSave"><a href="#" class="not-visible">Save</a></div>
@@ -494,15 +494,15 @@  discard block
 block discarded – undo
494 494
 
495 495
 					<div class="lasso--postsettings__right">
496 496
 
497
-						<?php if( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ): ?>
497
+						<?php if (lasso_user_can('publish_posts') || lasso_user_can('publish_pages')): ?>
498 498
 						<div class="lasso--postsettings__option story-status-option">
499
-							<label><?php _e( 'Status', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Change the status of the post to draft or publish.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label>
500
-							<ul class="story-status story-status-<?php echo sanitize_html_class( $status );?>">
501
-								<li id="lasso--status-draft"><?php _e( 'Draft', 'lasso' );?></li>
502
-								<?php if( !$no_pending_status ): ?>								
503
-								<li id="lasso--status-pending"><?php _e( 'Pending', 'lasso' );?></li>
499
+							<label><?php _e('Status', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Change the status of the post to draft or publish.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label>
500
+							<ul class="story-status story-status-<?php echo sanitize_html_class($status); ?>">
501
+								<li id="lasso--status-draft"><?php _e('Draft', 'lasso'); ?></li>
502
+								<?php if (!$no_pending_status): ?>								
503
+								<li id="lasso--status-pending"><?php _e('Pending', 'lasso'); ?></li>
504 504
 								<?php endif; ?>
505
-								<li id="lasso--status-publish"><?php _e( 'Publish', 'lasso' );?></li>
505
+								<li id="lasso--status-publish"><?php _e('Publish', 'lasso'); ?></li>
506 506
 							</ul>
507 507
 							<div class="lasso--slider_wrap">
508 508
 								<div id="lasso--slider"></div>
@@ -510,10 +510,10 @@  discard block
 block discarded – undo
510 510
 						</div>
511 511
 						<?php endif; ?>
512 512
 
513
-						<?php if ( 'publish' == $status  && !$no_url_setting): ?>
513
+						<?php if ('publish' == $status && !$no_url_setting): ?>
514 514
 						<div class="lasso--postsettings__option story-slug-option">
515
-							<label><?php _e( 'Post URL', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Change the URL (slug) of this post.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label>
516
-							<input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset( $post ) ? esc_attr( $post->post_name ) : false;?>">
515
+							<label><?php _e('Post URL', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Change the URL (slug) of this post.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label>
516
+							<input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset($post) ? esc_attr($post->post_name) : false; ?>">
517 517
 						</div>
518 518
 						<?php endif; ?>
519 519
 
@@ -522,21 +522,21 @@  discard block
 block discarded – undo
522 522
 					<div class="lasso--postsettings__middle">
523 523
 
524 524
 						<div class="lasso--postsettings__option story-categories-option">
525
-							<label style="width:120px;"><?php _e( 'Categories', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Type a category name and press enter.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label>
526
-							<input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories;?>">
525
+							<label style="width:120px;"><?php _e('Categories', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Type a category name and press enter.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label>
526
+							<input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories; ?>">
527 527
 						</div>
528 528
 
529 529
 						<div class="lasso--postsettings__option story-tags-option">
530
-							<label><?php _e( 'Tags', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Type a tag name and press enter.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label>
531
-							<input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags;?>">
530
+							<label><?php _e('Tags', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Type a tag name and press enter.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label>
531
+							<input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags; ?>">
532 532
 						</div>
533 533
 						<?php 
534 534
 						if ($allow_change_date) { 
535
-						    $dateformat = get_option( 'date_format' ); 
535
+						    $dateformat = get_option('date_format'); 
536 536
 						?>
537
-						    <label><?php _e( 'Post Date', 'lasso' ); ?></label>
538
-							<input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/>
539
-							<a href="#" id="lasso--postsettings-setnow"><?php _e( 'Set to Now', 'lasso' ); ?></a>
537
+						    <label><?php _e('Post Date', 'lasso'); ?></label>
538
+							<input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid); ?>"/>
539
+							<a href="#" id="lasso--postsettings-setnow"><?php _e('Set to Now', 'lasso'); ?></a>
540 540
 						<?php
541 541
 						}?>
542 542
 
@@ -558,23 +558,23 @@  discard block
 block discarded – undo
558 558
 					?>
559 559
 					<!--/div-->
560 560
 
561
-					<?php do_action( 'lasso_modal_post_form' ); // action ?>
561
+					<?php do_action('lasso_modal_post_form'); // action ?>
562 562
 
563 563
 					<div class="lasso--postsettings__footer" >
564
-						<a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a>
564
+						<a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a>
565 565
 						<input type="hidden" name="status" value="">
566 566
 						<input type="hidden" name="categories" value="">
567
-						<input type="hidden" name="postid" value="<?php echo get_the_ID();?>">
567
+						<input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>">
568 568
 						<input type="hidden" name="action" value="process_update-object_post">
569
-						<input type="hidden" name="nonce" value="<?php echo $nonce;?>">
570
-						<?php do_action( 'lasso_modal_post_form_footer' ); // action ?>
571
-						<input type="submit" id="lasso--postsettings-submit" value="<?php esc_attr_e( 'Save', 'lasso' );?>">
569
+						<input type="hidden" name="nonce" value="<?php echo $nonce; ?>">
570
+						<?php do_action('lasso_modal_post_form_footer'); // action ?>
571
+						<input type="submit" id="lasso--postsettings-submit" value="<?php esc_attr_e('Save', 'lasso'); ?>">
572 572
 					</div>
573 573
 
574 574
 				</form>
575 575
 			</div>
576 576
 
577
-			<?php if( $tabs ) { echo $content; } ?>
577
+			<?php if ($tabs) { echo $content; } ?>
578 578
 
579 579
 		</div>
580 580
 
@@ -596,41 +596,41 @@  discard block
 block discarded – undo
596 596
 	ob_start();
597 597
 
598 598
 
599
-	$status = get_post_status( get_the_ID() );
599
+	$status = get_post_status(get_the_ID());
600 600
 
601
-	$nonce = wp_create_nonce( 'lasso-editor-new-post' );
601
+	$nonce = wp_create_nonce('lasso-editor-new-post');
602 602
 
603 603
 	// let users add custom css classes
604
-	$custom_classes = apply_filters( 'lasso_modal_post_classes', '' );
604
+	$custom_classes = apply_filters('lasso_modal_post_classes', '');
605 605
 
606 606
 	// return the post type
607
-	$type = get_post_type( get_the_ID() );
607
+	$type = get_post_type(get_the_ID());
608 608
 
609 609
 	$mobile_style = "";
610 610
 	if (wp_is_mobile()) {
611 611
 		$mobile_style = 'style="top:140px !important;"';
612 612
 	}
613 613
 	?>
614
-	<div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style;?>">
614
+	<div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" <?php echo $mobile_style; ?>">
615 615
 		<div class="lasso--modal__inner lasso--hasnewform">
616 616
 
617 617
 			<form id="lasso--postnew__form" enctype="multipart/form-data" class="lasso--post-form">
618 618
 
619 619
 				<div class="lasso--postsettings__option story-slug-option lasso--last-option">
620
-					<label><?php esc_attr_e( 'New <span>post</span> title', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Specify title for new post, then save to edit.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label>
621
-					<input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e( 'Type Your Title Here', 'lasso' );?>">
620
+					<label><?php esc_attr_e('New <span>post</span> title', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Specify title for new post, then save to edit.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label>
621
+					<input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e('Type Your Title Here', 'lasso'); ?>">
622 622
 						<div class="lasso--select-wrap" style="width:90px">
623 623
 						<select id="lasso--select-type" name="story_type">
624 624
 
625 625
 							<?php
626 626
 								$types = lasso_post_types_names();
627
-								if ( !empty( $types ) ) {
628
-									foreach( $types as $name => $label ) {										
629
-										$type = preg_replace( '/s\b/','', $name );
627
+								if (!empty($types)) {
628
+									foreach ($types as $name => $label) {										
629
+										$type = preg_replace('/s\b/', '', $name);
630 630
 										if ($type == 'page' && !current_user_can('edit_pages')) {
631 631
 											continue;
632 632
 										}
633
-										printf( '<option value="%s">%s</option>', lcfirst( esc_attr( $type ) ) , ucfirst( esc_attr( $label ) ) );
633
+										printf('<option value="%s">%s</option>', lcfirst(esc_attr($type)), ucfirst(esc_attr($label)));
634 634
 									}
635 635
 
636 636
 								}
@@ -641,19 +641,19 @@  discard block
 block discarded – undo
641 641
 				</div>
642 642
 
643 643
 				<div class="lasso--postsettings__footer">
644
-					<a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a>
644
+					<a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a>
645 645
 					<input type="hidden" name="action" value="process_new-object_post">
646 646
 					<?php
647
-						if ( !empty( $types ) ) {
647
+						if (!empty($types)) {
648 648
 							// get the first element
649 649
 							$keys = array_keys($types);
650
-						    $type =$keys[0];						
651
-							$type = preg_replace( '/s\b/','', $type );
652
-							printf( '<input type="hidden" name="object" value="%s">', lcfirst( esc_attr( $type ) ) );		
650
+						    $type = $keys[0];						
651
+							$type = preg_replace('/s\b/', '', $type);
652
+							printf('<input type="hidden" name="object" value="%s">', lcfirst(esc_attr($type)));		
653 653
 						}
654 654
 					?>
655
-					<input type="hidden" name="nonce" value="<?php echo $nonce;?>">
656
-					<input type="submit" value="<?php esc_attr_e( 'Create', 'lasso' );?>">
655
+					<input type="hidden" name="nonce" value="<?php echo $nonce; ?>">
656
+					<input type="submit" value="<?php esc_attr_e('Create', 'lasso'); ?>">
657 657
 				</div>
658 658
 
659 659
 			</form>
@@ -681,18 +681,18 @@  discard block
 block discarded – undo
681 681
 	ob_start();
682 682
 
683 683
 	// post status
684
-	$status = get_post_status( get_the_ID() );
684
+	$status = get_post_status(get_the_ID());
685 685
 
686 686
 	// let users add custom css classes
687
-	$custom_classes = apply_filters( 'lasso_modal_all_post_classes', '' );
687
+	$custom_classes = apply_filters('lasso_modal_all_post_classes', '');
688 688
 
689 689
 	?>
690
-	<div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" style="max-height:100%">
690
+	<div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" style="max-height:100%">
691 691
 		<div class="lasso--modal__inner">
692 692
 
693 693
 			<div class="lasso--post-filtering not-visible">
694 694
 				<div class="lasso--search__results">
695
-					<span id="lasso--results-found"></span><?php _e('results found','lasso');?>
695
+					<span id="lasso--results-found"></span><?php _e('results found', 'lasso'); ?>
696 696
 				</div>
697 697
 				<div class="lasso--search">
698 698
 					<i id="lasso--search__toggle" class="dashicons dashicons-search"></i>
@@ -706,18 +706,18 @@  discard block
 block discarded – undo
706 706
 				$post_types = lasso_post_types_names();
707 707
 				$rest_bases = lasso_post_types_rest_base();
708 708
 
709
-				if ( ! empty( $post_types ) ) {
709
+				if (!empty($post_types)) {
710 710
 					$first = 'active';
711
-					foreach( $post_types as $name => $label ) {
711
+					foreach ($post_types as $name => $label) {
712 712
 						if (array_key_exists($name, $rest_bases)) {
713
-							printf( '<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr( $first), esc_attr( $rest_bases[$name] ), esc_attr( $label ) );
713
+							printf('<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr($first), esc_attr($rest_bases[$name]), esc_attr($label));
714 714
 						}
715 715
 						$first = '';
716 716
 					}
717 717
 
718 718
 				}
719 719
 
720
-				do_action('lasso_modal_post_objects');?>
720
+				do_action('lasso_modal_post_objects'); ?>
721 721
 
722 722
 			</ul>
723 723
 			<div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div>
@@ -737,14 +737,14 @@  discard block
 block discarded – undo
737 737
 
738 738
 
739 739
 	// let users add custom css classes
740
-	$custom_classes = apply_filters( 'lasso_wpimg_classes', '' );
740
+	$custom_classes = apply_filters('lasso_wpimg_classes', '');
741 741
 
742 742
 	?>
743
-	<ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false">
744
-		<li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li>
745
-		<li id="lasso--wpimg-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li>
746
-		<li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li>
747
-		<li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li>
743
+	<ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false">
744
+		<li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li>
745
+		<li id="lasso--wpimg-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li>
746
+		<li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li>
747
+		<li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li>
748 748
 	</ul>
749 749
 
750 750
 	<?php return ob_get_clean();
@@ -756,14 +756,14 @@  discard block
 block discarded – undo
756 756
 
757 757
 
758 758
 	// let users add custom css classes
759
-	$custom_classes = apply_filters( 'lasso_wpimg_classes', '' );
759
+	$custom_classes = apply_filters('lasso_wpimg_classes', '');
760 760
 
761 761
 	?>
762
-	<ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false">
763
-		<li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li>
764
-		<li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li>
765
-		<li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li>
766
-		<li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li>
762
+	<ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false">
763
+		<li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li>
764
+		<li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li>
765
+		<li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li>
766
+		<li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li>
767 767
 	</ul>
768 768
 
769 769
 	<?php return ob_get_clean();
@@ -776,16 +776,16 @@  discard block
 block discarded – undo
776 776
  */
777 777
 function lasso_map_form_footer() {
778 778
 
779
-	$nonce = wp_create_nonce( 'lasso-process-map' );
779
+	$nonce = wp_create_nonce('lasso-process-map');
780 780
 
781 781
 	ob_start();
782 782
 
783 783
 	?>
784 784
 	<div class="lasso--map-form__footer">
785
-		<input type="hidden" name="postid" value="<?php echo get_the_ID();?>">
786
-		<input type="hidden" name="nonce" value="<?php echo $nonce;?>">
785
+		<input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>">
786
+		<input type="hidden" name="nonce" value="<?php echo $nonce; ?>">
787 787
 		<input type="hidden" name="action" value="process_map_save">
788
-		<input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e( 'Save Locations', 'lasso' );?>">
788
+		<input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e('Save Locations', 'lasso'); ?>">
789 789
 	</div>
790 790
 
791 791
 	<?php return ob_get_clean();
@@ -803,7 +803,7 @@  discard block
 block discarded – undo
803 803
 
804 804
 	?>
805 805
 	<div id="lasso--pagerefresh" class="visible">
806
-		<?php _e( 'Save this post and refesh the page to see these changes.', 'lasso' );?>
806
+		<?php _e('Save this post and refesh the page to see these changes.', 'lasso'); ?>
807 807
 	</div>
808 808
 
809 809
 	<?php return ob_get_clean();
@@ -817,43 +817,43 @@  discard block
 block discarded – undo
817 817
  */
818 818
 function lasso_editor_options_blob() {
819 819
 
820
-	$codes   = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : apply_filters( 'lasso_custom_options', '' );
821
-	$galleries  = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery';
820
+	$codes = function_exists('aesop_shortcodes') ? aesop_shortcodes() : apply_filters('lasso_custom_options', '');
821
+	$galleries = function_exists('lasso_editor_galleries_exist') && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery';
822 822
 
823
-	$nonce = wp_create_nonce( 'lasso_gallery' );
823
+	$nonce = wp_create_nonce('lasso_gallery');
824 824
 
825 825
 	$blob = array();
826 826
 
827
-	if ( empty( $codes ) )
827
+	if (empty($codes))
828 828
 		return;
829 829
 
830
-	foreach ( $codes as $slug => $shortcode ) {
830
+	foreach ($codes as $slug => $shortcode) {
831 831
 		$return = '';
832 832
 		// Shortcode has atts
833 833
 
834
-		if ( count( $shortcode['atts'] ) && $shortcode['atts'] ) {
834
+		if (count($shortcode['atts']) && $shortcode['atts']) {
835 835
 
836
-			foreach ( $shortcode['atts'] as $attr_name => $attr_info ) {
836
+			foreach ($shortcode['atts'] as $attr_name => $attr_info) {
837 837
 
838 838
 
839
-				$prefix = isset( $attr_info['prefix'] ) ? sprintf( '<span class="lasso-option-prefix">%s</span>', $attr_info['prefix'] ) : null;
839
+				$prefix = isset($attr_info['prefix']) ? sprintf('<span class="lasso-option-prefix">%s</span>', $attr_info['prefix']) : null;
840 840
 
841 841
 				$return .= '<form id="aesop-generator-settings" class="lasso--component-settings-form" class="'.$galleries.'" method="post">';
842 842
 				$return .= '<p data-option="'.$attr_name.'" class="lasso-option aesop-'.$slug.'-'.$attr_name.'">';
843
-				$return .= '<label for="aesop-generator-attr-' . $attr_name . '">' . $attr_info['desc'] . '</label>';
843
+				$return .= '<label for="aesop-generator-attr-'.$attr_name.'">'.$attr_info['desc'].'</label>';
844 844
 				$return .= '<small class="lasso-option-desc">'.$attr_info['tip'].'</small>';
845 845
 				// Select
846 846
 
847
-				if ( isset( $attr_info['values'] ) ) {
847
+				if (isset($attr_info['values'])) {
848 848
 
849
-					$return .= '<select name="' . $attr_name . '" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr">';
849
+					$return .= '<select name="'.$attr_name.'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr">';
850 850
 
851
-					$i=0;
851
+					$i = 0;
852 852
 
853
-					foreach ( $attr_info['values'] as $attr_value ) {
853
+					foreach ($attr_info['values'] as $attr_value) {
854 854
 						$attr_value_selected = $attr_info['default'] == $attr_value ? ' selected="selected"' : '';
855 855
 
856
-						$return .= '<option value="'.$attr_info['values'][$i]['value'].'" ' . $attr_value_selected . '>'.$attr_info['values'][$i]['name'].'</option>';
856
+						$return .= '<option value="'.$attr_info['values'][$i]['value'].'" '.$attr_value_selected.'>'.$attr_info['values'][$i]['name'].'</option>';
857 857
 
858 858
 						$i++;
859 859
 					}
@@ -862,24 +862,24 @@  discard block
 block discarded – undo
862 862
 
863 863
 				} else {
864 864
 
865
-					$attr_field_type = isset( $attr_info['type'] ) ? $attr_info['type'] : 'text';
865
+					$attr_field_type = isset($attr_info['type']) ? $attr_info['type'] : 'text';
866 866
 
867 867
 					// image upload
868
-					if ( 'media_upload' == $attr_info['type'] ) {
868
+					if ('media_upload' == $attr_info['type']) {
869 869
 
870
-						$return .= '<input type="' . $attr_field_type . '" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />';
870
+						$return .= '<input type="'.$attr_field_type.'" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />';
871 871
 						$return .= '<a href="#" id="lasso-upload-img" class="lasso-option-button" /></a>';
872 872
 
873
-					} elseif ( 'color' == $attr_info['type'] ) {
873
+					} elseif ('color' == $attr_info['type']) {
874 874
 
875
-						$return .= '<input type="color" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />';
875
+						$return .= '<input type="color" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />';
876 876
 
877
-					} elseif ( 'text_area' == $attr_info['type'] ) {
877
+					} elseif ('text_area' == $attr_info['type']) {
878 878
 
879
-						$return .= '<textarea name="' . $attr_name . '" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" placeholder="'.$attr_info['default'].'" /></textarea>'.$prefix.'';
879
+						$return .= '<textarea name="'.$attr_name.'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" placeholder="'.$attr_info['default'].'" /></textarea>'.$prefix.'';
880 880
 
881 881
 					} else {
882
-						$return .= '<input type="' . $attr_field_type . '" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'.$prefix.'';
882
+						$return .= '<input type="'.$attr_field_type.'" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'.$prefix.'';
883 883
 					}
884 884
 				}
885 885
 				$return .= '</p>';
@@ -890,9 +890,9 @@  discard block
 block discarded – undo
890 890
 		///////////////////////////
891 891
 		// START GALLERY AND MAP FRONT END STUFFS
892 892
 		///////////////////////////
893
-		if ( isset( $shortcode['front'] ) && true == $shortcode['front'] ) {
893
+		if (isset($shortcode['front']) && true == $shortcode['front']) {
894 894
 
895
-			if ( 'gallery' == $shortcode['front_type'] ) {
895
+			if ('gallery' == $shortcode['front_type']) {
896 896
 
897 897
 				$return .= lasso_gallery_editor_module();
898 898
 
@@ -903,13 +903,13 @@  discard block
 block discarded – undo
903 903
 		///////////////////////////
904 904
 
905 905
 		// Single shortcode (not closed)
906
-		if ( 'single' == $shortcode['type'] ) {
906
+		if ('single' == $shortcode['type']) {
907 907
 
908 908
 			$return .= '<input type="hidden" name="lasso-generator-content" id="lasso-generator-content" value="false" />';
909 909
 
910 910
 		} else {
911 911
 
912
-			$return .= '<p data-option="content" class="lasso-option lasso-c-comp-text"><label>' . __( 'Content', 'lasso' ) . '</label><textarea type="text" name="lasso-generator-content" id="lasso-generator-content" value="' . $shortcode['content'] . '" /></textarea></p>';
912
+			$return .= '<p data-option="content" class="lasso-option lasso-c-comp-text"><label>'.__('Content', 'lasso').'</label><textarea type="text" name="lasso-generator-content" id="lasso-generator-content" value="'.$shortcode['content'].'" /></textarea></p>';
913 913
 		}
914 914
 
915 915
 		$return .= '<p class="lasso-buttoninsert-wrap"><a href="#" class="lasso-generator-cancel" id="lasso--sidebar__close">Cancel</a><input type="submit" id="lasso-generator-insert" value="Save Settings"></p>';
@@ -945,14 +945,14 @@  discard block
 block discarded – undo
945 945
 				<div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div>
946 946
 				<div id="lasso--hide" style="display:none;" class="lasso--post-form">
947 947
 					<i class="lasso-icon lasso-icon-move"></i>
948
-					<label><?php _e( 'Revisions', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Use the slider to view the revision live on the page.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label>
948
+					<label><?php _e('Revisions', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Use the slider to view the revision live on the page.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label>
949 949
 					<div class="lasso--slider_wrap">
950 950
 						<div id="lasso--slider"></div>
951 951
 					</div>
952 952
 					<ul id="lasso--revision-list"></ul>
953 953
 					<div class="lasso--btn-group lasso--btn-group-small">
954
-						<a href="#" class="lasso--btn-secondary" id="lasso--close-modal"><?php _e( 'Cancel', 'lasso' );?></a>
955
-						<a href="#" class="lasso--btn-primary" id="lasso--select-revision"><?php _e( 'Select', 'lasso' );?></a>
954
+						<a href="#" class="lasso--btn-secondary" id="lasso--close-modal"><?php _e('Cancel', 'lasso'); ?></a>
955
+						<a href="#" class="lasso--btn-primary" id="lasso--select-revision"><?php _e('Select', 'lasso'); ?></a>
956 956
 					</div>
957 957
 				</div>
958 958
 
@@ -975,7 +975,7 @@  discard block
 block discarded – undo
975 975
     // Normalize into a six character long hex string
976 976
     $hex = str_replace('#', '', $hex);
977 977
     if (strlen($hex) == 3) {
978
-        $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2);
978
+        $hex = str_repeat(substr($hex, 0, 1), 2).str_repeat(substr($hex, 1, 1), 2).str_repeat(substr($hex, 2, 1), 2);
979 979
     }
980 980
 
981 981
     // Split into three parts: R, G and B
@@ -984,7 +984,7 @@  discard block
 block discarded – undo
984 984
 
985 985
     foreach ($color_parts as $color) {
986 986
         $color   = hexdec($color); // Convert to decimal
987
-        $color   = max(0,min(255,$color + $steps)); // Adjust color
987
+        $color   = max(0, min(255, $color + $steps)); // Adjust color
988 988
         $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code
989 989
     }
990 990
 
Please login to merge, or discard this patch.
admin/includes/load_admin.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
99 99
 
100 100
 		foreach ( $pages as $page ) {
101 101
 			wp_enqueue_media();
102
-            wp_enqueue_style( 'wp-color-picker');
103
-            wp_enqueue_script( 'wp-color-picker');
102
+			wp_enqueue_style( 'wp-color-picker');
103
+			wp_enqueue_script( 'wp-color-picker');
104 104
 		
105 105
 			wp_enqueue_script( 'lasso-editor-settings-script', LASSO_URL.'/admin/assets/js/lasso-editor-settings.js', array( 'jquery','wp-color-picker' ), LASSO_VERSION, true );
106 106
 			wp_enqueue_style( 'lasso-editor-settings-style', LASSO_URL.'/admin/assets/css/lasso-editor-settings.css', LASSO_VERSION );
@@ -131,11 +131,11 @@  discard block
 block discarded – undo
131 131
 	}
132 132
 
133 133
 	/**
134
-	*	Adds an admin notice reminding the user if their license key has not been saved
135
-	*
136
-	*	@since 0.9.7
137
-	*	@todo make dismissible
138
-	*/
134
+	 *	Adds an admin notice reminding the user if their license key has not been saved
135
+	 *
136
+	 *	@since 0.9.7
137
+	 *	@todo make dismissible
138
+	 */
139 139
 	public function license_nag(){
140 140
 
141 141
 		$screen 	= get_current_screen();
@@ -156,26 +156,26 @@  discard block
 block discarded – undo
156 156
 
157 157
 			if ( empty( $license ) ) {
158 158
 
159
-        		printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_empty, $license_link, $dismiss_link );
159
+				printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_empty, $license_link, $dismiss_link );
160 160
 
161
-        	} else if ( 'invalid' == $status ){ // license key entered wrong or something
161
+			} else if ( 'invalid' == $status ){ // license key entered wrong or something
162 162
 
163 163
 				printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_invalid, $license_link , $dismiss_link );
164 164
 
165
-        	} else if ( empty( $status ) ){ // license key saved but not activated
165
+			} else if ( empty( $status ) ){ // license key saved but not activated
166 166
 
167 167
 				printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_inactive, $license_link, $dismiss_link );
168 168
 
169
-        	}
169
+			}
170 170
 		}
171 171
 
172 172
 	}
173 173
 
174 174
 	/**
175
-	*  Process hiding the dimiss
176
-	*
177
-	* @since 0.9.7
178
-	*/
175
+	 *  Process hiding the dimiss
176
+	 *
177
+	 * @since 0.9.7
178
+	 */
179 179
 	public function dismiss_nag() {
180 180
 
181 181
 		if ( isset( $_GET['lasso-notice'] ) && 'dismiss' == $_GET['lasso-notice'] && current_user_can('manage_options') ) {
Please login to merge, or discard this patch.
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -43,23 +43,23 @@  discard block
 block discarded – undo
43 43
 		$plugin = lasso::get_instance();
44 44
 		$this->plugin_slug = $plugin->get_plugin_slug();
45 45
 
46
-		add_action( 'admin_head',  			array( $this, 'admin_assets' ) );
47
-		add_action( 'admin_notices', 		array( $this, 'license_nag' ) );
48
-		add_action( 'admin_head', 			array( $this, 'dismiss_nag' ) );
49
-		add_filter( 'plugin_row_meta',    	array( $this, 'plugin_meta' ), 10, 2 );
46
+		add_action('admin_head', array($this, 'admin_assets'));
47
+		add_action('admin_notices', array($this, 'license_nag'));
48
+		add_action('admin_head', array($this, 'dismiss_nag'));
49
+		add_filter('plugin_row_meta', array($this, 'plugin_meta'), 10, 2);
50 50
 
51
-		if ( !class_exists( 'EDD_SL_Plugin_Updater' ) ) {
51
+		if (!class_exists('EDD_SL_Plugin_Updater')) {
52 52
 			include LASSO_DIR.'admin/includes/EDD_SL_Plugin_Updater.php';
53 53
 		}
54 54
 
55
-		if ( !class_exists( 'TGM_Plugin_Activation' ) ) {
55
+		if (!class_exists('TGM_Plugin_Activation')) {
56 56
 			include LASSO_DIR.'admin/includes/class-tgm-plugin-activation.php';
57 57
 		}
58 58
 
59 59
 		new menus\welcome();
60 60
 		new menus\settings();
61 61
 
62
-		if ( !defined( 'LASSO_AGENCY_MODE' ) ) {
62
+		if (!defined('LASSO_AGENCY_MODE')) {
63 63
 			new menus\license();
64 64
 		}
65 65
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	public static function get_instance() {
76 76
 
77 77
 		// If the single instance hasn't been set, set it now.
78
-		if ( null == self::$instance ) {
78
+		if (null == self::$instance) {
79 79
 			self::$instance = new self;
80 80
 		}
81 81
 
@@ -97,13 +97,13 @@  discard block
 block discarded – undo
97 97
 			'dashboard_page_lasso-welcome-screen'
98 98
 		);
99 99
 
100
-		foreach ( $pages as $page ) {
100
+		foreach ($pages as $page) {
101 101
 			wp_enqueue_media();
102
-            wp_enqueue_style( 'wp-color-picker');
103
-            wp_enqueue_script( 'wp-color-picker');
102
+            wp_enqueue_style('wp-color-picker');
103
+            wp_enqueue_script('wp-color-picker');
104 104
 		
105
-			wp_enqueue_script( 'lasso-editor-settings-script', LASSO_URL.'/admin/assets/js/lasso-editor-settings.js', array( 'jquery','wp-color-picker' ), LASSO_VERSION, true );
106
-			wp_enqueue_style( 'lasso-editor-settings-style', LASSO_URL.'/admin/assets/css/lasso-editor-settings.css', LASSO_VERSION );
105
+			wp_enqueue_script('lasso-editor-settings-script', LASSO_URL.'/admin/assets/js/lasso-editor-settings.js', array('jquery', 'wp-color-picker'), LASSO_VERSION, true);
106
+			wp_enqueue_style('lasso-editor-settings-style', LASSO_URL.'/admin/assets/css/lasso-editor-settings.css', LASSO_VERSION);
107 107
 		}
108 108
 	}
109 109
 
@@ -116,15 +116,15 @@  discard block
 block discarded – undo
116 116
 	 *
117 117
 	 * @return array new array of links for our plugin listing on plugins.php
118 118
 	 */
119
-	public function plugin_meta( $links, $file ) {
119
+	public function plugin_meta($links, $file) {
120 120
 
121
-		if ( strpos( $file, 'lasso.php' ) !== false && !defined( 'LASSO_AGENCY_MODE' ) ) {
121
+		if (strpos($file, 'lasso.php') !== false && !defined('LASSO_AGENCY_MODE')) {
122 122
 
123 123
 			$new_links = array(
124 124
 				'<a href="http://edituswp.com/help" target="_blank">Help</a>'
125 125
 			);
126 126
 
127
-			$links = array_merge( $links, $new_links );
127
+			$links = array_merge($links, $new_links);
128 128
 		}
129 129
 
130 130
 		return $links;
@@ -136,35 +136,35 @@  discard block
 block discarded – undo
136 136
 	*	@since 0.9.7
137 137
 	*	@todo make dismissible
138 138
 	*/
139
-	public function license_nag(){
139
+	public function license_nag() {
140 140
 
141
-		$screen 	= get_current_screen();
142
-		$welcome    = 'toplevel_page_lasso-editor' == $screen->id;
143
-		$license  	= get_option( 'lasso_license_key' );
144
-		$status   	= get_option( 'lasso_license_status' );
141
+		$screen = get_current_screen();
142
+		$welcome = 'toplevel_page_lasso-editor' == $screen->id;
143
+		$license  	= get_option('lasso_license_key');
144
+		$status   	= get_option('lasso_license_status');
145 145
 
146
-		$message_empty    = apply_filters('lasso_empty_license_message','Your license key for support and automatic updates for Editus is missing!');
147
-		$message_invalid  = apply_filters('lasso_invalid_license_message','Oh snap! It looks like your Editus license key is invalid. Might check here to see if its been added correctly.');
148
-		$message_inactive  = apply_filters('lasso_inactive_license_message','It looks like your license key has not yet been activated.');
146
+		$message_empty    = apply_filters('lasso_empty_license_message', 'Your license key for support and automatic updates for Editus is missing!');
147
+		$message_invalid  = apply_filters('lasso_invalid_license_message', 'Oh snap! It looks like your Editus license key is invalid. Might check here to see if its been added correctly.');
148
+		$message_inactive = apply_filters('lasso_inactive_license_message', 'It looks like your license key has not yet been activated.');
149 149
 
150
-		$license_link 	  = sprintf('<a href="%s">Update License</a>', esc_url( add_query_arg( array( 'page' => 'lasso-license' ), admin_url('admin.php') ) ) );
151
-		$dismiss_link     = sprintf('<a style="text-decoration:none;" href="%s" id="lasso-dismiss-notice" class="notice-dismiss"><span class="screen-reader-text">%s</span></a>', esc_url( add_query_arg( 'lasso-notice', 'dismiss' ) ), __('Dismiss this notice.','lasso') );
150
+		$license_link = sprintf('<a href="%s">Update License</a>', esc_url(add_query_arg(array('page' => 'lasso-license'), admin_url('admin.php'))));
151
+		$dismiss_link     = sprintf('<a style="text-decoration:none;" href="%s" id="lasso-dismiss-notice" class="notice-dismiss"><span class="screen-reader-text">%s</span></a>', esc_url(add_query_arg('lasso-notice', 'dismiss')), __('Dismiss this notice.', 'lasso'));
152 152
 
153
-		$not_hidden       = get_user_meta( get_current_user_ID(), 'lasso_license_nag_dismissed', true );
153
+		$not_hidden       = get_user_meta(get_current_user_ID(), 'lasso_license_nag_dismissed', true);
154 154
 
155
-		if ( current_user_can('manage_options') && !$welcome && !defined( 'LASSO_AGENCY_MODE') && !$not_hidden ) {
155
+		if (current_user_can('manage_options') && !$welcome && !defined('LASSO_AGENCY_MODE') && !$not_hidden) {
156 156
 
157
-			if ( empty( $license ) ) {
157
+			if (empty($license)) {
158 158
 
159
-        		printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_empty, $license_link, $dismiss_link );
159
+        		printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_empty, $license_link, $dismiss_link);
160 160
 
161
-        	} else if ( 'invalid' == $status ){ // license key entered wrong or something
161
+        	} else if ('invalid' == $status) { // license key entered wrong or something
162 162
 
163
-				printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_invalid, $license_link , $dismiss_link );
163
+				printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_invalid, $license_link, $dismiss_link);
164 164
 
165
-        	} else if ( empty( $status ) ){ // license key saved but not activated
165
+        	} else if (empty($status)) { // license key saved but not activated
166 166
 
167
-				printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_inactive, $license_link, $dismiss_link );
167
+				printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_inactive, $license_link, $dismiss_link);
168 168
 
169 169
         	}
170 170
 		}
@@ -178,8 +178,8 @@  discard block
 block discarded – undo
178 178
 	*/
179 179
 	public function dismiss_nag() {
180 180
 
181
-		if ( isset( $_GET['lasso-notice'] ) && 'dismiss' == $_GET['lasso-notice'] && current_user_can('manage_options') ) {
182
-			update_user_meta( get_current_user_id(), 'lasso_license_nag_dismissed', 1 );
181
+		if (isset($_GET['lasso-notice']) && 'dismiss' == $_GET['lasso-notice'] && current_user_can('manage_options')) {
182
+			update_user_meta(get_current_user_id(), 'lasso_license_nag_dismissed', 1);
183 183
 		}
184 184
 	}
185 185
 }
Please login to merge, or discard this patch.
public/includes/lasso.php 4 patches
Doc Comments   +7 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 	 *
81 81
 	 * @since    0.0.1
82 82
 	 *
83
-	 * @return    Plugin slug variable.
83
+	 * @return    string slug variable.
84 84
 	 */
85 85
 	public function get_plugin_slug() {
86 86
 		return $this->plugin_slug;
@@ -338,6 +338,9 @@  discard block
 block discarded – undo
338 338
 		exit;
339 339
 	}
340 340
 	
341
+	/**
342
+	 * @param string $type
343
+	 */
341 344
 	public static function enable_metasave($type)
342 345
 	{
343 346
 		register_rest_field( $type, 'metadata', array(
@@ -526,6 +529,9 @@  discard block
 block discarded – undo
526 529
 		return self::$revisions;
527 530
 	}*/
528 531
 	
532
+	/**
533
+	 * @param string $taxonomy
534
+	 */
529 535
 	public function set_post_terms( $postid, $value, $taxonomy ) {
530 536
 		if( $value ) {
531 537
 			$value = explode( ',', $value );
Please login to merge, or discard this patch.
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 		add_action( 'wp_ajax_editus_featured_img',     array( $this, 'set_featured_img' ) );
69 69
 		add_action( 'wp_ajax_editus_del_featured_img',     array( $this, 'del_featured_img' ) );
70 70
         
71
-        add_action( 'wp_ajax_editus_publish_post',     array( $this, 'publish_post' ) );
71
+		add_action( 'wp_ajax_editus_publish_post',     array( $this, 'publish_post' ) );
72 72
 
73 73
 		// enable saving custom fields through REST API
74 74
 		self::enable_metasave('post');
@@ -268,14 +268,14 @@  discard block
 block discarded – undo
268 268
 		$out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' );
269 269
 	}
270 270
 	
271
-    // new ajax function to lock post for editing
271
+	// new ajax function to lock post for editing
272 272
 	public function editus_lock_post()
273 273
 	{
274 274
 		$post_id= $_POST["postid"];
275 275
 		$locked = wp_check_post_lock($post_id);
276 276
 		
277 277
 		if (!$locked) {
278
-		    wp_set_post_lock($post_id);
278
+			wp_set_post_lock($post_id);
279 279
 			echo "true";
280 280
 		} else {
281 281
 			$user_info = get_userdata($locked);
@@ -400,59 +400,59 @@  discard block
 block discarded – undo
400 400
 		 );
401 401
 		foreach ($_POST as $key => $value) {
402 402
 			if ($key !="code" && $key !="action") {
403
-			    //$shortcode = $shortcode.$key.'="'.$value.'" ';
403
+				//$shortcode = $shortcode.$key.'="'.$value.'" ';
404 404
 				$atts[$key] = $value;
405 405
 			}
406 406
 		}
407 407
 		if ($code == "aesop_video") {
408
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
409
-		    echo aesop_video_shortcode($atts);
408
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
409
+			echo aesop_video_shortcode($atts);
410 410
 		}
411 411
 		else if ($code == "aesop_image") {
412
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
413
-		    echo aesop_image_shortcode($atts);
412
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
413
+			echo aesop_image_shortcode($atts);
414 414
 		}
415 415
 		else if ($code == "aesop_quote") {
416
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
417
-		    echo aesop_quote_shortcode($atts);
416
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
417
+			echo aesop_quote_shortcode($atts);
418 418
 		}
419 419
 		else if ($code == "aesop_parallax") {
420
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
421
-		    echo aesop_parallax_shortcode($atts);
420
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
421
+			echo aesop_parallax_shortcode($atts);
422 422
 		}
423 423
 		else if ($code == "aesop_character") {
424
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
425
-		    echo aesop_character_shortcode($atts);
424
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
425
+			echo aesop_character_shortcode($atts);
426 426
 		}
427 427
 		else if ($code == "aesop_collection") {
428
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
429
-		    echo aesop_collection_shortcode($atts);
428
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
429
+			echo aesop_collection_shortcode($atts);
430 430
 		}
431 431
 		else if ($code == "aesop_chapter") {
432
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
433
-		    echo aesop_chapter_shortcode($atts);
432
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
433
+			echo aesop_chapter_shortcode($atts);
434 434
 		}
435 435
 		else if ($code == "aesop_content") {
436
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
437
-		    echo aesop_content_shortcode($atts, $atts['content_data']);
436
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
437
+			echo aesop_content_shortcode($atts, $atts['content_data']);
438 438
 		}
439 439
 		else if ($code == "aesop_gallery") {
440
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
441
-		    echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
440
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
441
+			echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
442 442
 		}
443 443
 		else if ($code == "aesop_audio") {
444
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
445
-		    echo aesop_audio_shortcode($atts);
444
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
445
+			echo aesop_audio_shortcode($atts);
446 446
 		}
447 447
 		else {
448 448
 			$code = '['.$code.' ';
449 449
 			foreach ($atts as $key => $value) {
450
-			    $code = ''.$key.'="'.$value.'" ';
450
+				$code = ''.$key.'="'.$value.'" ';
451 451
 			}
452 452
 			$code = $code.']';
453 453
 			echo do_shortcode($code);
454
-		    //require_once( ABSPATH . '/wp-content/plugins/aesop-events/public/includes/shortcode.php');
455
-		    //echo aesop_audio_shortcode($atts);
454
+			//require_once( ABSPATH . '/wp-content/plugins/aesop-events/public/includes/shortcode.php');
455
+			//echo aesop_audio_shortcode($atts);
456 456
 		}
457 457
 		
458 458
 		exit; 
@@ -492,12 +492,12 @@  discard block
 block discarded – undo
492 492
 		exit;
493 493
 	}
494 494
     
495
-    /* This function doesn't actually publish post, but should be called when a post is published */
496
-    public function publish_post( ) {
495
+	/* This function doesn't actually publish post, but should be called when a post is published */
496
+	public function publish_post( ) {
497 497
 
498 498
 		$post_id = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
499 499
         
500
-        do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) );
500
+		do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) );
501 501
 
502 502
 		exit;
503 503
 	}
@@ -555,14 +555,14 @@  discard block
 block discarded – undo
555 555
 			$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
556 556
 			
557 557
 			if ($taxonomy =='category') {
558
-                // convert from names to category ids
558
+				// convert from names to category ids
559 559
 				$cats = array();
560 560
 				foreach ($value as $cat) {
561 561
 					$cat_id = get_cat_ID($cat);
562 562
 					if ($cat_id !=0) {
563 563
 						$cats [] = $cat_id;
564 564
 					} else if ($allow_new_category) {
565
-					    $cats [] = wp_create_category($cat);
565
+						$cats [] = wp_create_category($cat);
566 566
 					}
567 567
 				}
568 568
 				$value = $cats;
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
 	public function set_date( $postid, $value) {
605 605
 		if( $value ) {
606 606
 			$value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time( 'timestamp', 1 ));
607
-            wp_update_post(
607
+			wp_update_post(
608 608
 				array (
609 609
 					'ID'            => $postid, // ID of the post to update
610 610
 					'post_date'     => date( 'Y-m-d H:i:s',  strtotime($value) ),
Please login to merge, or discard this patch.
Spacing   +116 added lines, -116 removed lines patch added patch discarded remove patch
@@ -52,23 +52,23 @@  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_lock_post',     array( $this, 'editus_lock_post' ) );
63
-		add_action( 'wp_ajax_editus_unlock_post',     array( $this, 'editus_unlock_post' ) );
64
-		add_action( 'wp_ajax_editus_hide_tour',     array( $this, 'editus_hide_tour' ) );
65
-		add_action( 'wp_ajax_editus_set_post_setting',     array( $this, 'editus_set_post_setting' ) );
66
-		add_action( 'wp_ajax_editus_get_ase_options',     array( $this, 'get_ase_options' ) );
67
-		add_action( 'wp_ajax_editus_delete_post',     array( $this, 'delete_post' ) );
68
-		add_action( 'wp_ajax_editus_featured_img',     array( $this, 'set_featured_img' ) );
69
-		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_lock_post', array($this, 'editus_lock_post'));
63
+		add_action('wp_ajax_editus_unlock_post', array($this, 'editus_unlock_post'));
64
+		add_action('wp_ajax_editus_hide_tour', array($this, 'editus_hide_tour'));
65
+		add_action('wp_ajax_editus_set_post_setting', array($this, 'editus_set_post_setting'));
66
+		add_action('wp_ajax_editus_get_ase_options', array($this, 'get_ase_options'));
67
+		add_action('wp_ajax_editus_delete_post', array($this, 'delete_post'));
68
+		add_action('wp_ajax_editus_featured_img', array($this, 'set_featured_img'));
69
+		add_action('wp_ajax_editus_del_featured_img', array($this, 'del_featured_img'));
70 70
         
71
-        add_action( 'wp_ajax_editus_publish_post',     array( $this, 'publish_post' ) );
71
+        add_action('wp_ajax_editus_publish_post', array($this, 'publish_post'));
72 72
 
73 73
 		// enable saving custom fields through REST API
74 74
 		self::enable_metasave('post');
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	public static function get_instance() {
100 100
 
101 101
 		// If the single instance hasn't been set, set it now.
102
-		if ( null == self::$instance ) {
102
+		if (null == self::$instance) {
103 103
 			self::$instance = new self;
104 104
 		}
105 105
 
@@ -116,18 +116,18 @@  discard block
 block discarded – undo
116 116
 	 *                                       WPMU is disabled or plugin is
117 117
 	 *                                       activated on an individual blog.
118 118
 	 */
119
-	public static function activate( $network_wide ) {
119
+	public static function activate($network_wide) {
120 120
 
121
-		if ( function_exists( 'is_multisite' ) && is_multisite() ) {
121
+		if (function_exists('is_multisite') && is_multisite()) {
122 122
 
123
-			if ( $network_wide  ) {
123
+			if ($network_wide) {
124 124
 
125 125
 				// Get all blog ids
126 126
 				$blog_ids = self::get_blog_ids();
127 127
 
128
-				foreach ( $blog_ids as $blog_id ) {
128
+				foreach ($blog_ids as $blog_id) {
129 129
 
130
-					switch_to_blog( $blog_id );
130
+					switch_to_blog($blog_id);
131 131
 					self::single_activate();
132 132
 				}
133 133
 
@@ -153,18 +153,18 @@  discard block
 block discarded – undo
153 153
 	 *                                       WPMU is disabled or plugin is
154 154
 	 *                                       deactivated on an individual blog.
155 155
 	 */
156
-	public static function deactivate( $network_wide ) {
156
+	public static function deactivate($network_wide) {
157 157
 
158
-		if ( function_exists( 'is_multisite' ) && is_multisite() ) {
158
+		if (function_exists('is_multisite') && is_multisite()) {
159 159
 
160
-			if ( $network_wide ) {
160
+			if ($network_wide) {
161 161
 
162 162
 				// Get all blog ids
163 163
 				$blog_ids = self::get_blog_ids();
164 164
 
165
-				foreach ( $blog_ids as $blog_id ) {
165
+				foreach ($blog_ids as $blog_id) {
166 166
 
167
-					switch_to_blog( $blog_id );
167
+					switch_to_blog($blog_id);
168 168
 					self::single_deactivate();
169 169
 
170 170
 				}
@@ -188,13 +188,13 @@  discard block
 block discarded – undo
188 188
 	 *
189 189
 	 * @param int     $blog_id ID of the new blog.
190 190
 	 */
191
-	public function activate_new_site( $blog_id ) {
191
+	public function activate_new_site($blog_id) {
192 192
 
193
-		if ( 1 !== did_action( 'wpmu_new_blog' ) ) {
193
+		if (1 !== did_action('wpmu_new_blog')) {
194 194
 			return;
195 195
 		}
196 196
 
197
-		switch_to_blog( $blog_id );
197
+		switch_to_blog($blog_id);
198 198
 		self::single_activate();
199 199
 		restore_current_blog();
200 200
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 			WHERE archived = '0' AND spam = '0'
220 220
 			AND deleted = '0'";
221 221
 
222
-		return $wpdb->get_col( $sql );
222
+		return $wpdb->get_col($sql);
223 223
 
224 224
 	}
225 225
 
@@ -230,18 +230,18 @@  discard block
 block discarded – undo
230 230
 	 */
231 231
 	private static function single_activate() {
232 232
 
233
-		$curr_version = get_option( 'lasso_version' );
233
+		$curr_version = get_option('lasso_version');
234 234
 
235 235
 		// update upgraded from
236
-		if ( $curr_version ) {
237
-			update_option( 'lasso_updated_from', $curr_version );
236
+		if ($curr_version) {
237
+			update_option('lasso_updated_from', $curr_version);
238 238
 		}
239 239
 
240 240
 		// update lasso version option
241
-		update_option( 'lasso_version', LASSO_VERSION );
241
+		update_option('lasso_version', LASSO_VERSION);
242 242
 
243 243
 		// set transietn for activation welcome
244
-		set_transient( '_lasso_welcome_redirect', true, 30 );
244
+		set_transient('_lasso_welcome_redirect', true, 30);
245 245
 
246 246
 
247 247
 	}
@@ -263,15 +263,15 @@  discard block
 block discarded – undo
263 263
 	public function load_plugin_textdomain() {
264 264
 
265 265
 		$domain = $this->plugin_slug;
266
-		$locale = apply_filters( 'plugin_locale', get_locale(), $domain );
266
+		$locale = apply_filters('plugin_locale', get_locale(), $domain);
267 267
 
268
-		$out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' );
268
+		$out = load_textdomain($domain, trailingslashit(LASSO_DIR).'languages/'.$domain.'-'.$locale.'.mo');
269 269
 	}
270 270
 	
271 271
     // new ajax function to lock post for editing
272 272
 	public function editus_lock_post()
273 273
 	{
274
-		$post_id= $_POST["postid"];
274
+		$post_id = $_POST["postid"];
275 275
 		$locked = wp_check_post_lock($post_id);
276 276
 		
277 277
 		if (!$locked) {
@@ -279,16 +279,16 @@  discard block
 block discarded – undo
279 279
 			echo "true";
280 280
 		} else {
281 281
 			$user_info = get_userdata($locked);
282
-			echo "Post opened by ".$user_info->first_name .  " " . $user_info->last_name;
282
+			echo "Post opened by ".$user_info->first_name." ".$user_info->last_name;
283 283
 		}
284 284
 		exit;
285 285
 	}
286 286
 	
287 287
 	public function editus_unlock_post()
288 288
 	{
289
-		$post_id= $_POST["postid"];
289
+		$post_id = $_POST["postid"];
290 290
 		$locked = wp_check_post_lock($post_id);
291
-		delete_post_meta( $post_id, '_edit_lock');
291
+		delete_post_meta($post_id, '_edit_lock');
292 292
 		echo "true";
293 293
 		
294 294
 		exit;
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 	{
300 300
 		$user_id = get_current_user_ID();
301 301
 				
302
-		update_user_meta( $user_id, 'lasso_hide_tour', true );
302
+		update_user_meta($user_id, 'lasso_hide_tour', true);
303 303
 		exit;
304 304
 	}
305 305
 	
@@ -310,14 +310,14 @@  discard block
 block discarded – undo
310 310
 		$data = array();
311 311
 		parse_str($_POST['data'], $data);
312 312
 		
313
-		if (!wp_verify_nonce( $data[ 'nonce' ], 'lasso-update-post-settings' )) {
313
+		if (!wp_verify_nonce($data['nonce'], 'lasso-update-post-settings')) {
314 314
 			wp_send_json_error();
315 315
 			exit;
316 316
 		}
317 317
 		
318
-		$status = isset( $data['status'] ) ? $data['status'] : false;
319
-		$postid = isset( $data['postid'] ) ? $data['postid'] : false;
320
-		$slug   = isset( $data['story_slug'] ) ? $data['story_slug'] : false;
318
+		$status = isset($data['status']) ? $data['status'] : false;
319
+		$postid = isset($data['postid']) ? $data['postid'] : false;
320
+		$slug   = isset($data['story_slug']) ? $data['story_slug'] : false;
321 321
 	
322 322
 
323 323
 		$args = array(
@@ -328,24 +328,24 @@  discard block
 block discarded – undo
328 328
 		
329 329
 		
330 330
 
331
-		wp_update_post( apply_filters( 'lasso_object_status_update_args', $args ) );
331
+		wp_update_post(apply_filters('lasso_object_status_update_args', $args));
332 332
 		
333 333
 		// update categories
334
-		$cats  = isset( $data['story_cats'] ) ? $data['story_cats'] : false;
334
+		$cats = isset($data['story_cats']) ? $data['story_cats'] : false;
335 335
 		
336
-		self::set_post_terms( $postid, $cats, 'category' );
336
+		self::set_post_terms($postid, $cats, 'category');
337 337
 		
338 338
 		// update tags
339
-		$tags = isset( $data['story_tags'] ) ? $data['story_tags'] : false;
340
-		self::set_post_terms( $postid, $tags, 'post_tag' );
339
+		$tags = isset($data['story_tags']) ? $data['story_tags'] : false;
340
+		self::set_post_terms($postid, $tags, 'post_tag');
341 341
 		
342 342
 		//update date
343
-		$date  = isset( $data['post_date'] ) ? $data['post_date'] : false;
344
-		self::set_date( $postid, $date );
343
+		$date = isset($data['post_date']) ? $data['post_date'] : false;
344
+		self::set_date($postid, $date);
345 345
 		
346
-		do_action( 'lasso_post_updated', $postid, $slug, $status, get_current_user_ID() );
347
-		$response= array(
348
-			'link'   => get_permalink($postid). (($status=='publish') ? '' : '&preview=true')
346
+		do_action('lasso_post_updated', $postid, $slug, $status, get_current_user_ID());
347
+		$response = array(
348
+			'link'   => get_permalink($postid).(($status == 'publish') ? '' : '&preview=true')
349 349
 		);
350 350
 		wp_send_json_success($response);
351 351
 		exit;
@@ -353,11 +353,11 @@  discard block
 block discarded – undo
353 353
 	
354 354
 	public static function enable_metasave($type)
355 355
 	{
356
-		register_rest_field( $type, 'metadata', array(
357
-			'get_callback' => function ( $data ) {
358
-				return get_post_meta( $data['id']);//, '', '' );
356
+		register_rest_field($type, 'metadata', array(
357
+			'get_callback' => function($data) {
358
+				return get_post_meta($data['id']); //, '', '' );
359 359
 			}, 
360
-			'update_callback' => function( $data, $post ) {
360
+			'update_callback' => function($data, $post) {
361 361
 				foreach ($data as $key => $value) {
362 362
 					update_post_meta($post->ID, $key, $value);
363 363
 				}
@@ -369,13 +369,13 @@  discard block
 block discarded – undo
369 369
 	public function editus_do_shortcode()
370 370
 	{
371 371
 		
372
-		$code= $_POST["code"];
372
+		$code = $_POST["code"];
373 373
 		$code = str_replace('\"', '"', $code);
374 374
 		
375
-		$code_wrapped = lasso_wrap_shortcodes( $code);
376
-		$out =  do_shortcode($code);
375
+		$code_wrapped = lasso_wrap_shortcodes($code);
376
+		$out = do_shortcode($code);
377 377
 		if ($out != '') {
378
-			$out =  do_shortcode($code_wrapped);
378
+			$out = do_shortcode($code_wrapped);
379 379
 			echo $out;
380 380
 			exit;
381 381
 		}
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 		/** @var \WP_Embed $wp_embed */
386 386
 		global $wp_embed;
387 387
 		$wp_embed->post_ID = $_POST["ID"];
388
-		$out =$wp_embed->run_shortcode( $code_wrapped );
388
+		$out = $wp_embed->run_shortcode($code_wrapped);
389 389
 		
390 390
 		echo $out;
391 391
 		exit;
@@ -395,53 +395,53 @@  discard block
 block discarded – undo
395 395
 	{
396 396
 		
397 397
 		
398
-		$code= $_POST["code"];
398
+		$code = $_POST["code"];
399 399
 		$atts = array(
400 400
 		 );
401 401
 		foreach ($_POST as $key => $value) {
402
-			if ($key !="code" && $key !="action") {
402
+			if ($key != "code" && $key != "action") {
403 403
 			    //$shortcode = $shortcode.$key.'="'.$value.'" ';
404 404
 				$atts[$key] = $value;
405 405
 			}
406 406
 		}
407 407
 		if ($code == "aesop_video") {
408
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
408
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
409 409
 		    echo aesop_video_shortcode($atts);
410 410
 		}
411 411
 		else if ($code == "aesop_image") {
412
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
412
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
413 413
 		    echo aesop_image_shortcode($atts);
414 414
 		}
415 415
 		else if ($code == "aesop_quote") {
416
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
416
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
417 417
 		    echo aesop_quote_shortcode($atts);
418 418
 		}
419 419
 		else if ($code == "aesop_parallax") {
420
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
420
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
421 421
 		    echo aesop_parallax_shortcode($atts);
422 422
 		}
423 423
 		else if ($code == "aesop_character") {
424
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
424
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
425 425
 		    echo aesop_character_shortcode($atts);
426 426
 		}
427 427
 		else if ($code == "aesop_collection") {
428
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
428
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
429 429
 		    echo aesop_collection_shortcode($atts);
430 430
 		}
431 431
 		else if ($code == "aesop_chapter") {
432
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
432
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
433 433
 		    echo aesop_chapter_shortcode($atts);
434 434
 		}
435 435
 		else if ($code == "aesop_content") {
436
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
436
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
437 437
 		    echo aesop_content_shortcode($atts, $atts['content_data']);
438 438
 		}
439 439
 		else if ($code == "aesop_gallery") {
440
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
441
-		    echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
440
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
441
+		    echo do_shortcode('[aesop_gallery id="'.$atts["id"].'"]');
442 442
 		}
443 443
 		else if ($code == "aesop_audio") {
444
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
444
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
445 445
 		    echo aesop_audio_shortcode($atts);
446 446
 		}
447 447
 		else {
@@ -462,20 +462,20 @@  discard block
 block discarded – undo
462 462
 	public function get_ase_options()
463 463
 	{
464 464
 		$blob = lasso_editor_options_blob();
465
-		$code= $_POST["component"];
465
+		$code = $_POST["component"];
466 466
 		echo $blob[$code];
467 467
 		exit; 
468 468
 	}
469 469
 	
470 470
 	public function delete_post( ) {
471 471
 
472
-		$postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
472
+		$postid = isset($_POST['postid']) ? $_POST['postid'] : false;
473 473
 
474 474
 		// bail out if the current user can't publish posts
475
-		if ( !lasso_user_can( 'delete_post', $postid ) )
475
+		if (!lasso_user_can('delete_post', $postid))
476 476
 			return;
477 477
 		
478
-		if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_delete_post' )) {
478
+		if (!wp_verify_nonce($_POST['nonce'], 'lasso_delete_post')) {
479 479
 			wp_send_json_error();
480 480
 			exit;
481 481
 		}
@@ -485,9 +485,9 @@  discard block
 block discarded – undo
485 485
 			'post_status' 	=> 'trash'
486 486
 		);
487 487
 
488
-		wp_update_post( apply_filters( 'lasso_object_deleted_args', $args ) );
488
+		wp_update_post(apply_filters('lasso_object_deleted_args', $args));
489 489
 
490
-		do_action( 'lasso_object_deleted', $postid, get_current_user_ID() );
490
+		do_action('lasso_object_deleted', $postid, get_current_user_ID());
491 491
 
492 492
 		exit;
493 493
 	}
@@ -495,40 +495,40 @@  discard block
 block discarded – undo
495 495
     /* This function doesn't actually publish post, but should be called when a post is published */
496 496
     public function publish_post( ) {
497 497
 
498
-		$post_id = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
498
+		$post_id = isset($_POST['postid']) ? $_POST['postid'] : false;
499 499
         
500
-        do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) );
500
+        do_action('transition_post_status', 'publish', 'draft', get_post($post_id));
501 501
 
502 502
 		exit;
503 503
 	}
504 504
 	
505 505
 	public function set_featured_img( ) {
506 506
 
507
-		$postid  	= isset( $_POST['postid'] ) ? $_POST['postid'] : false;
508
-		$image_id  	= isset( $_POST['image_id'] ) ? absint( $_POST['image_id'] ) : false;
509
-		if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_gallery' )) {
507
+		$postid = isset($_POST['postid']) ? $_POST['postid'] : false;
508
+		$image_id = isset($_POST['image_id']) ? absint($_POST['image_id']) : false;
509
+		if (!wp_verify_nonce($_POST['nonce'], 'lasso_gallery')) {
510 510
 			wp_send_json_error();
511 511
 			exit;
512 512
 		}	
513 513
 
514
-		set_post_thumbnail( $postid, $image_id );
514
+		set_post_thumbnail($postid, $image_id);
515 515
 
516
-		do_action( 'lasso_featured_image_set', $postid, $image_id, get_current_user_ID() );
516
+		do_action('lasso_featured_image_set', $postid, $image_id, get_current_user_ID());
517 517
 
518 518
 		exit;
519 519
 	}
520 520
 	
521 521
 	public function del_featured_img( ) {
522 522
 
523
-		$postid  = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
524
-		if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_gallery' )) {
523
+		$postid = isset($_POST['postid']) ? $_POST['postid'] : false;
524
+		if (!wp_verify_nonce($_POST['nonce'], 'lasso_gallery')) {
525 525
 			wp_send_json_error();
526 526
 			exit;
527 527
 		}	
528 528
 
529
-		delete_post_thumbnail( $postid );
529
+		delete_post_thumbnail($postid);
530 530
 
531
-		do_action( 'lasso_featured_image_deleted', $postid, get_current_user_ID() );
531
+		do_action('lasso_featured_image_deleted', $postid, get_current_user_ID());
532 532
 
533 533
 		exit;
534 534
 	}
@@ -549,17 +549,17 @@  discard block
 block discarded – undo
549 549
 		return self::$revisions;
550 550
 	}*/
551 551
 	
552
-	public function set_post_terms( $postid, $value, $taxonomy ) {
553
-		if( $value ) {
554
-			$value = explode( ',', $value );
555
-			$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
552
+	public function set_post_terms($postid, $value, $taxonomy) {
553
+		if ($value) {
554
+			$value = explode(',', $value);
555
+			$allow_new_category = lasso_editor_get_option('allow_new_category', 'lasso_editor');
556 556
 			
557
-			if ($taxonomy =='category') {
557
+			if ($taxonomy == 'category') {
558 558
                 // convert from names to category ids
559 559
 				$cats = array();
560 560
 				foreach ($value as $cat) {
561 561
 					$cat_id = get_cat_ID($cat);
562
-					if ($cat_id !=0) {
562
+					if ($cat_id != 0) {
563 563
 						$cats [] = $cat_id;
564 564
 					} else if ($allow_new_category) {
565 565
 					    $cats [] = wp_create_category($cat);
@@ -568,47 +568,47 @@  discard block
 block discarded – undo
568 568
 				$value = $cats;
569 569
 			}
570 570
 	
571
-			$result = wp_set_object_terms( $postid, $value, $taxonomy );
571
+			$result = wp_set_object_terms($postid, $value, $taxonomy);
572 572
 		}
573
-		else  {
573
+		else {
574 574
 			//remove all terms from post
575
-			$result = wp_set_object_terms( $postid, null, $taxonomy );
575
+			$result = wp_set_object_terms($postid, null, $taxonomy);
576 576
 		}
577 577
 
578
-		if ( ! is_wp_error( $result ) ) {
578
+		if (!is_wp_error($result)) {
579 579
 			return true;
580
-		}else{
580
+		} else {
581 581
 			return false;
582 582
 		}
583 583
 	}
584 584
 	
585
-	function getEnglishMonthName($foreignMonthName){
585
+	function getEnglishMonthName($foreignMonthName) {
586 586
 
587 587
 		  setlocale(LC_ALL, 'en_US');
588 588
 
589
-		  $month_numbers = range(1,12);
589
+		  $month_numbers = range(1, 12);
590 590
 
591
-		  foreach($month_numbers as $month)
592
-			$english_months[] = strftime('%B',mktime(0,0,0,$month,1,2011));
591
+		  foreach ($month_numbers as $month)
592
+			$english_months[] = strftime('%B', mktime(0, 0, 0, $month, 1, 2011));
593 593
 
594 594
 		  setlocale(LC_ALL, get_locale());
595 595
 
596
-		  foreach($month_numbers as $month)
597
-			$foreign_months[] = utf8_encode(strftime('%B',mktime(0,0,0,$month,1,2011)));
596
+		  foreach ($month_numbers as $month)
597
+			$foreign_months[] = utf8_encode(strftime('%B', mktime(0, 0, 0, $month, 1, 2011)));
598 598
 
599 599
 		  return str_replace($foreign_months, $english_months, $foreignMonthName);
600 600
 	}
601 601
 
602 602
 
603 603
 	
604
-	public function set_date( $postid, $value) {
605
-		if( $value ) {
606
-			$value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time( 'timestamp', 1 ));
604
+	public function set_date($postid, $value) {
605
+		if ($value) {
606
+			$value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time('timestamp', 1));
607 607
             wp_update_post(
608
-				array (
608
+				array(
609 609
 					'ID'            => $postid, // ID of the post to update
610
-					'post_date'     => date( 'Y-m-d H:i:s',  strtotime($value) ),
611
-					'post_date_gmt'     => gmdate( 'Y-m-d H:i:s',  strtotime($value) ),
610
+					'post_date'     => date('Y-m-d H:i:s', strtotime($value)),
611
+					'post_date_gmt'     => gmdate('Y-m-d H:i:s', strtotime($value)),
612 612
 				)
613 613
 			);
614 614
 		}
Please login to merge, or discard this patch.
Braces   +21 added lines, -29 removed lines patch added patch discarded remove patch
@@ -407,44 +407,34 @@  discard block
 block discarded – undo
407 407
 		if ($code == "aesop_video") {
408 408
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
409 409
 		    echo aesop_video_shortcode($atts);
410
-		}
411
-		else if ($code == "aesop_image") {
410
+		} else if ($code == "aesop_image") {
412 411
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
413 412
 		    echo aesop_image_shortcode($atts);
414
-		}
415
-		else if ($code == "aesop_quote") {
413
+		} else if ($code == "aesop_quote") {
416 414
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
417 415
 		    echo aesop_quote_shortcode($atts);
418
-		}
419
-		else if ($code == "aesop_parallax") {
416
+		} else if ($code == "aesop_parallax") {
420 417
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
421 418
 		    echo aesop_parallax_shortcode($atts);
422
-		}
423
-		else if ($code == "aesop_character") {
419
+		} else if ($code == "aesop_character") {
424 420
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
425 421
 		    echo aesop_character_shortcode($atts);
426
-		}
427
-		else if ($code == "aesop_collection") {
422
+		} else if ($code == "aesop_collection") {
428 423
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
429 424
 		    echo aesop_collection_shortcode($atts);
430
-		}
431
-		else if ($code == "aesop_chapter") {
425
+		} else if ($code == "aesop_chapter") {
432 426
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
433 427
 		    echo aesop_chapter_shortcode($atts);
434
-		}
435
-		else if ($code == "aesop_content") {
428
+		} else if ($code == "aesop_content") {
436 429
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
437 430
 		    echo aesop_content_shortcode($atts, $atts['content_data']);
438
-		}
439
-		else if ($code == "aesop_gallery") {
431
+		} else if ($code == "aesop_gallery") {
440 432
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
441 433
 		    echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
442
-		}
443
-		else if ($code == "aesop_audio") {
434
+		} else if ($code == "aesop_audio") {
444 435
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
445 436
 		    echo aesop_audio_shortcode($atts);
446
-		}
447
-		else {
437
+		} else {
448 438
 			$code = '['.$code.' ';
449 439
 			foreach ($atts as $key => $value) {
450 440
 			    $code = ''.$key.'="'.$value.'" ';
@@ -472,8 +462,9 @@  discard block
 block discarded – undo
472 462
 		$postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
473 463
 
474 464
 		// bail out if the current user can't publish posts
475
-		if ( !lasso_user_can( 'delete_post', $postid ) )
476
-			return;
465
+		if ( !lasso_user_can( 'delete_post', $postid ) ) {
466
+					return;
467
+		}
477 468
 		
478 469
 		if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_delete_post' )) {
479 470
 			wp_send_json_error();
@@ -569,15 +560,14 @@  discard block
 block discarded – undo
569 560
 			}
570 561
 	
571 562
 			$result = wp_set_object_terms( $postid, $value, $taxonomy );
572
-		}
573
-		else  {
563
+		} else  {
574 564
 			//remove all terms from post
575 565
 			$result = wp_set_object_terms( $postid, null, $taxonomy );
576 566
 		}
577 567
 
578 568
 		if ( ! is_wp_error( $result ) ) {
579 569
 			return true;
580
-		}else{
570
+		} else{
581 571
 			return false;
582 572
 		}
583 573
 	}
@@ -588,13 +578,15 @@  discard block
 block discarded – undo
588 578
 
589 579
 		  $month_numbers = range(1,12);
590 580
 
591
-		  foreach($month_numbers as $month)
592
-			$english_months[] = strftime('%B',mktime(0,0,0,$month,1,2011));
581
+		  foreach($month_numbers as $month) {
582
+		  			$english_months[] = strftime('%B',mktime(0,0,0,$month,1,2011));
583
+		  }
593 584
 
594 585
 		  setlocale(LC_ALL, get_locale());
595 586
 
596
-		  foreach($month_numbers as $month)
597
-			$foreign_months[] = utf8_encode(strftime('%B',mktime(0,0,0,$month,1,2011)));
587
+		  foreach($month_numbers as $month) {
588
+		  			$foreign_months[] = utf8_encode(strftime('%B',mktime(0,0,0,$month,1,2011)));
589
+		  }
598 590
 
599 591
 		  return str_replace($foreign_months, $english_months, $foreignMonthName);
600 592
 	}
Please login to merge, or discard this patch.
public/includes/register_meta_field.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -15,21 +15,21 @@
 block discarded – undo
15 15
 	 *
16 16
 	 * @param array $fields
17 17
 	 */
18
-	public function __construct( $fields ) {
18
+	public function __construct($fields) {
19 19
 		$this->fields = $fields;
20
-		add_filter( 'lasso_api_params', function( $params ) {
21
-			foreach( $this->fields as $field => $cbs ) {
20
+		add_filter('lasso_api_params', function($params) {
21
+			foreach ($this->fields as $field => $cbs) {
22 22
 				//$field = lasso_clean_string( $field );
23
-				$params[ 'process_meta_update' ][ $field ] = $cbs;
23
+				$params['process_meta_update'][$field] = $cbs;
24 24
 			}
25 25
 
26 26
 			return $params;
27 27
 
28 28
 		});
29 29
 
30
-		add_filter( 'lasso_meta_fields', function( $allowed ) {
30
+		add_filter('lasso_meta_fields', function($allowed) {
31 31
 
32
-			foreach( array_keys( $this->fields ) as $field  ) {
32
+			foreach (array_keys($this->fields) as $field) {
33 33
 				//$field = lasso_clean_string( $field );
34 34
 				$allowed[] = $field;
35 35
 
Please login to merge, or discard this patch.
public/includes/option-engine.php 2 patches
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -119,8 +119,9 @@  discard block
 block discarded – undo
119 119
 
120 120
 	ob_start();
121 121
 
122
-	if ( empty( $name ) || empty( $options ) || !is_array( $options ) )
123
-		return;
122
+	if ( empty( $name ) || empty( $options ) || !is_array( $options ) ) {
123
+			return;
124
+	}
124 125
 
125 126
 	$nonce = wp_create_nonce('lasso-process-post-meta');
126 127
 	$key   = sprintf('_lasso_%s_settings', $name );
@@ -198,8 +199,9 @@  discard block
 block discarded – undo
198 199
 	$before = '<div class="lasso--postsettings__option">';
199 200
 	$after 	= '</div>';
200 201
 
201
-	if ( empty( $name ) || empty( $options ) )
202
-		return;
202
+	if ( empty( $name ) || empty( $options ) ) {
203
+			return;
204
+	}
203 205
 
204 206
 	foreach ( (array) $options as $option ) {
205 207
 
@@ -225,8 +227,9 @@  discard block
 block discarded – undo
225 227
 */
226 228
 function lasso_option_engine_option( $name = '', $option = '', $type = '') {
227 229
 
228
-	if ( empty( $type ) || empty( $option ) )
229
-		return;
230
+	if ( empty( $type ) || empty( $option ) ) {
231
+			return;
232
+	}
230 233
 
231 234
 	$id = isset( $option['id'] ) ? $option['id'] : false;
232 235
 	//$id = $id ? lasso_clean_string( $id ) : false;
Please login to merge, or discard this patch.
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 *	Get an array of addon data for the settings modal
44 44
 *	@since 0.9.4
45 45
 */
46
-function lasso_get_modal_tabs(){
46
+function lasso_get_modal_tabs() {
47 47
 
48 48
 	$tabs = array();
49 49
 
@@ -60,34 +60,34 @@  discard block
 block discarded – undo
60 60
 *	@uses lasso_modal_addons_content()
61 61
 *	@since 0.9.4
62 62
 */
63
-function lasso_modal_addons( $type = 'tab' ){
63
+function lasso_modal_addons($type = 'tab') {
64 64
 
65 65
 	$tabs = lasso_get_modal_tabs();
66 66
 	$out = '';
67 67
 
68
-	if ( $tabs ):
68
+	if ($tabs):
69 69
 
70
-		if ( 'tab' == $type ) {
70
+		if ('tab' == $type) {
71 71
 
72 72
 			$out = '<ul class="lasso--modal__tabs">';
73 73
 
74 74
 				$out .= '<li class="active-tab" data-addon-name="core">Editus</li>';
75 75
 
76
-				foreach ( $tabs as $tab ) {
76
+				foreach ($tabs as $tab) {
77 77
 
78
-					if ( isset( $tab ) ) {
78
+					if (isset($tab)) {
79 79
 
80
-						$out .= lasso_modal_addons_content( $tab, $type );
80
+						$out .= lasso_modal_addons_content($tab, $type);
81 81
 					}
82 82
 				}
83 83
 
84 84
 			$out .= '</ul>';
85 85
 
86
-		} elseif ( 'content' == $type ) {
87
-			foreach ( $tabs as $tab ) {
86
+		} elseif ('content' == $type) {
87
+			foreach ($tabs as $tab) {
88 88
 
89
-				if ( isset( $tab ) ) {
90
-					$out .= lasso_modal_addons_content( $tab , $type );
89
+				if (isset($tab)) {
90
+					$out .= lasso_modal_addons_content($tab, $type);
91 91
 				}
92 92
 			}
93 93
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
 	endif;
97 97
 
98
-	return !empty( $out ) ? $out : false;
98
+	return !empty($out) ? $out : false;
99 99
 }
100 100
 
101 101
 /**
@@ -115,26 +115,26 @@  discard block
 block discarded – undo
115 115
 *	@since 0.9.5
116 116
 *	@subpackage lasso_modal_addons_content
117 117
 */
118
-function lasso_option_form( $name = '', $options = array() ){
118
+function lasso_option_form($name = '', $options = array()) {
119 119
 
120 120
 	ob_start();
121 121
 
122
-	if ( empty( $name ) || empty( $options ) || !is_array( $options ) )
122
+	if (empty($name) || empty($options) || !is_array($options))
123 123
 		return;
124 124
 
125 125
 	$nonce = wp_create_nonce('lasso-process-post-meta');
126
-	$key   = sprintf('_lasso_%s_settings', $name );
126
+	$key   = sprintf('_lasso_%s_settings', $name);
127 127
 
128
-	$out = sprintf('<form id="lasso--custom-field-form" class="lasso--post-form">' );
128
+	$out = sprintf('<form id="lasso--custom-field-form" class="lasso--post-form">');
129 129
 
130
-		$out .= lasso_option_fields( $name, $options );
131
-		$out .='<div class="form--bottom">';
132
-			$out .='<input type="submit" value="'.__( 'Save', 'lasso' ).'">';
133
-			$out .='<input type="hidden" name="tab_name" value="'.$key.'">';
134
-			$out .='<input type="hidden" name="post_id" value="'.get_the_ID().'">';
135
-			$out .='<input type="hidden" name="nonce" value="'.$nonce.'">';
136
-			$out .='<input type="hidden" name="action" value="process_meta_update">';
137
-		$out .='</div>';
130
+		$out .= lasso_option_fields($name, $options);
131
+		$out .= '<div class="form--bottom">';
132
+			$out .= '<input type="submit" value="'.__('Save', 'lasso').'">';
133
+			$out .= '<input type="hidden" name="tab_name" value="'.$key.'">';
134
+			$out .= '<input type="hidden" name="post_id" value="'.get_the_ID().'">';
135
+			$out .= '<input type="hidden" name="nonce" value="'.$nonce.'">';
136
+			$out .= '<input type="hidden" name="action" value="process_meta_update">';
137
+		$out .= '</div>';
138 138
 
139 139
 	$out .= '</form>';
140 140
 	
@@ -192,20 +192,20 @@  discard block
 block discarded – undo
192 192
 *	@since 0.9.5
193 193
 *	@subpackage lasso_modal_addons_content
194 194
 */
195
-function lasso_option_fields( $name = '', $options = array() ){
195
+function lasso_option_fields($name = '', $options = array()) {
196 196
 
197
-	$out 	= '';
197
+	$out = '';
198 198
 	$before = '<div class="lasso--postsettings__option">';
199 199
 	$after 	= '</div>';
200 200
 
201
-	if ( empty( $name ) || empty( $options ) )
201
+	if (empty($name) || empty($options))
202 202
 		return;
203 203
 
204
-	foreach ( (array) $options as $option ) {
204
+	foreach ((array) $options as $option) {
205 205
 
206
-		$type = isset( $option['type'] ) ? $option['type'] : 'text';
206
+		$type = isset($option['type']) ? $option['type'] : 'text';
207 207
 		
208
-		$out .= sprintf('%s%s%s', $before, lasso_option_engine_option( $name, $option,$type ), $after );
208
+		$out .= sprintf('%s%s%s', $before, lasso_option_engine_option($name, $option, $type), $after);
209 209
 
210 210
 	}
211 211
 	
@@ -223,44 +223,44 @@  discard block
 block discarded – undo
223 223
 *	@param $type string text, textarea, checkbox, color
224 224
 *	@since 5.0
225 225
 */
226
-function lasso_option_engine_option( $name = '', $option = '', $type = '') {
226
+function lasso_option_engine_option($name = '', $option = '', $type = '') {
227 227
 
228
-	if ( empty( $type ) || empty( $option ) )
228
+	if (empty($type) || empty($option))
229 229
 		return;
230 230
 
231
-	$id = isset( $option['id'] ) ? $option['id'] : false;
231
+	$id = isset($option['id']) ? $option['id'] : false;
232 232
 	//$id = $id ? lasso_clean_string( $id ) : false;
233 233
 
234
-	$desc = isset( $option['desc'] ) ? $option['desc'] : false;
234
+	$desc = isset($option['desc']) ? $option['desc'] : false;
235 235
 
236
-	$value = get_post_meta( get_the_id(), $option[ 'id' ], true );
236
+	$value = get_post_meta(get_the_id(), $option['id'], true);
237 237
 
238
-	switch ( $type ) {
238
+	switch ($type) {
239 239
 		case 'text':
240
-			$out = sprintf('<label for="lasso--post-option-%s">%s</label><input id="lasso--post-option-%s" class="editus-custom-field-text" name="%s" type="text" value="%s">',$id, esc_html( $desc ), $id, $id, $value );
240
+			$out = sprintf('<label for="lasso--post-option-%s">%s</label><input id="lasso--post-option-%s" class="editus-custom-field-text" name="%s" type="text" value="%s">', $id, esc_html($desc), $id, $id, $value);
241 241
 			break;
242 242
 		case 'textarea':
243
-			$out = sprintf('<label for="lasso--post-option-%s">%s</label><textarea id="lasso--post-option-%s" name="%s">%s</textarea>',$id, esc_html( $desc ), $id, $id, $value );
243
+			$out = sprintf('<label for="lasso--post-option-%s">%s</label><textarea id="lasso--post-option-%s" name="%s">%s</textarea>', $id, esc_html($desc), $id, $id, $value);
244 244
 			break;
245 245
 		case 'imgurl':
246
-			$out = sprintf('<label for="lasso--post-option-%s">%s</label><img src="%s" style="height:80px;"><input id="lasso--post-option-%s" class="editus-custom-field-text" name="%s" type="text" value="%s" style="display:none;"><div title="Replace Image"  class="editus-customtab-image-control" style="float:left;"><i class="lasso-icon-image" style="font-size:20px;padding:5px;"></i></div><div title="Remove Image"  class="editus-customtab-image-remove" style="float:left;"><i class="lasso-icon-bin2" style="font-size:20px;padding:5px;"></i></div>',$id, esc_html( $desc ), $value, $id, $id,  $value );
246
+			$out = sprintf('<label for="lasso--post-option-%s">%s</label><img src="%s" style="height:80px;"><input id="lasso--post-option-%s" class="editus-custom-field-text" name="%s" type="text" value="%s" style="display:none;"><div title="Replace Image"  class="editus-customtab-image-control" style="float:left;"><i class="lasso-icon-image" style="font-size:20px;padding:5px;"></i></div><div title="Remove Image"  class="editus-customtab-image-remove" style="float:left;"><i class="lasso-icon-bin2" style="font-size:20px;padding:5px;"></i></div>', $id, esc_html($desc), $value, $id, $id, $value);
247 247
 			break;
248 248
 		case 'checkbox':
249
-			$out = sprintf('<label for="lasso--post-option-%s" class="checkbox-control checkbox"><input id="lasso--post-option-%s" type="checkbox" name="%s" class="checkbox"><span class="control-indicator"></span>%s',$id, $id, $id ,esc_html( $desc ) );
249
+			$out = sprintf('<label for="lasso--post-option-%s" class="checkbox-control checkbox"><input id="lasso--post-option-%s" type="checkbox" name="%s" class="checkbox"><span class="control-indicator"></span>%s', $id, $id, $id, esc_html($desc));
250 250
 			break;
251 251
 		case 'dropdown':
252
-			$out = sprintf('<label for="lasso--post-option-%s">%s</label><select id="lasso--post-option-%s" name="%s">',$id, esc_html( $desc ), $id, $id);
252
+			$out = sprintf('<label for="lasso--post-option-%s">%s</label><select id="lasso--post-option-%s" name="%s">', $id, esc_html($desc), $id, $id);
253 253
 			$options = explode(";", $option['options']);
254 254
 			foreach ($options as &$opt) {
255 255
 				$opts = explode(":", $opt);
256 256
 				if ($opts[0] == $value) {
257
-					$out .= sprintf('<option value = "%s" selected>%s</option>',$opts[0], $opts[1]);
257
+					$out .= sprintf('<option value = "%s" selected>%s</option>', $opts[0], $opts[1]);
258 258
 				} else {
259
-					$out .= sprintf('<option value = "%s">%s</option>',$opts[0], $opts[1]);
259
+					$out .= sprintf('<option value = "%s">%s</option>', $opts[0], $opts[1]);
260 260
 				}
261 261
 			}
262 262
 			
263
-			$out .='</select>';
263
+			$out .= '</select>';
264 264
 			break;
265 265
 	}
266 266
 
Please login to merge, or discard this patch.
includes/process/meta.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 		 */
43 43
 		$allowed_fields = apply_filters( 'lasso_meta_fields', array() );
44 44
         
45
-        file_put_contents(WP_PLUGIN_DIR."/file1.txt", print_r($data,true));
45
+		file_put_contents(WP_PLUGIN_DIR."/file1.txt", print_r($data,true));
46 46
         
47 47
 		if ( ! empty( $allowed_fields ) ) {
48 48
 			foreach( $allowed_fields as $field ) {
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 			}
55 55
 		}
56 56
 
57
-        do_action( 'editus_after_meta_update', $post_id, $data );
57
+		do_action( 'editus_after_meta_update', $post_id, $data );
58 58
 
59 59
 
60 60
 		return true;
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
 	 *
29 29
 	 * @return bool Always returns true.
30 30
 	 */
31
-	public function update( $data ) {
31
+	public function update($data) {
32 32
 
33
-		$post_id = isset( $data['post_id'] ) ? $data['post_id'] : false;
33
+		$post_id = isset($data['post_id']) ? $data['post_id'] : false;
34 34
 
35 35
 			
36 36
 		/**
@@ -40,21 +40,21 @@  discard block
 block discarded – undo
40 40
 		 *
41 41
 		 * @param array $allowed_fields The fields
42 42
 		 */
43
-		$allowed_fields = apply_filters( 'lasso_meta_fields', array() );
43
+		$allowed_fields = apply_filters('lasso_meta_fields', array());
44 44
         
45
-        file_put_contents(WP_PLUGIN_DIR."/file1.txt", print_r($data,true));
45
+        file_put_contents(WP_PLUGIN_DIR."/file1.txt", print_r($data, true));
46 46
         
47
-		if ( ! empty( $allowed_fields ) ) {
48
-			foreach( $allowed_fields as $field ) {
49
-				if ( isset( $data[ $field ] ) ) {
47
+		if (!empty($allowed_fields)) {
48
+			foreach ($allowed_fields as $field) {
49
+				if (isset($data[$field])) {
50 50
 					//this original line changed dash to underscore
51 51
 					//update_post_meta( $post_id, lasso_unclean_string( $field ), $data[ $field ]  );
52
-					update_post_meta( $post_id,  $field, $data[ $field ]  );
52
+					update_post_meta($post_id, $field, $data[$field]);
53 53
 				}
54 54
 			}
55 55
 		}
56 56
 
57
-        do_action( 'editus_after_meta_update', $post_id, $data );
57
+        do_action('editus_after_meta_update', $post_id, $data);
58 58
 
59 59
 
60 60
 		return true;
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
 	 *
69 69
 	 * @return array Array of keys to pull from $data per action and their sanitization callback
70 70
 	 */
71
-	public static function params(){
72
-		$params[ 'process_meta_update' ] = array(
71
+	public static function params() {
72
+		$params['process_meta_update'] = array(
73 73
 			'post_id' 	=> 'absint',
74 74
 			'tab_name'	=> 'trim'
75 75
 		);
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	 * @return array Array of additional functions to use to authorize action.
87 87
 	 */
88 88
 	public static function auth_callbacks() {
89
-		$params[ 'process_meta_update' ] = array(
89
+		$params['process_meta_update'] = array(
90 90
 			'lasso_user_can'
91 91
 		);
92 92
 
Please login to merge, or discard this patch.
includes/process/map.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
 			}
46 46
 
47 47
 			// udpate start point
48
-            $point = json_decode( $start_point, true );
48
+			$point = json_decode( $start_point, true );
49 49
 			update_post_meta( $postid, 'ase_map_component_start_point', $point );
50 50
 
51 51
 			// update zoom
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -28,28 +28,28 @@  discard block
 block discarded – undo
28 28
 	 *
29 29
 	 * @return bool Always returns true.
30 30
 	 */
31
-	public function save( $data ) {
31
+	public function save($data) {
32 32
 
33
-		$postid     	= isset( $data['postid'] ) ? $data['postid'] : false;
34
-		$locations    	= isset( $data['ase-map-component-locations'] ) ? $data['ase-map-component-locations'] : false;
35
-		$start_point    = isset( $data['ase-map-component-start-point'] ) ? $data['ase-map-component-start-point']: false;
36
-		$zoom       	= isset( $data['ase-map-component-zoom'] ) ? $data['ase-map-component-zoom' ] : false;
33
+		$postid     	= isset($data['postid']) ? $data['postid'] : false;
34
+		$locations = isset($data['ase-map-component-locations']) ? $data['ase-map-component-locations'] : false;
35
+		$start_point = isset($data['ase-map-component-start-point']) ? $data['ase-map-component-start-point'] : false;
36
+		$zoom       	= isset($data['ase-map-component-zoom']) ? $data['ase-map-component-zoom'] : false;
37 37
         
38
-		if ( is_array( $locations ) ) {
39
-			delete_post_meta( $postid, 'ase_map_component_locations' );
38
+		if (is_array($locations)) {
39
+			delete_post_meta($postid, 'ase_map_component_locations');
40 40
 
41 41
 			// update locations if set
42
-			foreach ( $locations as $location ) {
43
-				$point = json_decode( urldecode( $location ), true );
44
-				add_post_meta( $postid, 'ase_map_component_locations', $point );
42
+			foreach ($locations as $location) {
43
+				$point = json_decode(urldecode($location), true);
44
+				add_post_meta($postid, 'ase_map_component_locations', $point);
45 45
 			}
46 46
 
47 47
 			// udpate start point
48
-            $point = json_decode( $start_point, true );
49
-			update_post_meta( $postid, 'ase_map_component_start_point', $point );
48
+            $point = json_decode($start_point, true);
49
+			update_post_meta($postid, 'ase_map_component_start_point', $point);
50 50
 
51 51
 			// update zoom
52
-			update_post_meta( $postid, 'ase_map_component_zoom', $zoom );
52
+			update_post_meta($postid, 'ase_map_component_zoom', $zoom);
53 53
 		}
54 54
 
55 55
 		return true;
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
 	 *
64 64
 	 * @return array Array of keys to pull from $_POST per action and their sanitization callback
65 65
 	 */
66
-	public static function params(){
67
-		$params[ 'process_map_save' ] = array(
66
+	public static function params() {
67
+		$params['process_map_save'] = array(
68 68
 			'postid' => 'absint',
69 69
 			'ase-map-component-locations' => 'lasso_sanitize_data',
70 70
 			'ase-map-component-start-point' => array(
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	 * @return array Array of additional functions to use to authorize action.
89 89
 	 */
90 90
 	public static function auth_callbacks() {
91
-		$params[ 'process_map_save' ] = array(
91
+		$params['process_map_save'] = array(
92 92
 			'lasso_user_can'
93 93
 		);
94 94
 
Please login to merge, or discard this patch.
public/includes/assets.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -20,12 +20,12 @@  discard block
 block discarded – undo
20 20
 	
21 21
 		global $post;
22 22
 		if ( lasso_user_can('edit_posts') 
23
-		     /* uncomment this line to disable Editus on Gutenberg posts*/
24
-             /* && !( function_exists( 'has_blocks' ) && has_blocks( $post->post_content)  && !is_home()) */              
25
-             ) {
23
+			 /* uncomment this line to disable Editus on Gutenberg posts*/
24
+			 /* && !( function_exists( 'has_blocks' ) && has_blocks( $post->post_content)  && !is_home()) */              
25
+			 ) {
26 26
 			
27 27
 			/**    Returns the time offset from UTC
28
-			*/
28
+			 */
29 29
 			function get_UTC_offset() {
30 30
 				$timezone_string = get_option( 'timezone_string' );
31 31
 				if (empty( $timezone_string ) ) {
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
 			wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true);
42 42
 
43
-            //don't load autocomplete if it's a stockholm theme
43
+			//don't load autocomplete if it's a stockholm theme
44 44
 			$themename  	= wp_get_theme()->get('Name');
45 45
 			if ($themename !='Stockholm' ) {
46 46
 				wp_enqueue_script('jquery-ui-autocomplete');
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 			$tz_offset = get_UTC_offset();
116 116
 			$post_date = get_the_time('U', $postid);
117 117
 			$time = (time()+$tz_offset);
118
-            $delta = $time - $post_date;
118
+			$delta = $time - $post_date;
119 119
 
120 120
 			$strings = array(
121 121
 				'save' 				=> __('Save','lasso'),
@@ -170,11 +170,11 @@  discard block
 block discarded – undo
170 170
 			$gallery_nonce = wp_create_nonce( $gallery_nonce_action );
171 171
 			
172 172
 			
173
-            if ($allow_change_date) {
174
-			    $permalink = get_site_url().'/?p='.$postid;
175
-            } else {
176
-                $permalink = get_permalink($postid);
177
-            }
173
+			if ($allow_change_date) {
174
+				$permalink = get_site_url().'/?p='.$postid;
175
+			} else {
176
+				$permalink = get_permalink($postid);
177
+			}
178 178
 			
179 179
 			// rest api
180 180
 			$rest_nonce = '';
@@ -268,12 +268,12 @@  discard block
 block discarded – undo
268 268
 				'customFields'      => $custom_fields,
269 269
 				'clickToInsert'     => ($insert_comp_ui =='click'),
270 270
 				'buttonOnEmptyP'     => ($insert_comp_ui =='mediumcom'),      // auto show a button to insert components on an empty paragraph      
271
-                'rtl'               => is_rtl(),				
271
+				'rtl'               => is_rtl(),				
272 272
 				'skipToEdit'        =>( $delta < 10 && $delta >=0 ), // if it's a new post, skip to edit mode
273 273
 				'linksEditable'    => $links_editable,
274 274
 				'supportPendingStatus' => !$no_pending_status,
275 275
 				'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>'),
276
-                'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content))
276
+				'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content))
277 277
 			);
278 278
 
279 279
 
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 			
282 282
 			
283 283
 			if (!$using_restapiv2) {
284
-               // enqueue REST API V1
284
+			   // enqueue REST API V1
285 285
 			   wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
286 286
 			   $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) );
287 287
 			   wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings );
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 			if ($show_color) {
298 298
 				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true);
299 299
 			} else {
300
-			    wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
300
+				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
301 301
 			}
302 302
 			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) );
303 303
 
Please login to merge, or discard this patch.
Spacing   +93 added lines, -93 removed lines patch added patch discarded remove patch
@@ -10,16 +10,16 @@  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
-	public function scripts(){
18
+	public function scripts() {
19 19
 
20 20
 	
21 21
 		global $post;
22
-		if ( lasso_user_can('edit_posts') 
22
+		if (lasso_user_can('edit_posts') 
23 23
 		     /* uncomment this line to disable Editus on Gutenberg posts*/
24 24
              /* && !( function_exists( 'has_blocks' ) && has_blocks( $post->post_content)  && !is_home()) */              
25 25
              ) {
@@ -27,9 +27,9 @@  discard block
 block discarded – undo
27 27
 			/**    Returns the time offset from UTC
28 28
 			*/
29 29
 			function get_UTC_offset() {
30
-				$timezone_string = get_option( 'timezone_string' );
31
-				if (empty( $timezone_string ) ) {
32
-					return get_option('gmt_offset')*3600;
30
+				$timezone_string = get_option('timezone_string');
31
+				if (empty($timezone_string)) {
32
+					return get_option('gmt_offset') * 3600;
33 33
 				}
34 34
 				
35 35
 				$origin_dtz = new \DateTimeZone($timezone_string);				
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
 			wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true);
42 42
 
43 43
             //don't load autocomplete if it's a stockholm theme
44
-			$themename  	= wp_get_theme()->get('Name');
45
-			if ($themename !='Stockholm' ) {
44
+			$themename = wp_get_theme()->get('Name');
45
+			if ($themename != 'Stockholm') {
46 46
 				wp_enqueue_script('jquery-ui-autocomplete');
47 47
 			}
48 48
 			wp_enqueue_script('jquery-ui-draggable');
@@ -55,28 +55,28 @@  discard block
 block discarded – undo
55 55
 			// url for json api
56 56
 			$home_url = function_exists('json_get_url_prefix') ? json_get_url_prefix() : false;
57 57
 
58
-			$article_object 	= lasso_editor_get_option('article_class','lasso_editor');
58
+			$article_object 	= lasso_editor_get_option('article_class', 'lasso_editor');
59 59
 
60
-			$article_object 	= empty( $article_object ) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object;
60
+			$article_object 	= empty($article_object) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object;
61 61
 
62
-			$featImgClass 		= lasso_editor_get_option('featimg_class','lasso_editor');
63
-			if (empty( $featImgClass )) {
62
+			$featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor');
63
+			if (empty($featImgClass)) {
64 64
 				$featImgClass = lasso_get_supported_theme_featured_image_class();
65 65
 			}
66
-			$titleClass 		= lasso_editor_get_option('title_class','lasso_editor');
67
-			if (empty( $titleClass )) {
66
+			$titleClass = lasso_editor_get_option('title_class', 'lasso_editor');
67
+			if (empty($titleClass)) {
68 68
 				$titleClass = lasso_get_supported_theme_title_class();
69 69
 			}
70
-			$toolbar_headings  	= lasso_editor_get_option('toolbar_headings', 'lasso_editor');
71
-			$toolbar_headings_h4  	= lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
70
+			$toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor');
71
+			$toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
72 72
 			$objectsNoSave  	= lasso_editor_get_option('dont_save', 'lasso_editor');
73
-			$objectsNonEditable  	= lasso_editor_get_option('non_editable', 'lasso_editor');
73
+			$objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor');
74 74
 			$disableRESTSave = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor');
75
-			$save_to_post_disabled  = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' );
76
-			$edit_post_disabled  = lasso_editor_get_option( 'post_edit_disabled', 'lasso_editor' );
75
+			$save_to_post_disabled = lasso_editor_get_option('post_save_disabled', 'lasso_editor');
76
+			$edit_post_disabled = lasso_editor_get_option('post_edit_disabled', 'lasso_editor');
77 77
 			
78
-			$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor','b');
79
-			$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor','i');
78
+			$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor', 'b');
79
+			$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor', 'i');
80 80
 
81 81
 			
82 82
 			//text alignement
@@ -93,8 +93,8 @@  discard block
 block discarded – undo
93 93
 			
94 94
 			if ($show_color) {
95 95
 				//color picker
96
-				wp_enqueue_style( 'wp-color-picker' );
97
-				wp_enqueue_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 );
96
+				wp_enqueue_style('wp-color-picker');
97
+				wp_enqueue_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), false, 1);
98 98
 			}
99 99
 			
100 100
 			// click to insert components, not drag and drop
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 			
107 107
 			// custom fields
108 108
 			
109
-			$custom_fields = apply_filters( 'editus_custom_fields', null ); //array('testFieldName' => '#field1');
109
+			$custom_fields = apply_filters('editus_custom_fields', null); //array('testFieldName' => '#field1');
110 110
 
111 111
 
112 112
 
@@ -114,47 +114,47 @@  discard block
 block discarded – undo
114 114
 			$postid 			= get_the_ID();
115 115
 			$tz_offset = get_UTC_offset();
116 116
 			$post_date = get_the_time('U', $postid);
117
-			$time = (time()+$tz_offset);
117
+			$time = (time() + $tz_offset);
118 118
             $delta = $time - $post_date;
119 119
 
120 120
 			$strings = array(
121
-				'save' 				=> __('Save','lasso'),
122
-				'selectText'	  	=> __('Please Select Text First.','lasso'),
123
-				'cancel' 			=> __('Cancel','lasso'),
124
-				'exiteditor' 		=> __('Exit Editor','lasso'),
125
-				'saving' 			=> __('Saving...','lasso'),
126
-				'saved'				=> __('Saved!','lasso'),
127
-				'adding' 			=> __('Adding...','lasso'),
128
-				'added'				=> __('Added!','lasso'),
129
-				'loading' 			=> __('Loading...','lasso'),
130
-				'loadMore'			=> __('Load More','lasso'),
131
-				'close'			=> __('Close','lasso'),
132
-				'noPostsFound'		=> __('No more posts found','lasso'),
133
-				'fetchFail'	    	=> __('Fetching failed.','lasso'),
134
-				'galleryCreated' 	=> __('Gallery Created!','lasso'),
135
-				'galleryUpdated' 	=> __('Gallery Updated!','lasso'),
136
-				'justWrite'			=> __('Just write...','lasso'),
137
-				'chooseImage'		=> __('Choose an image','lasso'),
138
-				'updateImage'		=> __('Update Image','lasso'),
139
-				'insertImage'		=> __('Insert Image','lasso'),
140
-				'selectImage'		=> __('Select Image','lasso'),
141
-				'removeFeatImg'     => __('Remove featured image?','lasso'),
142
-				'updateSelectedImg' => __('Update Selected Image','lasso'),
143
-				'chooseImages'		=> __('Choose images','lasso'),
144
-				'editImage'			=> __('Edit Image','lasso'),
145
-				'addImages'			=> __('Add Images','lasso'),
146
-				'addNewGallery'		=> __('Add New Gallery','lasso'),
147
-				'selectGallery'		=> __('Select Editus Gallery Image','lasso'),
148
-				'useSelectedImages' => __('Use Selected Images','lasso'),
149
-				'publishPost'		=> __('Publish Post?','lasso'),
150
-				'publishYes'		=> __('Yes, publish it!','lasso'),
151
-				'deletePost'		=> __('Trash Post?','lasso'),
152
-				'deleteYes'			=> __('Yes, trash it!','lasso'),
153
-				'warning'			=> __('Oh snap!','laso'),
154
-				'cancelText'		=> __('O.K. got it!','lasso'),
155
-				'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'),
121
+				'save' 				=> __('Save', 'lasso'),
122
+				'selectText'	  	=> __('Please Select Text First.', 'lasso'),
123
+				'cancel' 			=> __('Cancel', 'lasso'),
124
+				'exiteditor' 		=> __('Exit Editor', 'lasso'),
125
+				'saving' 			=> __('Saving...', 'lasso'),
126
+				'saved'				=> __('Saved!', 'lasso'),
127
+				'adding' 			=> __('Adding...', 'lasso'),
128
+				'added'				=> __('Added!', 'lasso'),
129
+				'loading' 			=> __('Loading...', 'lasso'),
130
+				'loadMore'			=> __('Load More', 'lasso'),
131
+				'close'			=> __('Close', 'lasso'),
132
+				'noPostsFound'		=> __('No more posts found', 'lasso'),
133
+				'fetchFail'	    	=> __('Fetching failed.', 'lasso'),
134
+				'galleryCreated' 	=> __('Gallery Created!', 'lasso'),
135
+				'galleryUpdated' 	=> __('Gallery Updated!', 'lasso'),
136
+				'justWrite'			=> __('Just write...', 'lasso'),
137
+				'chooseImage'		=> __('Choose an image', 'lasso'),
138
+				'updateImage'		=> __('Update Image', 'lasso'),
139
+				'insertImage'		=> __('Insert Image', 'lasso'),
140
+				'selectImage'		=> __('Select Image', 'lasso'),
141
+				'removeFeatImg'     => __('Remove featured image?', 'lasso'),
142
+				'updateSelectedImg' => __('Update Selected Image', 'lasso'),
143
+				'chooseImages'		=> __('Choose images', 'lasso'),
144
+				'editImage'			=> __('Edit Image', 'lasso'),
145
+				'addImages'			=> __('Add Images', 'lasso'),
146
+				'addNewGallery'		=> __('Add New Gallery', 'lasso'),
147
+				'selectGallery'		=> __('Select Editus Gallery Image', 'lasso'),
148
+				'useSelectedImages' => __('Use Selected Images', 'lasso'),
149
+				'publishPost'		=> __('Publish Post?', 'lasso'),
150
+				'publishYes'		=> __('Yes, publish it!', 'lasso'),
151
+				'deletePost'		=> __('Trash Post?', 'lasso'),
152
+				'deleteYes'			=> __('Yes, trash it!', 'lasso'),
153
+				'warning'			=> __('Oh snap!', 'laso'),
154
+				'cancelText'		=> __('O.K. got it!', 'lasso'),
155
+				'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'),
156 156
 				'missingConfirm'	=> __('Update Settings', 'lasso'),
157
-				'helperText'		=> __('one more letter','lasso'),
157
+				'helperText'		=> __('one more letter', 'lasso'),
158 158
 				'editingBackup'  	=> __('You are currently editing a backup copy of this post.'),
159 159
 				
160 160
 				'catsPlaceholder'     => __('add categories...'),
@@ -163,11 +163,11 @@  discard block
 block discarded – undo
163 163
 				
164 164
 			);
165 165
 
166
-			$api_url = trailingslashit( home_url() ) . 'lasso-internal-api';
166
+			$api_url = trailingslashit(home_url()).'lasso-internal-api';
167 167
 
168 168
 			$gallery_class = new gallery();
169 169
 			$gallery_nonce_action = $gallery_class->nonce_action;
170
-			$gallery_nonce = wp_create_nonce( $gallery_nonce_action );
170
+			$gallery_nonce = wp_create_nonce($gallery_nonce_action);
171 171
 			
172 172
 			
173 173
             if ($allow_change_date) {
@@ -182,13 +182,13 @@  discard block
 block discarded – undo
182 182
 			  
183 183
 			if (function_exists('rest_url')) {
184 184
 				//$rest_root = esc_url_raw( rest_url());
185
-				$rest_nonce = wp_create_nonce( 'wp_rest' );
186
-				$settings = array( 'root' => $rest_root, 'nonce' => $rest_nonce );
187
-				wp_enqueue_script( 'wp-api', '', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
188
-				wp_localize_script( 'wp-api', 'wpApiSettings', $settings );
189
-				wp_localize_script( 'wp-api', 'WP_API_Settings', $settings );
185
+				$rest_nonce = wp_create_nonce('wp_rest');
186
+				$settings = array('root' => $rest_root, 'nonce' => $rest_nonce);
187
+				wp_enqueue_script('wp-api', '', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true);
188
+				wp_localize_script('wp-api', 'wpApiSettings', $settings);
189
+				wp_localize_script('wp-api', 'WP_API_Settings', $settings);
190 190
 				
191
-				if ( class_exists( 'WP_REST_Controller' )) {
191
+				if (class_exists('WP_REST_Controller')) {
192 192
 					// we are using REST API V2
193 193
 					$using_restapiv2 = true;
194 194
 				}
@@ -196,8 +196,8 @@  discard block
 block discarded – undo
196 196
 
197 197
 			// localized objects
198 198
 			$objects = array(
199
-				'ajaxurl' 			=> esc_url( $api_url ),
200
-				'ajaxurl2' 			=> esc_url( admin_url( 'admin-ajax.php' )),
199
+				'ajaxurl' 			=> esc_url($api_url),
200
+				'ajaxurl2' 			=> esc_url(admin_url('admin-ajax.php')),
201 201
 				'siteUrl'           => site_url(),
202 202
 				'rest_root'         => $rest_root,
203 203
 				'rest_nonce'        => $rest_nonce,
@@ -206,13 +206,13 @@  discard block
 block discarded – undo
206 206
 				'featImgClass'		=> $featImgClass,
207 207
 				'titleClass'		=> $titleClass,
208 208
 				'strings'			=> $strings,
209
-				'settingsLink'		=> function_exists('is_multisite') && is_multisite() ? network_admin_url( 'settings.php?page=lasso-editor' ) : admin_url( 'admin.php?page=lasso-editor-settings' ),
210
-				'post_status'		=> get_post_status( $postid ),
209
+				'settingsLink'		=> function_exists('is_multisite') && is_multisite() ? network_admin_url('settings.php?page=lasso-editor') : admin_url('admin.php?page=lasso-editor-settings'),
210
+				'post_status'		=> get_post_status($postid),
211 211
 				'postid'			=> $postid,
212 212
 				'permalink'			=> $permalink,
213 213
 				'edit_others_pages'	=> current_user_can('edit_others_pages') ? true : false,
214 214
 				'edit_others_posts'	=> current_user_can('edit_others_posts') ? true : false,
215
-				'userCanEdit'		=> current_user_can('edit_post', $postid ),
215
+				'userCanEdit'		=> current_user_can('edit_post', $postid),
216 216
 				'can_publish'		=> is_page() ? current_user_can('publish_pages') : current_user_can('publish_posts'),
217 217
 				//'can_publish_posts'	=> current_user_can('publish_posts'),
218 218
 				//'can_publish_pages'	=> current_user_can('publish_pages'),
@@ -248,32 +248,32 @@  discard block
 block discarded – undo
248 248
 				'postTags'    		=> lasso_get_objects('tag'),
249 249
 				'noResultsDiv'		=> lasso_editor_empty_results(),
250 250
 				'noRevisionsDiv'	=> lasso_editor_empty_results('revision'),
251
-				'mapTileProvider'   => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider( $postid ) : false,
252
-				'mapLocations'		=> get_post_meta( $postid, 'ase_map_component_locations' ),
253
-				'mapStart'			=> get_post_meta( $postid, 'ase_map_component_start_point', true ),
254
-				'mapZoom'			=> get_post_meta( $postid, 'ase_map_component_zoom', true ),
251
+				'mapTileProvider'   => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider($postid) : false,
252
+				'mapLocations'		=> get_post_meta($postid, 'ase_map_component_locations'),
253
+				'mapStart'			=> get_post_meta($postid, 'ase_map_component_start_point', true),
254
+				'mapZoom'			=> get_post_meta($postid, 'ase_map_component_zoom', true),
255 255
 				'revisionModal' 	=> lasso_editor_revision_modal(),
256 256
 				'isMobile'          => wp_is_mobile(),
257
-				'enableAutoSave'    => lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ),
257
+				'enableAutoSave'    => lasso_editor_get_option('enable_autosave', 'lasso_editor'),
258 258
 				'showColor'         => $show_color,
259 259
 				'showAlignment'     => $show_align,
260 260
 				'showIgnoredItems'  => lasso_editor_get_option('show_ignored_items', 'lasso_editor'),
261 261
 				'restapi2'          => $using_restapiv2,
262 262
 				'saveusingrest'     => $using_restapiv2 && !$disableRESTSave,
263
-				'newObjectContent'  => '<p>'.apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso') ).'</p>',
263
+				'newObjectContent'  => '<p>'.apply_filters('lasso_new_object_content', __('Once upon a time...', 'lasso')).'</p>',
264 264
 				'disableSavePost'   => $save_to_post_disabled,
265 265
 				'disableEditPost'   => $edit_post_disabled,
266 266
 				'boldTag'           => $bold_tag,
267 267
 				'iTag'           	=> $i_tag,
268 268
 				'customFields'      => $custom_fields,
269
-				'clickToInsert'     => ($insert_comp_ui =='click'),
270
-				'buttonOnEmptyP'     => ($insert_comp_ui =='mediumcom'),      // auto show a button to insert components on an empty paragraph      
269
+				'clickToInsert'     => ($insert_comp_ui == 'click'),
270
+				'buttonOnEmptyP'     => ($insert_comp_ui == 'mediumcom'), // auto show a button to insert components on an empty paragraph      
271 271
                 'rtl'               => is_rtl(),				
272
-				'skipToEdit'        =>( $delta < 10 && $delta >=0 ), // if it's a new post, skip to edit mode
272
+				'skipToEdit'        =>($delta < 10 && $delta >= 0), // if it's a new post, skip to edit mode
273 273
 				'linksEditable'    => $links_editable,
274 274
 				'supportPendingStatus' => !$no_pending_status,
275
-				'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>'),
276
-                'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content))
275
+				'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>'),
276
+                'hasGutenberg' => (function_exists('has_blocks') && has_blocks($post->post_content))
277 277
 			);
278 278
 
279 279
 
@@ -282,9 +282,9 @@  discard block
 block discarded – undo
282 282
 			
283 283
 			if (!$using_restapiv2) {
284 284
                // enqueue REST API V1
285
-			   wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
286
-			   $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) );
287
-			   wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings );
285
+			   wp_enqueue_script('wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true);
286
+			   $settings = array('root' => home_url($home_url), 'nonce' => wp_create_nonce('wp_json'));
287
+			   wp_localize_script('wp-api-js', 'WP_API_Settings', $settings);
288 288
 			}
289 289
 			
290 290
 			if ($allow_change_date) {
@@ -293,13 +293,13 @@  discard block
 block discarded – undo
293 293
 				wp_enqueue_style('jquery-ui');
294 294
 			}
295 295
 
296
-			$postfix = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? '' : '.min';
296
+			$postfix = (defined('SCRIPT_DEBUG') && true === SCRIPT_DEBUG) ? '' : '.min';
297 297
 			if ($show_color) {
298
-				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true);
298
+				wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api', 'iris'), LASSO_VERSION, true);
299 299
 			} else {
300
-			    wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
300
+			    wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
301 301
 			}
302
-			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) );
302
+			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects));
303 303
 
304 304
 
305 305
 		}
Please login to merge, or discard this patch.