Completed
Push — master ( 319bf8...7bcb93 )
by
unknown
01:42
created
public/includes/editor-modules.php 1 patch
Spacing   +221 added lines, -221 removed lines patch added patch discarded remove patch
@@ -12,32 +12,32 @@  discard block
 block discarded – undo
12 12
  *
13 13
  * @since 1.0
14 14
  */
15
-add_action( 'wp_footer', 'lasso_editor_controls' );
15
+add_action('wp_footer', 'lasso_editor_controls');
16 16
 function lasso_editor_controls() {
17 17
 
18 18
 	global $post;
19 19
 
20
-	if ( lasso_user_can('edit_posts') ) {
20
+	if (lasso_user_can('edit_posts')) {
21 21
 
22
-		$status = get_post_status( get_the_ID() );
22
+		$status = get_post_status(get_the_ID());
23 23
 
24 24
 		// let users add custom css classes
25
-		$custom_classes = apply_filters( 'lasso_control_classes', '' );
25
+		$custom_classes = apply_filters('lasso_control_classes', '');
26 26
 
27 27
 		$post_access_class   = '';
28
-		$post_new_disabled   = lasso_editor_get_option( 'post_adding_disabled', 'lasso_editor' );
29
-		$post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' );
30
-		$shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' );
28
+		$post_new_disabled   = lasso_editor_get_option('post_adding_disabled', 'lasso_editor');
29
+		$post_settings_disabled = lasso_editor_get_option('post_settings_disabled', 'lasso_editor');
30
+		$shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor');
31 31
 
32 32
 
33 33
 		// CSS class if adding new post objects is disabled
34
-		if ( 'on' == $post_new_disabled ) { $post_access_class = 'lasso--post-new-disabled'; }
34
+		if ('on' == $post_new_disabled) { $post_access_class = 'lasso--post-new-disabled'; }
35 35
 
36 36
 		// CSS class if adjust settings is disabled
37
-		if ( 'on' == $post_settings_disabled ) { $post_access_class = 'lasso--post-settings-disabled'; }
37
+		if ('on' == $post_settings_disabled) { $post_access_class = 'lasso--post-settings-disabled'; }
38 38
 
39 39
 		// CSS class if adding new post objects AND settings are disabled
40
-		if ( 'on' == $post_new_disabled && 'on' == $post_settings_disabled ) { $post_access_class = 'lasso--post-all-disabled'; }
40
+		if ('on' == $post_new_disabled && 'on' == $post_settings_disabled) { $post_access_class = 'lasso--post-all-disabled'; }
41 41
 
42 42
 		// CSS class if shortcodify or (Aesop Shortcode Conversion) is disabled
43 43
 		$sc_saving_class = 'on' == $shortcodify_disabled ? 'shortcodify-disabled' : 'shortcodify-enabled';
@@ -49,44 +49,44 @@  discard block
 block discarded – undo
49 49
 		$mobile_style = $is_mobile ? 'style="bottom:0px;"' : null;
50 50
 		
51 51
 
52
-		?><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();?>" >
52
+		?><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(); ?>" >
53 53
 
54
-			<ul class="lasso--controls__center lasso-editor-controls lasso-editor-controls--wrap <?php echo $post_access_class;?> "  <?php echo $mobile_style ?> >
54
+			<ul class="lasso--controls__center lasso-editor-controls lasso-editor-controls--wrap <?php echo $post_access_class; ?> "  <?php echo $mobile_style ?> >
55 55
 
56
-				<?php do_action( 'lasso_editor_controls_before' );
56
+				<?php do_action('lasso_editor_controls_before');
57 57
 
58
-				if ( $is_capable ) { ?>
58
+				if ($is_capable) { ?>
59 59
 
60
-					<li id="lasso--edit" title="<?php esc_attr_e( 'Edit Post', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
60
+					<li id="lasso--edit" title="<?php esc_attr_e('Edit Post', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
61 61
 
62
-					<?php if ( 'off' == $post_settings_disabled || empty( $post_settings_disabled ) ) { ?>
63
-						<li id="lasso--post-settings" title="<?php esc_attr_e( 'Post Settings', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
62
+					<?php if ('off' == $post_settings_disabled || empty($post_settings_disabled)) { ?>
63
+						<li id="lasso--post-settings" title="<?php esc_attr_e('Post Settings', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
64 64
 					<?php }
65 65
 
66 66
 				} ?>
67 67
 
68
-				<li id="lasso--post-all" title="<?php esc_attr_e( 'All Posts', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
68
+				<li id="lasso--post-all" title="<?php esc_attr_e('All Posts', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
69 69
 
70
-				<?php if ( $is_capable && wp_revisions_enabled( $post ) ) { ?>
71
-					<li id="lasso--post-revisions" title="<?php esc_attr_e( 'Revisions', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
70
+				<?php if ($is_capable && wp_revisions_enabled($post)) { ?>
71
+					<li id="lasso--post-revisions" title="<?php esc_attr_e('Revisions', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
72 72
 				<?php } ?>
73 73
 
74
-				<?php if ( ( 'off' == $post_new_disabled || empty( $post_new_disabled ) && lasso_user_can('publish_posts') ) ) { ?>
75
-					<li id="lasso--post-new" title="<?php esc_attr_e( 'Add Post', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
74
+				<?php if (('off' == $post_new_disabled || empty($post_new_disabled) && lasso_user_can('publish_posts'))) { ?>
75
+					<li id="lasso--post-new" title="<?php esc_attr_e('Add Post', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
76 76
 				<?php } ?>
77 77
 
78
-				<?php do_action( 'lasso_editor_controls_after' );?>
78
+				<?php do_action('lasso_editor_controls_after'); ?>
79 79
 
80 80
 			</ul>
81 81
 
82
-			<?php if ( is_singular() && !$is_mobile ) { ?>
82
+			<?php if (is_singular() && !$is_mobile) { ?>
83 83
 
84
-				<div class="lasso--controls__right" data-posttype="<?php echo get_post_type( get_the_ID() );?>" data-status="<?php echo $status;?>">
84
+				<div class="lasso--controls__right" data-posttype="<?php echo get_post_type(get_the_ID()); ?>" data-status="<?php echo $status; ?>">
85 85
 
86
-					<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>
86
+					<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>
87 87
 
88
-					<?php if ( 'draft' == $status && ( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') )  ) { ?>
89
-						<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>
88
+					<?php if ('draft' == $status && (lasso_user_can('publish_posts') || lasso_user_can('publish_pages'))) { ?>
89
+						<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>
90 90
 					<?php } ?>
91 91
 
92 92
 				</div>
@@ -109,13 +109,13 @@  discard block
 block discarded – undo
109 109
 
110 110
 	ob_start();
111 111
 
112
-	if ( !lasso_user_can() )
112
+	if (!lasso_user_can())
113 113
 		return;
114 114
 
115 115
 	// let users add custom css classes
116
-	$custom_classes = apply_filters( 'lasso_sidebar_classes', '' );
116
+	$custom_classes = apply_filters('lasso_sidebar_classes', '');
117 117
 	?>
118
-	<div id="lasso--sidebar" class="<?php echo sanitize_html_class( $custom_classes );?>" >
118
+	<div id="lasso--sidebar" class="<?php echo sanitize_html_class($custom_classes); ?>" >
119 119
 		<div class="lasso--sidebar__inner">
120 120
 			<div id="lasso--component__settings"></div>
121 121
 		</div>
@@ -133,26 +133,26 @@  discard block
 block discarded – undo
133 133
 
134 134
 	ob_start();
135 135
 
136
-	if ( !lasso_user_can() )
136
+	if (!lasso_user_can())
137 137
 		return;
138 138
 	
139 139
 	$is_mobile = wp_is_mobile();
140 140
 
141 141
 	// check for lasso story engine and add a class doniting this
142
-	$ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active';
142
+	$ase_status = class_exists('Aesop_Core') || defined('LASSO_CUSTOM') ? 'ase-active' : 'ase-not-active';
143 143
 
144 144
 	// let users add custom css classes
145
-	$custom_classes = apply_filters( 'lasso_toolbar_classes', '' );
145
+	$custom_classes = apply_filters('lasso_toolbar_classes', '');
146 146
 
147 147
 	// are toolbar headings enabled
148
-	$toolbar_headings      = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' );
149
-	$toolbar_headings_h4      = lasso_editor_get_option( 'toolbar_headings_h4', 'lasso_editor' );
148
+	$toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor');
149
+	$toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
150 150
 
151
-	$toolbar_class  = $toolbar_headings ? 'toolbar-extended' : false;
151
+	$toolbar_class = $toolbar_headings ? 'toolbar-extended' : false;
152 152
 	
153 153
 	// mobile styles
154 154
     $mobile_class = $is_mobile ? 'lasso-mobile' : false;
155
-	$mobile_style =$is_mobile ? 'style="bottom:0px;"' : null;
155
+	$mobile_style = $is_mobile ? 'style="bottom:0px;"' : null;
156 156
 	
157 157
 	//show color
158 158
 	$show_color = lasso_editor_get_option('toolbar_show_color', 'lasso_editor');
@@ -160,99 +160,99 @@  discard block
 block discarded – undo
160 160
 	//show alignment
161 161
 	$show_align = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor');
162 162
 	
163
-	$status = get_post_status( get_the_ID() );
163
+	$status = get_post_status(get_the_ID());
164 164
 
165 165
 
166 166
 	?>
167
-	<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 ?>>
168
-		<ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"';}?>>
169
-			<?php do_action( 'lasso_toolbar_components_before' );?>
170
-		    <li id="lasso-toolbar--bold" title="<?php esc_attr_e( 'Bold', 'lasso' );?>"></li>
171
-		    <li id="lasso-toolbar--underline" title="<?php esc_attr_e( 'Underline', 'lasso' );?>"></li>
172
-		    <li id="lasso-toolbar--italic" title="<?php esc_attr_e( 'Italicize', 'lasso' );?>"></li>
173
-		    <li id="lasso-toolbar--strike" title="<?php esc_attr_e( 'Strikethrough', 'lasso' );?>"></li>
174
-		    <?php if ( $toolbar_headings ): ?>
175
-		    <li id="lasso-toolbar--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"></li>
176
-		    <li id="lasso-toolbar--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"></li>
167
+	<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 ?>>
168
+		<ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"'; }?>>
169
+			<?php do_action('lasso_toolbar_components_before'); ?>
170
+		    <li id="lasso-toolbar--bold" title="<?php esc_attr_e('Bold', 'lasso'); ?>"></li>
171
+		    <li id="lasso-toolbar--underline" title="<?php esc_attr_e('Underline', 'lasso'); ?>"></li>
172
+		    <li id="lasso-toolbar--italic" title="<?php esc_attr_e('Italicize', 'lasso'); ?>"></li>
173
+		    <li id="lasso-toolbar--strike" title="<?php esc_attr_e('Strikethrough', 'lasso'); ?>"></li>
174
+		    <?php if ($toolbar_headings): ?>
175
+		    <li id="lasso-toolbar--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"></li>
176
+		    <li id="lasso-toolbar--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"></li>
177 177
 			<?php endif; ?>
178
-			<?php if ( $toolbar_headings_h4 ): ?>
179
-		    <li id="lasso-toolbar--h4" title="<?php esc_attr_e( 'H4 Heading', 'lasso' );?>"></li>
180
-		    <li id="lasso-toolbar--h5" title="<?php esc_attr_e( 'H5 Heading', 'lasso' );?>"></li>
181
-			<li id="lasso-toolbar--h6" title="<?php esc_attr_e( 'H6 Heading', 'lasso' );?>"></li>
178
+			<?php if ($toolbar_headings_h4): ?>
179
+		    <li id="lasso-toolbar--h4" title="<?php esc_attr_e('H4 Heading', 'lasso'); ?>"></li>
180
+		    <li id="lasso-toolbar--h5" title="<?php esc_attr_e('H5 Heading', 'lasso'); ?>"></li>
181
+			<li id="lasso-toolbar--h6" title="<?php esc_attr_e('H6 Heading', 'lasso'); ?>"></li>
182 182
 			<?php endif; ?>
183 183
 			
184
-			<?php if ( $show_color ): ?>
185
-		    <li id="lasso-toolbar--color-set" title="<?php esc_attr_e( 'Set Text Color', 'lasso' );?>"></li>
186
-		    <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e( 'Choose Color', 'lasso' );?>"></li>
184
+			<?php if ($show_color): ?>
185
+		    <li id="lasso-toolbar--color-set" title="<?php esc_attr_e('Set Text Color', 'lasso'); ?>"></li>
186
+		    <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e('Choose Color', 'lasso'); ?>"></li>
187 187
 			<?php endif; ?>
188 188
 					
189
-		    <li id="lasso-toolbar--components" title="<?php esc_attr_e( 'Insert Component', 'lasso' );?>">
189
+		    <li id="lasso-toolbar--components" title="<?php esc_attr_e('Insert Component', 'lasso'); ?>">
190 190
 			    <ul id="lasso-toolbar--components__list" style="display:none;">
191
-			    	<?php if ( 'ase-active' == $ase_status ): ?>
192
-						<li data-type="image" title="<?php esc_attr_e( 'Image', 'lasso' );?>" class="lasso-toolbar--component__image"></li>
193
-						<li data-type="character" title="<?php esc_attr_e( 'Character', 'lasso' );?>" class="lasso-toolbar--component__character"></li>
194
-						<li data-type="quote" title="<?php esc_attr_e( 'Quote', 'lasso' );?>"  class="lasso-toolbar--component__quote"></li>
195
-						<li data-type="content" title="<?php esc_attr_e( 'Content', 'lasso' );?>"  class="lasso-toolbar--component__content"></li>
196
-						<li data-type="chapter" title="<?php esc_attr_e( 'Chapter', 'lasso' );?>"  class="lasso-toolbar--component__chapter"></li>
197
-						<li data-type="parallax" title="<?php esc_attr_e( 'Parallax', 'lasso' );?>"  class="lasso-toolbar--component__parallax"></li>
198
-						<li data-type="audio" title="<?php esc_attr_e( 'Audio', 'lasso' );?>"  class="lasso-toolbar--component__audio"></li>
199
-						<li data-type="video" title="<?php esc_attr_e( 'Video', 'lasso' );?>"  class="lasso-toolbar--component__video"></li>
200
-						<li data-type="map" title="<?php esc_attr_e( 'Map', 'lasso' );?>"  class="lasso-toolbar--component__map"></li>
201
-						<li data-type="timeline_stop" title="<?php esc_attr_e( 'Timeline', 'lasso' );?>"  class="lasso-toolbar--component__timeline"></li>
202
-						<li data-type="document" title="<?php esc_attr_e( 'Document', 'lasso' );?>"  class="lasso-toolbar--component__document"></li>
203
-						<li data-type="collection" title="<?php esc_attr_e( 'Collection', 'lasso' );?>"  class="lasso-toolbar--component__collection"></li>
204
-						<li data-type="gallery" title="<?php esc_attr_e( 'Gallery', 'lasso' );?>"  class="lasso-toolbar--component__gallery"></li>
205
-						<?php if ( class_exists ('Aesop_GalleryPop') ) { ?>
206
-						     <li data-type="gallery" title="<?php esc_attr_e( 'Gallery Pop', 'lasso' );?>"  class="lasso-toolbar--component__gallerypop"></li>
191
+			    	<?php if ('ase-active' == $ase_status): ?>
192
+						<li data-type="image" title="<?php esc_attr_e('Image', 'lasso'); ?>" class="lasso-toolbar--component__image"></li>
193
+						<li data-type="character" title="<?php esc_attr_e('Character', 'lasso'); ?>" class="lasso-toolbar--component__character"></li>
194
+						<li data-type="quote" title="<?php esc_attr_e('Quote', 'lasso'); ?>"  class="lasso-toolbar--component__quote"></li>
195
+						<li data-type="content" title="<?php esc_attr_e('Content', 'lasso'); ?>"  class="lasso-toolbar--component__content"></li>
196
+						<li data-type="chapter" title="<?php esc_attr_e('Chapter', 'lasso'); ?>"  class="lasso-toolbar--component__chapter"></li>
197
+						<li data-type="parallax" title="<?php esc_attr_e('Parallax', 'lasso'); ?>"  class="lasso-toolbar--component__parallax"></li>
198
+						<li data-type="audio" title="<?php esc_attr_e('Audio', 'lasso'); ?>"  class="lasso-toolbar--component__audio"></li>
199
+						<li data-type="video" title="<?php esc_attr_e('Video', 'lasso'); ?>"  class="lasso-toolbar--component__video"></li>
200
+						<li data-type="map" title="<?php esc_attr_e('Map', 'lasso'); ?>"  class="lasso-toolbar--component__map"></li>
201
+						<li data-type="timeline_stop" title="<?php esc_attr_e('Timeline', 'lasso'); ?>"  class="lasso-toolbar--component__timeline"></li>
202
+						<li data-type="document" title="<?php esc_attr_e('Document', 'lasso'); ?>"  class="lasso-toolbar--component__document"></li>
203
+						<li data-type="collection" title="<?php esc_attr_e('Collection', 'lasso'); ?>"  class="lasso-toolbar--component__collection"></li>
204
+						<li data-type="gallery" title="<?php esc_attr_e('Gallery', 'lasso'); ?>"  class="lasso-toolbar--component__gallery"></li>
205
+						<?php if (class_exists('Aesop_GalleryPop')) { ?>
206
+						     <li data-type="gallery" title="<?php esc_attr_e('Gallery Pop', 'lasso'); ?>"  class="lasso-toolbar--component__gallerypop"></li>
207 207
 						<?php }?>
208 208
 					<?php else: ?>
209
-						<li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li>
210
-						<li data-type="wpquote" title="<?php esc_attr_e( 'WordPress Quote', 'lasso' );?>" class="quote lasso-toolbar--component__quote"></li>
211
-						<!--li data-type="wpvideo" title="<?php esc_attr_e( 'WordPress Video', 'lasso' );?>" class="video lasso-toolbar--component__video"></li-->
209
+						<li data-type="wpimg" title="<?php esc_attr_e('WordPress Image', 'lasso'); ?>" class="image lasso-toolbar--component__image"></li>
210
+						<li data-type="wpquote" title="<?php esc_attr_e('WordPress Quote', 'lasso'); ?>" class="quote lasso-toolbar--component__quote"></li>
211
+						<!--li data-type="wpvideo" title="<?php esc_attr_e('WordPress Video', 'lasso'); ?>" class="video lasso-toolbar--component__video"></li-->
212 212
 					<?php endif; ?>
213
-					<?php do_action( 'lasso_toolbar_components' );?>
213
+					<?php do_action('lasso_toolbar_components'); ?>
214 214
 			    </ul>
215 215
 			</li>
216
-			<li id="lasso-toolbar--link" title="<?php esc_attr_e( 'Anchor Link', 'lasso' );?>">
216
+			<li id="lasso-toolbar--link" title="<?php esc_attr_e('Anchor Link', 'lasso'); ?>">
217 217
 		    	<div id="lasso-toolbar--link__wrap" <?php echo $mobile_style ?> >
218
-		    		<div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'http://url.com', 'lasso' );?>"></div>
219
-		    		<a href="#" title="<?php esc_attr_e( 'Create Link', 'lasso' );?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a>
218
+		    		<div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e('http://url.com', 'lasso'); ?>"></div>
219
+		    		<a href="#" title="<?php esc_attr_e('Create Link', 'lasso'); ?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a>
220 220
 					<input class="styled-checkbox" type="checkbox" id="aesop-toolbar--link_newtab" checked/>
221 221
                     <label for="aesop-toolbar--link_newtab">Open in Another Tab</label>
222 222
 		    	</div>
223 223
 		    </li>
224
-		    <?php do_action( 'lasso_toolbar_components_after' );?>
225
-		    <li id="lasso-toolbar--html" title="<?php esc_attr_e( 'Insert HTML', 'lasso' );?>">
224
+		    <?php do_action('lasso_toolbar_components_after'); ?>
225
+		    <li id="lasso-toolbar--html" title="<?php esc_attr_e('Insert HTML', 'lasso'); ?>">
226 226
 		    	<div id="lasso-toolbar--html__wrap" <?php echo $mobile_style ?>>
227
-		    		<div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?>"></div>
227
+		    		<div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e('Enter HTML to insert', 'lasso'); ?>"></div>
228 228
 		    		<div id="lasso-toolbar--html__footer">
229 229
 		    			<ul class="lasso-toolbar--html-snips">
230
-		    				<?php if ( !$toolbar_headings ): ?>
231
-		    				<li id="lasso-html--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>">
232
-		    				<li id="lasso-html--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>">
230
+		    				<?php if (!$toolbar_headings): ?>
231
+		    				<li id="lasso-html--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>">
232
+		    				<li id="lasso-html--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>">
233 233
 		    				<?php endif; ?>
234
-		    				<li id="lasso-html--ul" title="<?php esc_attr_e( 'Unordered List', 'lasso' );?>">
235
-		    				<li id="lasso-html--ol" title="<?php esc_attr_e( 'Ordered List', 'lasso' );?>">
234
+		    				<li id="lasso-html--ul" title="<?php esc_attr_e('Unordered List', 'lasso'); ?>">
235
+		    				<li id="lasso-html--ol" title="<?php esc_attr_e('Ordered List', 'lasso'); ?>">
236 236
 		    			</ul>
237
-		    			<a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e( 'Cancel', 'lasso' );?></a>
238
-		    			<a href="#" title="<?php esc_attr_e( 'Insert HTML', 'lasso' );?>" class="lasso-toolbar--html__control" id="lasso-toolbar--html__insert" ><?php _e( 'Insert', 'lasso' );?></a>
237
+		    			<a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e('Cancel', 'lasso'); ?></a>
238
+		    			<a href="#" title="<?php esc_attr_e('Insert HTML', 'lasso'); ?>" class="lasso-toolbar--html__control" id="lasso-toolbar--html__insert" ><?php _e('Insert', 'lasso'); ?></a>
239 239
 		    		</div>
240 240
 		    	</div>
241 241
 		    </li>
242
-			<?php if ( $show_align ): ?>
243
-		    <li id="lasso-toolbar--left-align" title="<?php esc_attr_e( 'Text Left Align', 'lasso' );?>"></li>
244
-		    <li id="lasso-toolbar--center-align" title="<?php esc_attr_e( 'Text Center Align', 'lasso' );?>"></li>
245
-			<li id="lasso-toolbar--right-align" title="<?php esc_attr_e( 'Text Right Align', 'lasso' );?>"></li>
242
+			<?php if ($show_align): ?>
243
+		    <li id="lasso-toolbar--left-align" title="<?php esc_attr_e('Text Left Align', 'lasso'); ?>"></li>
244
+		    <li id="lasso-toolbar--center-align" title="<?php esc_attr_e('Text Center Align', 'lasso'); ?>"></li>
245
+			<li id="lasso-toolbar--right-align" title="<?php esc_attr_e('Text Right Align', 'lasso'); ?>"></li>
246 246
 			<?php endif; ?>
247 247
 		</ul>
248
-		<?php if ( is_singular() && $is_mobile ) { ?>
248
+		<?php if (is_singular() && $is_mobile) { ?>
249 249
 
250
-				<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;">
250
+				<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;">
251 251
 
252
-					<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>
252
+					<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>
253 253
 
254
-					<?php if ( 'draft' == $status && ( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') )  ) { ?>
255
-						<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>
254
+					<?php if ('draft' == $status && (lasso_user_can('publish_posts') || lasso_user_can('publish_pages'))) { ?>
255
+						<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>
256 256
 					<?php } ?>
257 257
 
258 258
 				</div>
@@ -270,22 +270,22 @@  discard block
 block discarded – undo
270 270
  */
271 271
 function lasso_editor_settings_toolbar() {
272 272
 
273
-	$delete_nonce = wp_create_nonce( 'lasso-delete-nonce' );
273
+	$delete_nonce = wp_create_nonce('lasso-delete-nonce');
274 274
 
275 275
 	ob_start();
276 276
 
277
-	if ( !lasso_user_can() )
277
+	if (!lasso_user_can())
278 278
 		return;
279 279
 
280 280
 	// let users add custom css classes
281
-	$custom_classes = apply_filters( 'lasso_component_classes', '' );
281
+	$custom_classes = apply_filters('lasso_component_classes', '');
282 282
 
283 283
 	?>
284
-	<ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false">
285
-		<li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li>
286
-		<li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li>
287
-		<li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li>
288
-		<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>
284
+	<ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false">
285
+		<li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li>
286
+		<li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li>
287
+		<li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li>
288
+		<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>
289 289
 	</ul>
290 290
 
291 291
 	<?php return ob_get_clean();
@@ -301,17 +301,17 @@  discard block
 block discarded – undo
301 301
 
302 302
 	ob_start();
303 303
 
304
-	if ( !lasso_user_can() )
304
+	if (!lasso_user_can())
305 305
 		return;
306 306
 
307 307
 	// has post thumbnail
308
-	$has_thumbnail = has_post_thumbnail( get_the_ID() ) ? 'class="lasso--featImg--has-thumb"' : false;
308
+	$has_thumbnail = has_post_thumbnail(get_the_ID()) ? 'class="lasso--featImg--has-thumb"' : false;
309 309
 
310 310
 	?>
311
-	<ul id="lasso--featImgControls" <?php echo $has_thumbnail;?>>
312
-		<li id="lasso--featImgUpload"><a title="<?php esc_attr_e( 'Replace Image', 'lasso' );?>" href="#"><i class="lasso-icon-image"></i></a></li>
313
-		<li id="lasso--featImgDelete"><a title="<?php esc_attr_e( 'Delete Image', 'lasso' );?>" href="#"><i class="lasso-icon-bin2"></i></a></li>
314
-		<li id="lasso--featImgSave"><a href="#"><?php esc_attr_e( 'save', 'lasso' );?></a></li>
311
+	<ul id="lasso--featImgControls" <?php echo $has_thumbnail; ?>>
312
+		<li id="lasso--featImgUpload"><a title="<?php esc_attr_e('Replace Image', 'lasso'); ?>" href="#"><i class="lasso-icon-image"></i></a></li>
313
+		<li id="lasso--featImgDelete"><a title="<?php esc_attr_e('Delete Image', 'lasso'); ?>" href="#"><i class="lasso-icon-bin2"></i></a></li>
314
+		<li id="lasso--featImgSave"><a href="#"><?php esc_attr_e('save', 'lasso'); ?></a></li>
315 315
 	</ul>
316 316
 
317 317
 	<?php return ob_get_clean();
@@ -330,55 +330,55 @@  discard block
 block discarded – undo
330 330
 
331 331
 	ob_start();
332 332
 
333
-	if ( !lasso_user_can() )
333
+	if (!lasso_user_can())
334 334
 		return;
335 335
 
336 336
 	global $post;
337 337
 
338 338
 	$postid = get_the_ID();
339 339
 
340
-	$status = get_post_status( $postid );
341
-	$nonce = wp_create_nonce( 'lasso-update-post-settings' );
340
+	$status = get_post_status($postid);
341
+	$nonce = wp_create_nonce('lasso-update-post-settings');
342 342
 
343 343
 	// let users add custom css classes
344
-	$custom_classes = apply_filters( 'lasso_modal_settings_classes', '' );
344
+	$custom_classes = apply_filters('lasso_modal_settings_classes', '');
345 345
 
346 346
 	// objects categories
347
-	$categories 		= lasso_get_post_objects( $postid, 'category' );
348
-	$tags 				= lasso_get_post_objects( $postid, 'tag' );
347
+	$categories = lasso_get_post_objects($postid, 'category');
348
+	$tags = lasso_get_post_objects($postid, 'tag');
349 349
 
350 350
 	// modal tabs
351
-	$tabs  				= lasso_modal_addons('tab');
352
-	$content 			= lasso_modal_addons('content');
351
+	$tabs = lasso_modal_addons('tab');
352
+	$content = lasso_modal_addons('content');
353 353
 
354 354
 	// are we singular
355
-	$is_singular 		= is_singular();
355
+	$is_singular = is_singular();
356 356
 	$is_singular_class 	= $is_singular ? 'lasso--postsettings__2col' : 'lasso--postsettings__1col';
357 357
 	$has_thumb_class    = has_post_thumbnail() ? 'has-thumbnail' : 'no-thumbnail';
358 358
 	$theme_supports     = current_theme_supports('post-thumbnails');
359
-	$default_image 		= LASSO_URL.'/admin/assets/img/empty-img.png';
359
+	$default_image = LASSO_URL.'/admin/assets/img/empty-img.png';
360 360
 
361 361
 ?>
362
-	<div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>">
362
+	<div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>">
363 363
 		<div class="lasso--modal__inner">
364 364
 
365
-			<?php if( $tabs ) { echo $tabs; } ?>
365
+			<?php if ($tabs) { echo $tabs; } ?>
366 366
 
367 367
 			<div class="lasso--modal__content modal__content--core visible" data-addon-content="core">
368
-				<form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class;?>" >
368
+				<form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class; ?>" >
369 369
 
370
-					<?php if ( $is_singular && $theme_supports ) : ?>
370
+					<?php if ($is_singular && $theme_supports) : ?>
371 371
 					<div class="lasso--postsettings__left">
372
-						<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>
373
-						<div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url( $default_image );?>">
372
+						<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>
373
+						<div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url($default_image); ?>">
374 374
 
375 375
 							<div id="lasso--post-thumb__controls" class="lasso--post-thumb__controls">
376
-								<i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image','lasso');?>" class="dashicons dashicons-edit"></i>
377
-								<i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image','lasso');?>" class="dashicons dashicons-no-alt"></i>
376
+								<i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image', 'lasso'); ?>" class="dashicons dashicons-edit"></i>
377
+								<i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image', 'lasso'); ?>" class="dashicons dashicons-no-alt"></i>
378 378
 								<i id="lasso--save-status" class="lasso-icon lasso-icon-spinner6 not-visible"></i>
379 379
 							</div>
380 380
 
381
-							<?php echo has_post_thumbnail() ? get_the_post_thumbnail( $post->ID, 'medium' ) : '<img src="'.$default_image.'">'; ?>
381
+							<?php echo has_post_thumbnail() ? get_the_post_thumbnail($post->ID, 'medium') : '<img src="'.$default_image.'">'; ?>
382 382
 
383 383
 						</div>
384 384
 						<div id="lasso--featImgSave"><a href="#" class="not-visible">Save</a></div>
@@ -388,12 +388,12 @@  discard block
 block discarded – undo
388 388
 
389 389
 					<div class="lasso--postsettings__right">
390 390
 
391
-						<?php if( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ): ?>
391
+						<?php if (lasso_user_can('publish_posts') || lasso_user_can('publish_pages')): ?>
392 392
 						<div class="lasso--postsettings__option story-status-option">
393
-							<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>
394
-							<ul class="story-status story-status-<?php echo sanitize_html_class( $status );?>">
395
-								<li id="lasso--status-draft"><?php _e( 'Draft', 'lasso' );?></li>
396
-								<li id="lasso--status-publish"><?php _e( 'Publish', 'lasso' );?></li>
393
+							<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>
394
+							<ul class="story-status story-status-<?php echo sanitize_html_class($status); ?>">
395
+								<li id="lasso--status-draft"><?php _e('Draft', 'lasso'); ?></li>
396
+								<li id="lasso--status-publish"><?php _e('Publish', 'lasso'); ?></li>
397 397
 							</ul>
398 398
 							<div class="lasso--slider_wrap">
399 399
 								<div id="lasso--slider"></div>
@@ -401,10 +401,10 @@  discard block
 block discarded – undo
401 401
 						</div>
402 402
 						<?php endif; ?>
403 403
 
404
-						<?php if ( 'publish' == $status ): ?>
404
+						<?php if ('publish' == $status): ?>
405 405
 						<div class="lasso--postsettings__option story-slug-option">
406
-							<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>
407
-							<input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset( $post ) ? esc_attr( $post->post_name ) : false;?>">
406
+							<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>
407
+							<input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset($post) ? esc_attr($post->post_name) : false; ?>">
408 408
 						</div>
409 409
 						<?php endif; ?>
410 410
 
@@ -413,34 +413,34 @@  discard block
 block discarded – undo
413 413
 					<div class="lasso--postsettings__middle">
414 414
 
415 415
 						<div class="lasso--postsettings__option story-categories-option">
416
-							<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>
417
-							<input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories;?>">
416
+							<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>
417
+							<input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories; ?>">
418 418
 						</div>
419 419
 
420 420
 						<div class="lasso--postsettings__option story-tags-option">
421
-							<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>
422
-							<input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags;?>">
421
+							<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>
422
+							<input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags; ?>">
423 423
 						</div>
424 424
 
425 425
 					</div>
426 426
 
427
-					<?php do_action( 'lasso_modal_post_form' ); // action ?>
427
+					<?php do_action('lasso_modal_post_form'); // action ?>
428 428
 
429 429
 					<div class="lasso--postsettings__footer" >
430
-						<a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a>
430
+						<a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a>
431 431
 						<input type="hidden" name="status" value="">
432 432
 						<input type="hidden" name="categories" value="">
433
-						<input type="hidden" name="postid" value="<?php echo get_the_ID();?>">
433
+						<input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>">
434 434
 						<input type="hidden" name="action" value="process_update-object_post">
435
-						<input type="hidden" name="nonce" value="<?php echo $nonce;?>">
436
-						<?php do_action( 'lasso_modal_post_form_footer' ); // action ?>
437
-						<input type="submit" value="<?php esc_attr_e( 'Save', 'lasso' );?>">
435
+						<input type="hidden" name="nonce" value="<?php echo $nonce; ?>">
436
+						<?php do_action('lasso_modal_post_form_footer'); // action ?>
437
+						<input type="submit" value="<?php esc_attr_e('Save', 'lasso'); ?>">
438 438
 					</div>
439 439
 
440 440
 				</form>
441 441
 			</div>
442 442
 
443
-			<?php if( $tabs ) { echo $content; } ?>
443
+			<?php if ($tabs) { echo $content; } ?>
444 444
 
445 445
 		</div>
446 446
 
@@ -461,44 +461,44 @@  discard block
 block discarded – undo
461 461
 
462 462
 	ob_start();
463 463
 
464
-	if ( !lasso_user_can('edit_posts') )
464
+	if (!lasso_user_can('edit_posts'))
465 465
 		return;
466 466
 
467
-	$status = get_post_status( get_the_ID() );
467
+	$status = get_post_status(get_the_ID());
468 468
 
469
-	$nonce = wp_create_nonce( 'lasso-editor-new-post' );
469
+	$nonce = wp_create_nonce('lasso-editor-new-post');
470 470
 
471 471
 	// let users add custom css classes
472
-	$custom_classes = apply_filters( 'lasso_modal_post_classes', '' );
472
+	$custom_classes = apply_filters('lasso_modal_post_classes', '');
473 473
 
474 474
 	// return the post type
475
-	$type = get_post_type( get_the_ID() );
475
+	$type = get_post_type(get_the_ID());
476 476
 
477 477
 	if (wp_is_mobile()) {
478 478
 		$mobile_style = 'style="top:140px !important;"';
479 479
 	}
480 480
 	?>
481
-	<div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style;?>">
481
+	<div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" <?php echo $mobile_style; ?>">
482 482
 		<div class="lasso--modal__inner">
483 483
 
484 484
 			<form id="lasso--postnew__form" enctype="multipart/form-data" class="lasso--post-form">
485 485
 
486 486
 				<div class="lasso--postsettings__option story-slug-option lasso--last-option">
487
-					<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>
488
-					<input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e( 'Grump Wizards Make Toxic Brew', 'lasso' );?>">
487
+					<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>
488
+					<input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e('Grump Wizards Make Toxic Brew', 'lasso'); ?>">
489 489
 						<div class="lasso--select-wrap" style="width:90px">
490 490
 						<select id="lasso--select-type" name="story_type">
491 491
 
492 492
 							<?php
493 493
 								$types = lasso_post_types();
494 494
 
495
-								if ( !empty( $types ) ) {
495
+								if (!empty($types)) {
496 496
 
497
-									foreach( $types as $type ) {
497
+									foreach ($types as $type) {
498 498
 
499
-										$type = preg_replace( '/s\b/','', $type );
499
+										$type = preg_replace('/s\b/', '', $type);
500 500
 
501
-										printf( '<option value="%s">%s</option>', lcfirst( esc_attr( $type ) ) , ucfirst( esc_attr( $type ) ) );
501
+										printf('<option value="%s">%s</option>', lcfirst(esc_attr($type)), ucfirst(esc_attr($type)));
502 502
 									}
503 503
 
504 504
 								}
@@ -508,12 +508,12 @@  discard block
 block discarded – undo
508 508
 					</div>
509 509
 				</div>
510 510
 
511
-				<div class="lasso--postsettings__footer" style="<?php if (!wp_is_mobile()) {echo 'display:none;';} ?>">
512
-					<a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a>
511
+				<div class="lasso--postsettings__footer" style="<?php if (!wp_is_mobile()) {echo 'display:none;'; } ?>">
512
+					<a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a>
513 513
 					<input type="hidden" name="action" value="process_new-object_post">
514 514
 					<input type="hidden" name="object" value="post">
515
-					<input type="hidden" name="nonce" value="<?php echo $nonce;?>">
516
-					<input type="submit" value="<?php esc_attr_e( 'Create', 'lasso' );?>">
515
+					<input type="hidden" name="nonce" value="<?php echo $nonce; ?>">
516
+					<input type="submit" value="<?php esc_attr_e('Create', 'lasso'); ?>">
517 517
 				</div>
518 518
 
519 519
 			</form>
@@ -541,18 +541,18 @@  discard block
 block discarded – undo
541 541
 	ob_start();
542 542
 
543 543
 	// post status
544
-	$status = get_post_status( get_the_ID() );
544
+	$status = get_post_status(get_the_ID());
545 545
 
546 546
 	// let users add custom css classes
547
-	$custom_classes = apply_filters( 'lasso_modal_all_post_classes', '' );
547
+	$custom_classes = apply_filters('lasso_modal_all_post_classes', '');
548 548
 
549 549
 	?>
550
-	<div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" style="max-height:100%">
550
+	<div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" style="max-height:100%">
551 551
 		<div class="lasso--modal__inner">
552 552
 
553 553
 			<div class="lasso--post-filtering not-visible">
554 554
 				<div class="lasso--search__results">
555
-					<span id="lasso--results-found"></span><?php _e('results found','lasso');?>
555
+					<span id="lasso--results-found"></span><?php _e('results found', 'lasso'); ?>
556 556
 				</div>
557 557
 				<div class="lasso--search">
558 558
 					<i id="lasso--search__toggle" class="dashicons dashicons-search"></i>
@@ -566,16 +566,16 @@  discard block
 block discarded – undo
566 566
 				$post_types = lasso_post_types_names();
567 567
 				$rest_bases = lasso_post_types_rest_base();
568 568
 
569
-				if ( ! empty( $post_types ) ) {
569
+				if (!empty($post_types)) {
570 570
 					$first = 'active';
571
-					foreach( $post_types as $name => $label ) {
572
-						printf( '<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr( $first), esc_attr( $rest_bases[$name] ), esc_attr( $label ) );
571
+					foreach ($post_types as $name => $label) {
572
+						printf('<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr($first), esc_attr($rest_bases[$name]), esc_attr($label));
573 573
 						$first = '';
574 574
 					}
575 575
 
576 576
 				}
577 577
 
578
-				do_action('lasso_modal_post_objects');?>
578
+				do_action('lasso_modal_post_objects'); ?>
579 579
 
580 580
 			</ul>
581 581
 			<div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div>
@@ -593,18 +593,18 @@  discard block
 block discarded – undo
593 593
 
594 594
 	ob_start();
595 595
 
596
-	if ( !lasso_user_can() )
596
+	if (!lasso_user_can())
597 597
 		return;
598 598
 
599 599
 	// let users add custom css classes
600
-	$custom_classes = apply_filters( 'lasso_wpimg_classes', '' );
600
+	$custom_classes = apply_filters('lasso_wpimg_classes', '');
601 601
 
602 602
 	?>
603
-	<ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false">
604
-		<li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li>
605
-		<li id="lasso--wpimg-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li>
606
-		<li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li>
607
-		<li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li>
603
+	<ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false">
604
+		<li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li>
605
+		<li id="lasso--wpimg-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li>
606
+		<li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li>
607
+		<li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li>
608 608
 	</ul>
609 609
 
610 610
 	<?php return ob_get_clean();
@@ -614,18 +614,18 @@  discard block
 block discarded – undo
614 614
 
615 615
 	ob_start();
616 616
 
617
-	if ( !lasso_user_can() )
617
+	if (!lasso_user_can())
618 618
 		return;
619 619
 
620 620
 	// let users add custom css classes
621
-	$custom_classes = apply_filters( 'lasso_wpimg_classes', '' );
621
+	$custom_classes = apply_filters('lasso_wpimg_classes', '');
622 622
 
623 623
 	?>
624
-	<ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false">
625
-		<li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li>
626
-		<li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li>
627
-		<li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li>
628
-		<li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li>
624
+	<ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false">
625
+		<li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li>
626
+		<li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li>
627
+		<li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li>
628
+		<li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li>
629 629
 	</ul>
630 630
 
631 631
 	<?php return ob_get_clean();
@@ -638,16 +638,16 @@  discard block
 block discarded – undo
638 638
  */
639 639
 function lasso_map_form_footer() {
640 640
 
641
-	$nonce = wp_create_nonce( 'lasso-process-map' );
641
+	$nonce = wp_create_nonce('lasso-process-map');
642 642
 
643 643
 	ob_start();
644 644
 
645 645
 	?>
646 646
 	<div class="lasso--map-form__footer">
647
-		<input type="hidden" name="postid" value="<?php echo get_the_ID();?>">
648
-		<input type="hidden" name="nonce" value="<?php echo $nonce;?>">
647
+		<input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>">
648
+		<input type="hidden" name="nonce" value="<?php echo $nonce; ?>">
649 649
 		<input type="hidden" name="action" value="process_map_save">
650
-		<input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e( 'Save Locations', 'lasso' );?>">
650
+		<input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e('Save Locations', 'lasso'); ?>">
651 651
 	</div>
652 652
 
653 653
 	<?php return ob_get_clean();
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
 
666 666
 	?>
667 667
 	<div id="lasso--pagerefresh" class="visible">
668
-		<?php _e( 'Save this post and refesh the page to see these changes.', 'lasso' );?>
668
+		<?php _e('Save this post and refesh the page to see these changes.', 'lasso'); ?>
669 669
 	</div>
670 670
 
671 671
 	<?php return ob_get_clean();
@@ -679,43 +679,43 @@  discard block
 block discarded – undo
679 679
  */
680 680
 function lasso_editor_options_blob() {
681 681
 
682
-	$codes   = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : apply_filters( 'lasso_custom_options', '' );
683
-	$galleries  = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery';
682
+	$codes = function_exists('aesop_shortcodes') ? aesop_shortcodes() : apply_filters('lasso_custom_options', '');
683
+	$galleries = function_exists('lasso_editor_galleries_exist') && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery';
684 684
 
685
-	$nonce = wp_create_nonce( 'lasso_gallery' );
685
+	$nonce = wp_create_nonce('lasso_gallery');
686 686
 
687 687
 	$blob = array();
688 688
 
689
-	if ( empty( $codes ) )
689
+	if (empty($codes))
690 690
 		return;
691 691
 
692
-	foreach ( $codes as $slug => $shortcode ) {
692
+	foreach ($codes as $slug => $shortcode) {
693 693
 		$return = '';
694 694
 		// Shortcode has atts
695 695
 
696
-		if ( count( $shortcode['atts'] ) && $shortcode['atts'] ) {
696
+		if (count($shortcode['atts']) && $shortcode['atts']) {
697 697
 
698
-			foreach ( $shortcode['atts'] as $attr_name => $attr_info ) {
698
+			foreach ($shortcode['atts'] as $attr_name => $attr_info) {
699 699
 
700 700
 
701
-				$prefix = isset( $attr_info['prefix'] ) ? sprintf( '<span class="lasso-option-prefix">%s</span>', $attr_info['prefix'] ) : null;
701
+				$prefix = isset($attr_info['prefix']) ? sprintf('<span class="lasso-option-prefix">%s</span>', $attr_info['prefix']) : null;
702 702
 
703 703
 				$return .= '<form id="lasso--component-settings-form" class="'.$galleries.'" method="post">';
704 704
 				$return .= '<p data-option="'.$attr_name.'" class="lasso-option lasso-'.$slug.'-'.$attr_name.'">';
705
-				$return .= '<label for="lasso-generator-attr-' . $attr_name . '">' . $attr_info['desc'] . '</label>';
705
+				$return .= '<label for="lasso-generator-attr-'.$attr_name.'">'.$attr_info['desc'].'</label>';
706 706
 				$return .= '<small class="lasso-option-desc">'.$attr_info['tip'].'</small>';
707 707
 				// Select
708 708
 
709
-				if ( isset( $attr_info['values'] ) ) {
709
+				if (isset($attr_info['values'])) {
710 710
 
711
-					$return .= '<select name="' . $attr_name . '" id="lasso-generator-attr-' . $attr_name . '" class="lasso-generator-attr">';
711
+					$return .= '<select name="'.$attr_name.'" id="lasso-generator-attr-'.$attr_name.'" class="lasso-generator-attr">';
712 712
 
713
-					$i=0;
713
+					$i = 0;
714 714
 
715
-					foreach ( $attr_info['values'] as $attr_value ) {
715
+					foreach ($attr_info['values'] as $attr_value) {
716 716
 						$attr_value_selected = $attr_info['default'] == $attr_value ? ' selected="selected"' : '';
717 717
 
718
-						$return .= '<option value="'.$attr_info['values'][$i]['value'].'" ' . $attr_value_selected . '>'.$attr_info['values'][$i]['name'].'</option>';
718
+						$return .= '<option value="'.$attr_info['values'][$i]['value'].'" '.$attr_value_selected.'>'.$attr_info['values'][$i]['name'].'</option>';
719 719
 
720 720
 						$i++;
721 721
 					}
@@ -724,24 +724,24 @@  discard block
 block discarded – undo
724 724
 
725 725
 				} else {
726 726
 
727
-					$attr_field_type = isset( $attr_info['type'] ) ? $attr_info['type'] : 'text';
727
+					$attr_field_type = isset($attr_info['type']) ? $attr_info['type'] : 'text';
728 728
 
729 729
 					// image upload
730
-					if ( 'media_upload' == $attr_info['type'] ) {
730
+					if ('media_upload' == $attr_info['type']) {
731 731
 
732
-						$return .= '<input type="' . $attr_field_type . '" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="lasso-generator-attr-' . $attr_name . '" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" />';
732
+						$return .= '<input type="'.$attr_field_type.'" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="lasso-generator-attr-'.$attr_name.'" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" />';
733 733
 						$return .= '<a href="#" id="lasso-upload-img" class="lasso-option-button" /></a>';
734 734
 
735
-					} elseif ( 'color' == $attr_info['type'] ) {
735
+					} elseif ('color' == $attr_info['type']) {
736 736
 
737
-						$return .= '<input type="color" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="lasso-generator-attr-' . $attr_name . '" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" />';
737
+						$return .= '<input type="color" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="lasso-generator-attr-'.$attr_name.'" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" />';
738 738
 
739
-					} elseif ( 'text_area' == $attr_info['type'] ) {
739
+					} elseif ('text_area' == $attr_info['type']) {
740 740
 
741
-						$return .= '<textarea name="' . $attr_name . '" id="lasso-generator-attr-' . $attr_name . '" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" placeholder="'.$attr_info['default'].'" /></textarea>'.$prefix.'';
741
+						$return .= '<textarea name="'.$attr_name.'" id="lasso-generator-attr-'.$attr_name.'" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" placeholder="'.$attr_info['default'].'" /></textarea>'.$prefix.'';
742 742
 
743 743
 					} else {
744
-						$return .= '<input type="' . $attr_field_type . '" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="lasso-generator-attr-' . $attr_name . '" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" />'.$prefix.'';
744
+						$return .= '<input type="'.$attr_field_type.'" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="lasso-generator-attr-'.$attr_name.'" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" />'.$prefix.'';
745 745
 					}
746 746
 				}
747 747
 				$return .= '</p>';
@@ -752,9 +752,9 @@  discard block
 block discarded – undo
752 752
 		///////////////////////////
753 753
 		// START GALLERY AND MAP FRONT END STUFFS
754 754
 		///////////////////////////
755
-		if ( isset( $shortcode['front'] ) && true == $shortcode['front'] ) {
755
+		if (isset($shortcode['front']) && true == $shortcode['front']) {
756 756
 
757
-			if ( 'gallery' == $shortcode['front_type'] ) {
757
+			if ('gallery' == $shortcode['front_type']) {
758 758
 
759 759
 				$return .= lasso_gallery_editor_module();
760 760
 
@@ -765,13 +765,13 @@  discard block
 block discarded – undo
765 765
 		///////////////////////////
766 766
 
767 767
 		// Single shortcode (not closed)
768
-		if ( 'single' == $shortcode['type'] ) {
768
+		if ('single' == $shortcode['type']) {
769 769
 
770 770
 			$return .= '<input type="hidden" name="lasso-generator-content" id="lasso-generator-content" value="false" />';
771 771
 
772 772
 		} else {
773 773
 
774
-			$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>';
774
+			$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>';
775 775
 		}
776 776
 
777 777
 		$return .= '<p class="lasso-buttoninsert-wrap"><a href="#" class="lasso-generator-cancel" id="lasso--sidebar__close">Cancel
@@ -804,7 +804,7 @@  discard block
 block discarded – undo
804 804
 				<div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div>
805 805
 				<div id="lasso--hide" style="display:none;" class="lasso--post-form">
806 806
 					<i class="lasso-icon lasso-icon-move"></i>
807
-					<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>
807
+					<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>
808 808
 					<div class="lasso--slider_wrap">
809 809
 						<div id="lasso--slider"></div>
810 810
 					</div>
Please login to merge, or discard this patch.
public/includes/helpers.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 		'public' => true,
244 244
 	), 'objects' );
245 245
 	$post_types = array_combine( array_keys( $post_types ), wp_list_pluck( $post_types, 'label' ) );
246
-    unset( $post_types[ 'attachment' ] );
246
+	unset( $post_types[ 'attachment' ] );
247 247
 
248 248
 	/**
249 249
 	 * Set which post types are allowed
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 	$post_types = get_post_types( array(
271 271
 		'public' => true,
272 272
 	), 'names' );
273
-    unset( $post_types[ 'attachment' ] );
273
+	unset( $post_types[ 'attachment' ] );
274 274
 
275 275
 	/**
276 276
 	 * Set which post types are allowed
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
  */
383 383
 if ( !function_exists( 'lasso_user_can' ) ):
384 384
 	function lasso_user_can( $action = '', $postid = 0 ) {
385
-        $result = false;
385
+		$result = false;
386 386
 		if ( empty( $action ) )
387 387
 			$action = 'edit_posts';
388 388
 
@@ -397,17 +397,17 @@  discard block
 block discarded – undo
397 397
 				$allowed_post_types = array_diff($allowed_post_types,array('page'));
398 398
 			}
399 399
 			
400
-            if (!empty($allowed_post_types) && !empty($postid)) {
400
+			if (!empty($allowed_post_types) && !empty($postid)) {
401 401
 				$type = get_post_type( $postid );
402
-                $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
402
+				$allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
403 403
 				
404
-                if ( in_array( $type, $allowed_post_types ) ) {
404
+				if ( in_array( $type, $allowed_post_types ) ) {
405 405
 				   $result =  true;
406
-			    }
407
-            } else {
408
-                //we are not checking against a post, return true
406
+				}
407
+			} else {
408
+				//we are not checking against a post, return true
409 409
 				$result =  true;
410
-        	}
410
+			}
411 411
 		} else {
412 412
 			$result = false;
413 413
 		}
Please login to merge, or discard this patch.
Spacing   +82 added lines, -82 removed lines patch added patch discarded remove patch
@@ -12,21 +12,21 @@  discard block
 block discarded – undo
12 12
  * @return the option value
13 13
  * @since 1.0
14 14
  */
15
-function lasso_editor_get_option( $option, $section, $default = '' ) {
15
+function lasso_editor_get_option($option, $section, $default = '') {
16 16
 
17
-	if ( empty( $option ) )
17
+	if (empty($option))
18 18
 		return;
19 19
 
20
-	if ( function_exists( 'is_multisite' ) && is_multisite() ) {
20
+	if (function_exists('is_multisite') && is_multisite()) {
21 21
 
22
-		$options = get_site_option( $section );
22
+		$options = get_site_option($section);
23 23
 
24 24
 	} else {
25 25
 
26
-		$options = get_option( $section );
26
+		$options = get_option($section);
27 27
 	}
28 28
 
29
-	if ( isset( $options[$option] ) ) {
29
+	if (isset($options[$option])) {
30 30
 		return $options[$option];
31 31
 	}
32 32
 
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
  */
41 41
 function lasso_editor_galleries_exist() {
42 42
 
43
-	$q = new wp_query( array( 'post_type' => 'ai_galleries', 'post_status' => 'publish' ) );
43
+	$q = new wp_query(array('post_type' => 'ai_galleries', 'post_status' => 'publish'));
44 44
 
45
-	if ( $q->have_posts() )
45
+	if ($q->have_posts())
46 46
 		return true;
47 47
 	else
48 48
 		return false;
@@ -57,9 +57,9 @@  discard block
 block discarded – undo
57 57
 function lasso_get_supported_theme_class() {
58 58
 
59 59
 	$name  	= wp_get_theme()->get('Name');
60
-	$slug  	= lasso_clean_string( $name );
60
+	$slug  	= lasso_clean_string($name);
61 61
 
62
-	switch ( $slug ) {
62
+	switch ($slug) {
63 63
 		case 'aesop-story-theme': // aesop
64 64
 			$out = '.aesop-entry-content';
65 65
 			break;
@@ -108,16 +108,16 @@  discard block
 block discarded – undo
108 108
 
109 109
 	}
110 110
 
111
-	return apply_filters('lasso_content_class', !empty( $out ) ? $out : false);
111
+	return apply_filters('lasso_content_class', !empty($out) ? $out : false);
112 112
 	//return !empty( $out ) ? $out : false;
113 113
 }
114 114
 
115 115
 function lasso_get_supported_theme_title_class() {
116 116
 
117 117
 	$name  	= wp_get_theme()->get('Name');
118
-	$slug  	= lasso_clean_string( $name );
118
+	$slug  	= lasso_clean_string($name);
119 119
 
120
-	switch ( $slug ) {
120
+	switch ($slug) {
121 121
 
122 122
 		case 'aesop-story-theme': // aesop
123 123
 			$out = '.aesop-entry-title';
@@ -145,16 +145,16 @@  discard block
 block discarded – undo
145 145
 			break;
146 146
 	}
147 147
 
148
-	return apply_filters('lasso_title_class', !empty( $out ) ? $out : false);
148
+	return apply_filters('lasso_title_class', !empty($out) ? $out : false);
149 149
 }
150 150
 
151 151
 //since 0.9.9.6
152 152
 function lasso_get_supported_theme_featured_image_class() {
153 153
 
154 154
 	$name  	= wp_get_theme()->get('Name');
155
-	$slug  	= lasso_clean_string( $name );
155
+	$slug  	= lasso_clean_string($name);
156 156
 
157
-	return apply_filters('lasso_featured_image_class', !empty( $out ) ? $out : false);
157
+	return apply_filters('lasso_featured_image_class', !empty($out) ? $out : false);
158 158
 }
159 159
 
160 160
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 *	@since 0.8.7
166 166
 *	@return string of comma separated classes
167 167
 */
168
-function lasso_supported_no_save(){
168
+function lasso_supported_no_save() {
169 169
 
170 170
 	return apply_filters('lasso_dont_save', '.lasso--ignore, .sharedaddy, .us_wrapper, .twitter-tweet, .meta, .edit-link, .ssba, .jp-relatedposts, .fb-comments');
171 171
 }
@@ -179,8 +179,8 @@  discard block
 block discarded – undo
179 179
  *
180 180
  * @return array|mixed|object|string|void
181 181
  */
182
-function lasso_sanitize_data( $data ) {
183
-	return \lasso\sanatize::do_sanitize( $data );
182
+function lasso_sanitize_data($data) {
183
+	return \lasso\sanatize::do_sanitize($data);
184 184
 
185 185
 }
186 186
 
@@ -190,18 +190,18 @@  discard block
 block discarded – undo
190 190
  *	@since 0.9.3
191 191
  *	@return string of comma delimited category slugs
192 192
 */
193
-function lasso_get_post_objects( $postid = '', $taxonomy = 'category') {
193
+function lasso_get_post_objects($postid = '', $taxonomy = 'category') {
194 194
 
195
-	if ( empty( $postid ) )
195
+	if (empty($postid))
196 196
 		$postid = get_the_ID();
197 197
 
198
-	$objects = 'category' == $taxonomy ? get_the_category( $postid ) : get_the_tags( $postid );
198
+	$objects = 'category' == $taxonomy ? get_the_category($postid) : get_the_tags($postid);
199 199
 
200
-	if ( empty( $objects) )
200
+	if (empty($objects))
201 201
 		return;
202 202
 
203 203
 	$out = '';
204
-	foreach( $objects as $object ) {
204
+	foreach ($objects as $object) {
205 205
 		//$out .= $object->slug.', ';
206 206
 		$out .= $object->name.', ';
207 207
 	}
@@ -216,15 +216,15 @@  discard block
 block discarded – undo
216 216
  *	@since 0.9.3
217 217
  *	@return array all categoiries
218 218
 */
219
-function lasso_get_objects( $taxonomy = 'category' ) {
219
+function lasso_get_objects($taxonomy = 'category') {
220 220
 
221 221
 	$objects = 'category' == $taxonomy ? get_categories(array('hide_empty' => 0)) : get_tags(array('hide_empty' => 0));
222 222
 
223
-	if ( empty( $objects) )
223
+	if (empty($objects))
224 224
 		return;
225 225
 
226 226
 	$out = "";
227
-	foreach( $objects as $object ) {
227
+	foreach ($objects as $object) {
228 228
 		$out .= $object->name.',';
229 229
 	}
230 230
 
@@ -239,11 +239,11 @@  discard block
 block discarded – undo
239 239
  * @since 0.9.4
240 240
  */
241 241
 function lasso_post_types_names() {
242
-	$post_types = get_post_types( array(
242
+	$post_types = get_post_types(array(
243 243
 		'public' => true,
244
-	), 'objects' );
245
-	$post_types = array_combine( array_keys( $post_types ), wp_list_pluck( $post_types, 'label' ) );
246
-    unset( $post_types[ 'attachment' ] );
244
+	), 'objects');
245
+	$post_types = array_combine(array_keys($post_types), wp_list_pluck($post_types, 'label'));
246
+    unset($post_types['attachment']);
247 247
 
248 248
 	/**
249 249
 	 * Set which post types are allowed
@@ -252,14 +252,14 @@  discard block
 block discarded – undo
252 252
 	 *
253 253
 	 * @param array $allowed_post_types Array of names (not labels) of allowed post types. Must be registered.
254 254
 	 */
255
-	$allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( 'post', 'page') );
256
-	$allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
255
+	$allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array('post', 'page'));
256
+	$allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types);
257 257
 	if (!current_user_can('edit_pages')) {
258
-		$allowed_post_types = array_diff($allowed_post_types,array('page'));
258
+		$allowed_post_types = array_diff($allowed_post_types, array('page'));
259 259
 	}
260
-	foreach( $post_types as $name => $label ) {
261
-		if ( ! in_array( $name, $allowed_post_types ) ) {
262
-			unset( $post_types[ $name ] );
260
+	foreach ($post_types as $name => $label) {
261
+		if (!in_array($name, $allowed_post_types)) {
262
+			unset($post_types[$name]);
263 263
 		}
264 264
 	}
265 265
 	return $post_types;
@@ -267,10 +267,10 @@  discard block
 block discarded – undo
267 267
 
268 268
 
269 269
 function lasso_post_types() {
270
-	$post_types = get_post_types( array(
270
+	$post_types = get_post_types(array(
271 271
 		'public' => true,
272
-	), 'names' );
273
-    unset( $post_types[ 'attachment' ] );
272
+	), 'names');
273
+    unset($post_types['attachment']);
274 274
 
275 275
 	/**
276 276
 	 * Set which post types are allowed
@@ -279,11 +279,11 @@  discard block
 block discarded – undo
279 279
 	 *
280 280
 	 * @param array $allowed_post_types Array of names (not labels) of allowed post types. Must be registered.
281 281
 	 */
282
-	$allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( 'post') );
283
-	$allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
284
-	foreach( $post_types as $name => $label ) {
285
-		if ( ! in_array( $name, $allowed_post_types ) ) {
286
-			unset( $post_types[ $name ] );
282
+	$allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array('post'));
283
+	$allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types);
284
+	foreach ($post_types as $name => $label) {
285
+		if (!in_array($name, $allowed_post_types)) {
286
+			unset($post_types[$name]);
287 287
 		}
288 288
 	}
289 289
 	return $post_types;
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
 	global $wp_post_types;
294 294
 	$post_types = lasso_post_types();
295 295
 	$rest_base = array();
296
-	foreach ( $post_types as $post_type) {
296
+	foreach ($post_types as $post_type) {
297 297
 		$rest_base[$post_type] = $wp_post_types[$post_type]->rest_base;
298 298
 	}
299 299
     
@@ -311,22 +311,22 @@  discard block
 block discarded – undo
311 311
 *	@uses lasso_modal_addons()
312 312
 *	@since 0.9.4
313 313
 */
314
-function lasso_modal_addons_content( $tab = '', $type ){
314
+function lasso_modal_addons_content($tab = '', $type) {
315 315
 
316
-	$name = lasso_clean_string( $tab['name'] );
316
+	$name = lasso_clean_string($tab['name']);
317 317
 
318
-	if ( 'tab' == $type ) {
318
+	if ('tab' == $type) {
319 319
 
320
-		$out = sprintf( '<li data-addon-name="%s">%s</li>', $name, $tab['name'] );
320
+		$out = sprintf('<li data-addon-name="%s">%s</li>', $name, $tab['name']);
321 321
 
322
-	} else if ( 'content' == $type ){
322
+	} else if ('content' == $type) {
323 323
 
324
-		$content = isset( $tab['content'] ) && is_callable( $tab['content'] ) ? call_user_func( $tab['content'] ) : false;
325
-		$options = isset( $tab['options'] ) && is_callable( $tab['options'] ) ? call_user_func( $tab['options'] ) : false;
324
+		$content = isset($tab['content']) && is_callable($tab['content']) ? call_user_func($tab['content']) : false;
325
+		$options = isset($tab['options']) && is_callable($tab['options']) ? call_user_func($tab['options']) : false;
326 326
 
327
-		$out = sprintf( '<div class="lasso--modal__content not-visible" data-addon-content="%s">
327
+		$out = sprintf('<div class="lasso--modal__content not-visible" data-addon-content="%s">
328 328
 			%s%s
329
-			</div>', $name, $content, lasso_option_form( $name, $options ) );
329
+			</div>', $name, $content, lasso_option_form($name, $options));
330 330
 
331 331
 	}
332 332
 
@@ -341,12 +341,12 @@  discard block
 block discarded – undo
341 341
 *
342 342
 * @return void|string
343 343
 */
344
-function lasso_clean_string( $string = '' ) {
344
+function lasso_clean_string($string = '') {
345 345
 
346
-	if ( empty( $string ) )
346
+	if (empty($string))
347 347
 		return;
348 348
 
349
-	return sanitize_text_field( strtolower( preg_replace('/[\s_]/', '-', $string ) ) );
349
+	return sanitize_text_field(strtolower(preg_replace('/[\s_]/', '-', $string)));
350 350
 }
351 351
 
352 352
 /**
@@ -359,13 +359,13 @@  discard block
 block discarded – undo
359 359
  *
360 360
  * @return void|string
361 361
  */
362
-function lasso_unclean_string( $string = '' ) {
362
+function lasso_unclean_string($string = '') {
363 363
 
364
-	if ( empty( $string ) ) {
364
+	if (empty($string)) {
365 365
 		return;
366 366
 	}
367 367
 
368
-	return sanitize_text_field( strtolower( str_replace( '-', '_', $string ) ) );
368
+	return sanitize_text_field(strtolower(str_replace('-', '_', $string)));
369 369
 }
370 370
 
371 371
 
@@ -380,39 +380,39 @@  discard block
 block discarded – undo
380 380
  * @param unknown $postid int the id of the post object to check against
381 381
  * @since 0.9.9.7 added filter 'lasso_user_can_filter'
382 382
  */
383
-if ( !function_exists( 'lasso_user_can' ) ):
384
-	function lasso_user_can( $action = '', $postid = 0 ) {
383
+if (!function_exists('lasso_user_can')):
384
+	function lasso_user_can($action = '', $postid = 0) {
385 385
         $result = false;
386
-		if ( empty( $action ) )
386
+		if (empty($action))
387 387
 			$action = 'edit_posts';
388 388
 
389
-		if ( empty( $postid ) )
389
+		if (empty($postid))
390 390
 			$postid = get_the_ID();
391 391
 
392
-		if ( is_user_logged_in() && current_user_can( $action, $postid ) ) {
392
+		if (is_user_logged_in() && current_user_can($action, $postid)) {
393 393
 			// check against post types:
394
-			$allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( 'post', 'page') );
394
+			$allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array('post', 'page'));
395 395
 			
396 396
 			if (!current_user_can('edit_pages')) {
397
-				$allowed_post_types = array_diff($allowed_post_types,array('page'));
397
+				$allowed_post_types = array_diff($allowed_post_types, array('page'));
398 398
 			}
399 399
 			
400 400
             if (!empty($allowed_post_types) && !empty($postid)) {
401
-				$type = get_post_type( $postid );
402
-                $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
401
+				$type = get_post_type($postid);
402
+                $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types);
403 403
 				
404
-                if ( in_array( $type, $allowed_post_types ) ) {
405
-				   $result =  true;
404
+                if (in_array($type, $allowed_post_types)) {
405
+				   $result = true;
406 406
 			    }
407 407
             } else {
408 408
                 //we are not checking against a post, return true
409
-				$result =  true;
409
+				$result = true;
410 410
         	}
411 411
 		} else {
412 412
 			$result = false;
413 413
 		}
414 414
 		
415
-		return apply_filters( 'lasso_user_can_filter', $result,  $action, $postid);
415
+		return apply_filters('lasso_user_can_filter', $result, $action, $postid);
416 416
 	}
417 417
 endif;
418 418
 
@@ -421,25 +421,25 @@  discard block
 block discarded – undo
421 421
 *
422 422
 *	@since 0.9.5
423 423
 */
424
-if ( !function_exists('lasso_editor_empty_results') ):
424
+if (!function_exists('lasso_editor_empty_results')):
425 425
 
426
-	function lasso_editor_empty_results( $type = 'posts' ){
426
+	function lasso_editor_empty_results($type = 'posts') {
427 427
 
428
-		if ( 'posts' == $type ) {
428
+		if ('posts' == $type) {
429 429
 
430
-			$string = apply_filters('lasso_empty_state_message', __('No posts to show', 'lasso') );
430
+			$string = apply_filters('lasso_empty_state_message', __('No posts to show', 'lasso'));
431 431
 			$icon = 'lasso-icon-file-text2';
432 432
 			$button = false;
433 433
 
434
-		} elseif ( 'revision' == $type ) {
434
+		} elseif ('revision' == $type) {
435 435
 
436
-			$string = apply_filters('lasso_empty_state_message', __('No revisions found', 'lasso') );
436
+			$string = apply_filters('lasso_empty_state_message', __('No revisions found', 'lasso'));
437 437
 			$icon = 'lasso-icon-history';
438
-			$button = sprintf('<a href="#" class="lasso--btn-secondary" id="lasso--close-modal">%s</a>', __('Close','lasso') );
438
+			$button = sprintf('<a href="#" class="lasso--btn-secondary" id="lasso--close-modal">%s</a>', __('Close', 'lasso'));
439 439
 
440 440
 		}
441 441
 
442
-		return sprintf('<div id="lasso--empty-state" class="lasso--empty-state"><i class="lasso--empty-state-icon lasso-icon %s"></i><p>%s</p>%s</div>', $icon, $string, $button );
442
+		return sprintf('<div id="lasso--empty-state" class="lasso--empty-state"><i class="lasso--empty-state-icon lasso-icon %s"></i><p>%s</p>%s</div>', $icon, $string, $button);
443 443
 	}
444 444
 
445 445
 endif;
Please login to merge, or discard this patch.