Completed
Push — master ( 8d9355...4de7f8 )
by
unknown
01:45
created
admin/includes/menus/settings.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -98,8 +98,8 @@  discard block
 block discarded – undo
98 98
 		if ( !is_user_logged_in() )
99 99
 			return;
100 100
         
101
-        // check for lasso story engine and add a class doniting this
102
-        $ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active';
101
+		// check for lasso story engine and add a class doniting this
102
+		$ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active';
103 103
 
104 104
 		$article_object   = lasso_editor_get_option( 'article_class', 'lasso_editor' );
105 105
 		$featImgClass    = lasso_editor_get_option( 'featimg_class', 'lasso_editor' );
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 		$edit_post_disabled  = lasso_editor_get_option( 'post_edit_disabled', 'lasso_editor' );
111 111
 		$post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' );
112 112
 		$allow_change_date = lasso_editor_get_option( 'allow_change_date', 'lasso_editor' );
113
-        $allow_edit_excerpt = lasso_editor_get_option( 'allow_edit_excerpt', 'lasso_editor' );
113
+		$allow_edit_excerpt = lasso_editor_get_option( 'allow_edit_excerpt', 'lasso_editor' );
114 114
 		$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
115 115
 		$shortcodify_disabled  = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' );
116 116
 		$enable_autosave  = lasso_editor_get_option( 'enable_autosave', 'lasso_editor' );
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 		$bold_tag = lasso_editor_get_option( 'bold_tag', 'lasso_editor',  "b");
136 136
 		$i_tag = lasso_editor_get_option( 'i_tag', 'lasso_editor',  "i");
137 137
         
138
-        $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
138
+		$add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
139 139
 		
140 140
 		// do we support pending status
141 141
 		$no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor');
@@ -147,10 +147,10 @@  discard block
 block discarded – undo
147 147
 			$insert_comp_ui = 'drag';
148 148
 		}
149 149
         
150
-        $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor');
150
+		$link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor');
151 151
         
152
-        $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
153
-        $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
152
+		$use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
153
+		$use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
154 154
 
155 155
 ?>
156 156
 		<div class="wrap">
Please login to merge, or discard this patch.
Spacing   +172 added lines, -172 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@  discard block
 block discarded – undo
9 9
 
10 10
 	function __construct() {
11 11
 
12
-		add_action( 'admin_menu',     array( $this, 'menu' ) );
13
-		add_action( 'network_admin_menu',   array( $this, 'menu' ) );
14
-		add_action( 'wp_ajax_lasso-editor-settings', array( $this, 'process_settings' ) );
12
+		add_action('admin_menu', array($this, 'menu'));
13
+		add_action('network_admin_menu', array($this, 'menu'));
14
+		add_action('wp_ajax_lasso-editor-settings', array($this, 'process_settings'));
15 15
 
16 16
 	}
17 17
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	function menu() {
24 24
 
25 25
 		// CHANGED Removed condition.
26
-		add_submenu_page( 'lasso-editor', __( 'Settings', 'lasso' ), __( 'Settings', 'lasso' ), 'manage_options', 'lasso-editor-settings', array( $this, 'settings' ) );
26
+		add_submenu_page('lasso-editor', __('Settings', 'lasso'), __('Settings', 'lasso'), 'manage_options', 'lasso-editor-settings', array($this, 'settings'));
27 27
 
28 28
 	}
29 29
 
@@ -45,26 +45,26 @@  discard block
 block discarded – undo
45 45
 	function process_settings() {
46 46
 
47 47
 		// bail out if current user isn't and administrator and they are not logged in
48
-		if ( !current_user_can( 'manage_options' ) || !is_user_logged_in() )
48
+		if (!current_user_can('manage_options') || !is_user_logged_in())
49 49
 			return;
50 50
 
51
-		if ( isset( $_POST['action'] ) && 'lasso-editor-settings' == $_POST['action'] && check_admin_referer( 'nonce', 'lasso_editor_settings' ) ) {
51
+		if (isset($_POST['action']) && 'lasso-editor-settings' == $_POST['action'] && check_admin_referer('nonce', 'lasso_editor_settings')) {
52 52
 
53
-			$options = isset( $_POST['lasso_editor'] ) ? $_POST['lasso_editor'] : false;
53
+			$options = isset($_POST['lasso_editor']) ? $_POST['lasso_editor'] : false;
54 54
 			
55 55
 			$arr = $options['allowed_post_types'];
56
-			$options = array_map( 'sanitize_text_field', $options );
57
-			$options['allowed_post_types'] = array_keys( $arr);
56
+			$options = array_map('sanitize_text_field', $options);
57
+			$options['allowed_post_types'] = array_keys($arr);
58 58
 
59 59
 			
60 60
 
61
-			if ( function_exists( 'is_multisite' ) && is_multisite() ) {
61
+			if (function_exists('is_multisite') && is_multisite()) {
62 62
 
63
-				update_site_option( 'lasso_editor', $options );
63
+				update_site_option('lasso_editor', $options);
64 64
 
65 65
 			} else {
66 66
 
67
-				update_option( 'lasso_editor', $options );
67
+				update_option('lasso_editor', $options);
68 68
 			}
69 69
 
70 70
 			wp_send_json_success();
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 	}
81 81
 	
82 82
 	function create_section_for_color_picker($id, $title, $defvalue) { 
83
-		$color_value = lasso_editor_get_option( $id, 'lasso_editor',$defvalue );
83
+		$color_value = lasso_editor_get_option($id, 'lasso_editor', $defvalue);
84 84
 	 
85 85
 		echo '<div lass="lasso-editor-settings--option-inner">'."\n";
86 86
 		echo '<label>'.$title.'</label>';
@@ -95,45 +95,45 @@  discard block
 block discarded – undo
95 95
 	 */
96 96
 	function lasso_editor_settings_form() {
97 97
 
98
-		if ( !is_user_logged_in() )
98
+		if (!is_user_logged_in())
99 99
 			return;
100 100
         
101 101
         // check for lasso story engine and add a class doniting this
102
-        $ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active';
103
-
104
-		$article_object   = lasso_editor_get_option( 'article_class', 'lasso_editor' );
105
-		$featImgClass    = lasso_editor_get_option( 'featimg_class', 'lasso_editor' );
106
-		$titleClass    = lasso_editor_get_option( 'title_class', 'lasso_editor' );
107
-
108
-		$post_new_disabled   = lasso_editor_get_option( 'post_adding_disabled', 'lasso_editor' );
109
-		$save_to_post_disabled  = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' );
110
-		$edit_post_disabled  = lasso_editor_get_option( 'post_edit_disabled', 'lasso_editor' );
111
-		$post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' );
112
-		$allow_change_date = lasso_editor_get_option( 'allow_change_date', 'lasso_editor' );
113
-        $allow_edit_excerpt = lasso_editor_get_option( 'allow_edit_excerpt', 'lasso_editor' );
114
-		$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
115
-		$shortcodify_disabled  = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' );
116
-		$enable_autosave  = lasso_editor_get_option( 'enable_autosave', 'lasso_editor' );
117
-
118
-		$use_old_ui      = lasso_editor_get_option( 'use_old_ui', 'lasso_editor' );
119
-		$toolbar_headings      = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' );
120
-		$toolbar_headings_h4      = lasso_editor_get_option( 'toolbar_headings_h4', 'lasso_editor' );
121
-		$toolbar_list      = lasso_editor_get_option( 'toolbar_list', 'lasso_editor' );
122
-		$toolbar_show_color      = lasso_editor_get_option( 'toolbar_show_color', 'lasso_editor' );
123
-		$toolbar_show_alignment  = lasso_editor_get_option( 'toolbar_show_alignment', 'lasso_editor' );
102
+        $ase_status = class_exists('Aesop_Core') || defined('LASSO_CUSTOM') ? 'ase-active' : 'ase-not-active';
103
+
104
+		$article_object   = lasso_editor_get_option('article_class', 'lasso_editor');
105
+		$featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor');
106
+		$titleClass = lasso_editor_get_option('title_class', 'lasso_editor');
107
+
108
+		$post_new_disabled   = lasso_editor_get_option('post_adding_disabled', 'lasso_editor');
109
+		$save_to_post_disabled  = lasso_editor_get_option('post_save_disabled', 'lasso_editor');
110
+		$edit_post_disabled  = lasso_editor_get_option('post_edit_disabled', 'lasso_editor');
111
+		$post_settings_disabled = lasso_editor_get_option('post_settings_disabled', 'lasso_editor');
112
+		$allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor');
113
+        $allow_edit_excerpt = lasso_editor_get_option('allow_edit_excerpt', 'lasso_editor');
114
+		$allow_new_category = lasso_editor_get_option('allow_new_category', 'lasso_editor');
115
+		$shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor');
116
+		$enable_autosave = lasso_editor_get_option('enable_autosave', 'lasso_editor');
117
+
118
+		$use_old_ui = lasso_editor_get_option('use_old_ui', 'lasso_editor');
119
+		$toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor');
120
+		$toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
121
+		$toolbar_list = lasso_editor_get_option('toolbar_list', 'lasso_editor');
122
+		$toolbar_show_color      = lasso_editor_get_option('toolbar_show_color', 'lasso_editor');
123
+		$toolbar_show_alignment  = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor');
124 124
 		
125
-		$objectsNoSave  	= lasso_editor_get_option('dont_save', 'lasso_editor');
126
-		$objectsNonEditable  	= lasso_editor_get_option('non_editable', 'lasso_editor');
125
+		$objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor');
126
+		$objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor');
127 127
 		$disable_tour = lasso_editor_get_option('disable_tour', 'lasso_editor');
128 128
 		$show_ignored_items = lasso_editor_get_option('show_ignored_items', 'lasso_editor');
129 129
 		$save_using_rest_disabled = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor');
130 130
 		
131
-		$default_post_types = apply_filters( 'lasso_allowed_post_types', array( 'post', 'page'));
132
-		$allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor',  $default_post_types);
131
+		$default_post_types = apply_filters('lasso_allowed_post_types', array('post', 'page'));
132
+		$allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', $default_post_types);
133 133
 		
134 134
 		$links_editable = lasso_editor_get_option('links_editable', 'lasso_editor', false);
135
-		$bold_tag = lasso_editor_get_option( 'bold_tag', 'lasso_editor',  "b");
136
-		$i_tag = lasso_editor_get_option( 'i_tag', 'lasso_editor',  "i");
135
+		$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor', "b");
136
+		$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor', "i");
137 137
         
138 138
         $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
139 139
 		
@@ -149,37 +149,37 @@  discard block
 block discarded – undo
149 149
         
150 150
         $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor');
151 151
         
152
-        $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
153
-        $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
152
+        $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor', 'off');
153
+        $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor', 'off');
154 154
 
155 155
 ?>
156 156
 		<div class="wrap">
157 157
 
158
-	    	<h2><?php _e( 'Editus Settings', 'lasso' );?></h2>
158
+	    	<h2><?php _e('Editus Settings', 'lasso'); ?></h2>
159 159
 
160 160
 			<form id="lasso-editor-settings-form" class="lasso--form-settings" method="post" enctype="multipart/form-data">
161 161
 
162
-				<?php do_action('lasso_settings_before');?>
162
+				<?php do_action('lasso_settings_before'); ?>
163 163
 				
164 164
 				
165 165
 				
166
-				<h3><?php _e( 'Enable for:', 'lasso' );?></h3>
166
+				<h3><?php _e('Enable for:', 'lasso'); ?></h3>
167 167
 				<div class="lasso-editor-settings--option-wrap">
168 168
 					<div class="lasso-editor-settings--option-inner">
169 169
 						
170
-						<span class="lasso--setting-description"><?php _e( 'Enable Editus for the following post types.', 'lasso' );?></span>
170
+						<span class="lasso--setting-description"><?php _e('Enable Editus for the following post types.', 'lasso'); ?></span>
171 171
 						<?php
172 172
 						$args = array(
173 173
 							'public'   => true
174 174
 						);
175 175
 						 
176
-						$allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
177
-						$post_types = get_post_types( $args, 'objects' );
176
+						$allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types);
177
+						$post_types = get_post_types($args, 'objects');
178 178
 						 
179
-						foreach ( $post_types  as $post_type ) {
179
+						foreach ($post_types  as $post_type) {
180 180
 						   if ($post_type->name == 'attachment') continue;
181
-						   $checked ="";
182
-						   if (  in_array( $post_type->name, $allowed_post_types )  ) {
181
+						   $checked = "";
182
+						   if (in_array($post_type->name, $allowed_post_types)) {
183 183
 								$checked = 'checked="checked"';
184 184
 						   }
185 185
 						   echo '<label><input type="checkbox" '.$checked.' name="lasso_editor[allowed_post_types]['.$post_type->name.']" id="lasso_editor[allowed_post_types]['.$post_type->name.']" >'.$post_type->name.'</label>';
@@ -189,126 +189,126 @@  discard block
 block discarded – undo
189 189
 				</div>
190 190
 				
191 191
 
192
-				<h3><?php _e( 'Internal Settings', 'lasso' );?></h3>
192
+				<h3><?php _e('Internal Settings', 'lasso'); ?></h3>
193 193
 				<div class="lasso-editor-settings--option-wrap">
194 194
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
195
-						<label><?php _e( 'Article Class', 'lasso' );?></label>
196
-						<span class="lasso--setting-description"><?php _e( 'Provide the CSS class (including the preceding dot) of container that holds the post. This should be the first parent container class that holds the_content.', 'lasso' );?></span>
197
-						<input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr( $article_object );?>" placeholder=".entry-content">
195
+						<label><?php _e('Article Class', 'lasso'); ?></label>
196
+						<span class="lasso--setting-description"><?php _e('Provide the CSS class (including the preceding dot) of container that holds the post. This should be the first parent container class that holds the_content.', 'lasso'); ?></span>
197
+						<input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr($article_object); ?>" placeholder=".entry-content">
198 198
 					</div>
199 199
 				
200 200
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
201
-						<label><?php _e( 'Featured Image Class', 'lasso' );?></label>
202
-						<span class="lasso--setting-description"><?php _e( 'Provide the CSS class that uses a featured image as a background image. This currently only supports themes that have the featured image set as background image.', 'lasso' );?></span>
203
-						<input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr( $featImgClass );?>" placeholder=".entry-content">
201
+						<label><?php _e('Featured Image Class', 'lasso'); ?></label>
202
+						<span class="lasso--setting-description"><?php _e('Provide the CSS class that uses a featured image as a background image. This currently only supports themes that have the featured image set as background image.', 'lasso'); ?></span>
203
+						<input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr($featImgClass); ?>" placeholder=".entry-content">
204 204
 					</div>
205 205
 				
206 206
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
207
-						<label><?php _e( 'Article Title Class', 'lasso' );?></label>
208
-						<span class="lasso--setting-description"><?php _e( 'Provide the CSS class for the post title. This will enable you to update the title of the post by clicking and typing.', 'lasso' );?></span>
209
-						<input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr( $titleClass );?>" placeholder=".entry-content">
207
+						<label><?php _e('Article Title Class', 'lasso'); ?></label>
208
+						<span class="lasso--setting-description"><?php _e('Provide the CSS class for the post title. This will enable you to update the title of the post by clicking and typing.', 'lasso'); ?></span>
209
+						<input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr($titleClass); ?>" placeholder=".entry-content">
210 210
 					</div>
211 211
 				
212 212
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
213
-						<label><?php _e( 'Ignored Items to Save', 'lasso' );?></label>
214
-						<span class="lasso--setting-description"><?php _e( 'If your post container holds additional markup, list the css class names (comma separated, including the dot) of those items. When you enter the editor, Editus will remove (NOT delete) these items so that it does not save them as HTML.', 'lasso' );?></span>
215
-						<textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNoSave );?></textarea>
213
+						<label><?php _e('Ignored Items to Save', 'lasso'); ?></label>
214
+						<span class="lasso--setting-description"><?php _e('If your post container holds additional markup, list the css class names (comma separated, including the dot) of those items. When you enter the editor, Editus will remove (NOT delete) these items so that it does not save them as HTML.', 'lasso'); ?></span>
215
+						<textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr($objectsNoSave); ?></textarea>
216 216
 					</div>
217 217
 				
218 218
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
219
-						<label><?php _e( 'Read Only Items', 'lasso' );?></label>
220
-						<span class="lasso--setting-description"><?php _e( 'If your post has items that should not be editable, list the css class names (comma separated, including the dot) of those items.', 'lasso' );?></span>
221
-						<textarea name="lasso_editor[non_editable]" id="lasso_editor[non_editable]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNonEditable );?></textarea>
219
+						<label><?php _e('Read Only Items', 'lasso'); ?></label>
220
+						<span class="lasso--setting-description"><?php _e('If your post has items that should not be editable, list the css class names (comma separated, including the dot) of those items.', 'lasso'); ?></span>
221
+						<textarea name="lasso_editor[non_editable]" id="lasso_editor[non_editable]" placeholder=".classname, .another-class"><?php echo esc_attr($objectsNonEditable); ?></textarea>
222 222
 					</div>
223 223
 				
224 224
 					<div class="lasso-editor-settings--option-inner" >
225
-						<input type="checkbox" class="checkbox" name="lasso_editor[show_ignored_items]" id="lasso_editor[show_ignored_items]" <?php echo checked( $show_ignored_items, 'on' );?> >
226
-						<label for="lasso_editor[show_ignored_items]"> <?php _e( 'Show Ignored Items', 'lasso' );?></label>
227
-						<span class="lasso--setting-description"><?php _e( 'By default the ignored items are hidden. Check this to show ignored items while keeping them uneditable.', 'lasso' );?></span>
225
+						<input type="checkbox" class="checkbox" name="lasso_editor[show_ignored_items]" id="lasso_editor[show_ignored_items]" <?php echo checked($show_ignored_items, 'on'); ?> >
226
+						<label for="lasso_editor[show_ignored_items]"> <?php _e('Show Ignored Items', 'lasso'); ?></label>
227
+						<span class="lasso--setting-description"><?php _e('By default the ignored items are hidden. Check this to show ignored items while keeping them uneditable.', 'lasso'); ?></span>
228 228
 					</div>
229 229
 				</div>
230 230
 
231
-				<h3><?php _e( 'Editor UI', 'lasso' );?></h3>
231
+				<h3><?php _e('Editor UI', 'lasso'); ?></h3>
232 232
 				<div class="lasso-editor-settings--option-wrap">
233 233
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
234
-						<input type="checkbox" class="checkbox" name="lasso_editor[use_old_ui]" id="lasso_editor_use_old_ui" <?php echo checked( $use_old_ui, 'on' );?> >
235
-						<label for="lasso_editor[use_old_ui]"><?php _e( 'Use the Old Toolbar', 'lasso' );?></label>
236
-						<span class="lasso--setting-description"><?php _e( 'Use this option to disable the new color options and use the pre-1.0 toolbar.', 'lasso' );?></span>
234
+						<input type="checkbox" class="checkbox" name="lasso_editor[use_old_ui]" id="lasso_editor_use_old_ui" <?php echo checked($use_old_ui, 'on'); ?> >
235
+						<label for="lasso_editor[use_old_ui]"><?php _e('Use the Old Toolbar', 'lasso'); ?></label>
236
+						<span class="lasso--setting-description"><?php _e('Use this option to disable the new color options and use the pre-1.0 toolbar.', 'lasso'); ?></span>
237 237
 					</div>
238 238
 				    <div id="lasso-editor-settings--colors">
239 239
 					<?php
240
-					self::create_section_for_color_picker('button-color1', _e( 'Editor Bar Color Top', 'lasso' ), '#0000ff');
241
-					self::create_section_for_color_picker('button-color2', _e( 'Editor Bar Color Bottom', 'lasso' ), '#000030');
242
-					self::create_section_for_color_picker('dialog-color', _e( 'Dialog Color', 'lasso' ), '#000055');
243
-					self::create_section_for_color_picker('text-color', _e( 'Icon/Text Color', 'lasso' ), '#ffffff');
240
+					self::create_section_for_color_picker('button-color1', _e('Editor Bar Color Top', 'lasso'), '#0000ff');
241
+					self::create_section_for_color_picker('button-color2', _e('Editor Bar Color Bottom', 'lasso'), '#000030');
242
+					self::create_section_for_color_picker('dialog-color', _e('Dialog Color', 'lasso'), '#000055');
243
+					self::create_section_for_color_picker('text-color', _e('Icon/Text Color', 'lasso'), '#ffffff');
244 244
 					?>
245
-					<button type="button" id="lasso-editor-settings--default-colors" ><?php _e( 'Default Colors', 'lasso' );?></button>
245
+					<button type="button" id="lasso-editor-settings--default-colors" ><?php _e('Default Colors', 'lasso'); ?></button>
246 246
 				    <div style="height:50px;"></div>
247 247
 					</div>
248 248
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
249
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked( $toolbar_headings, 'on' );?> >
250
-						<label for="lasso_editor[toolbar_headings]"><?php _e( 'Enable H2 and H3 Buttons', 'lasso' );?></label>
251
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set H2 and H3 settings.', 'lasso' );?></span>
249
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked($toolbar_headings, 'on'); ?> >
250
+						<label for="lasso_editor[toolbar_headings]"><?php _e('Enable H2 and H3 Buttons', 'lasso'); ?></label>
251
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set H2 and H3 settings.', 'lasso'); ?></span>
252 252
 
253 253
 					</div>
254 254
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
255
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings_h4]" id="lasso_editor[toolbar_headings_h4]" <?php echo checked( $toolbar_headings_h4, 'on' );?> >
256
-						<label for="lasso_editor[toolbar_headings_h4]"><?php _e( 'Enable H4/H5/H6 Buttons', 'lasso' );?></label>
257
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set H4/H5/H6 settings.', 'lasso' );?></span>
255
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings_h4]" id="lasso_editor[toolbar_headings_h4]" <?php echo checked($toolbar_headings_h4, 'on'); ?> >
256
+						<label for="lasso_editor[toolbar_headings_h4]"><?php _e('Enable H4/H5/H6 Buttons', 'lasso'); ?></label>
257
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set H4/H5/H6 settings.', 'lasso'); ?></span>
258 258
 
259 259
 					</div>
260 260
 					
261 261
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
262
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_list]" id="lasso_editor[toolbar_list]" <?php echo checked( $toolbar_list, 'on' );?> >
263
-						<label for="lasso_editor[toolbar_list]"><?php _e( 'Enable OL/UL Buttons', 'lasso' );?></label>
264
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to create Ordered and Unordered Lists from text selection.', 'lasso' );?></span>
262
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_list]" id="lasso_editor[toolbar_list]" <?php echo checked($toolbar_list, 'on'); ?> >
263
+						<label for="lasso_editor[toolbar_list]"><?php _e('Enable OL/UL Buttons', 'lasso'); ?></label>
264
+						<span class="lasso--setting-description"><?php _e('Show the buttons to create Ordered and Unordered Lists from text selection.', 'lasso'); ?></span>
265 265
 					</div>
266 266
 					
267 267
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
268
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_color]" id="lasso_editor[toolbar_show_color]" <?php echo checked( $toolbar_show_color, 'on' );?> >
269
-						<label for="lasso_editor[toolbar_show_color]"><?php _e( 'Enable Text Color Buttons', 'lasso' );?></label>
270
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set text colors.', 'lasso' );?></span>
268
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_color]" id="lasso_editor[toolbar_show_color]" <?php echo checked($toolbar_show_color, 'on'); ?> >
269
+						<label for="lasso_editor[toolbar_show_color]"><?php _e('Enable Text Color Buttons', 'lasso'); ?></label>
270
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set text colors.', 'lasso'); ?></span>
271 271
 
272 272
 					</div>
273 273
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
274
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_alignment]" id="lasso_editor[toolbar_show_alignment]" <?php echo checked( $toolbar_show_alignment, 'on' );?> >
275
-						<label for="lasso_editor[toolbar_show_alignment]"><?php _e( 'Enable Text Align Buttons', 'lasso' );?></label>
276
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set text alignment.', 'lasso' );?></span>
274
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_alignment]" id="lasso_editor[toolbar_show_alignment]" <?php echo checked($toolbar_show_alignment, 'on'); ?> >
275
+						<label for="lasso_editor[toolbar_show_alignment]"><?php _e('Enable Text Align Buttons', 'lasso'); ?></label>
276
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set text alignment.', 'lasso'); ?></span>
277 277
 
278 278
 					</div>
279 279
 					
280 280
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
281
-						<input type="checkbox" class="checkbox" name="lasso_editor[links_editable]" id="lasso_editor[links_editable]" <?php echo checked( $links_editable, 'on' );?> >
282
-						<label for="lasso_editor[links_editable]"><?php _e( 'Make links editable under the Editing Mode', 'lasso' );?></label>
283
-						<span class="lasso--setting-description"><?php _e( 'Make links editable under the Editing Mode. Turning this on will make the links non-clickable while editing.', 'lasso' );?></span>
281
+						<input type="checkbox" class="checkbox" name="lasso_editor[links_editable]" id="lasso_editor[links_editable]" <?php echo checked($links_editable, 'on'); ?> >
282
+						<label for="lasso_editor[links_editable]"><?php _e('Make links editable under the Editing Mode', 'lasso'); ?></label>
283
+						<span class="lasso--setting-description"><?php _e('Make links editable under the Editing Mode. Turning this on will make the links non-clickable while editing.', 'lasso'); ?></span>
284 284
 
285 285
 					</div>
286 286
 					<div class="lasso-editor-settings--option-inner">
287
-					    <label for="lasso_editor[insert_comp_ui]"> <?php _e( 'Insert Component UI', 'lasso' );?></label>
288
-						<span class="lasso--setting-description"><?php _e( 'UI mechanism to insert components', 'lasso' );?></span>
287
+					    <label for="lasso_editor[insert_comp_ui]"> <?php _e('Insert Component UI', 'lasso'); ?></label>
288
+						<span class="lasso--setting-description"><?php _e('UI mechanism to insert components', 'lasso'); ?></span>
289 289
 						<div class="lasso-editor-settings--option-inner" style="border:none;">
290
-					       <input type="radio" name="lasso_editor[insert_comp_ui]" value='drag' <?php echo checked( $insert_comp_ui, 'drag' );?>> <?php _e( 'Drag and Drop', 'lasso' );?>
290
+					       <input type="radio" name="lasso_editor[insert_comp_ui]" value='drag' <?php echo checked($insert_comp_ui, 'drag'); ?>> <?php _e('Drag and Drop', 'lasso'); ?>
291 291
 						</div>
292 292
 						<div class="lasso-editor-settings--option-inner" style="border:none;">
293
-						<input type="radio" name="lasso_editor[insert_comp_ui]" value="click" <?php echo checked( $insert_comp_ui, 'click' );?>> <?php _e( 'Click', 'lasso' );?>
293
+						<input type="radio" name="lasso_editor[insert_comp_ui]" value="click" <?php echo checked($insert_comp_ui, 'click'); ?>> <?php _e('Click', 'lasso'); ?>
294 294
 						</div>
295 295
 						<div class="lasso-editor-settings--option-inner" style="border:none;">
296
-						<input type="radio" name="lasso_editor[insert_comp_ui]" value="mediumcom" <?php echo checked( $insert_comp_ui, 'mediumcom' );?>> <?php _e( 'Auto Button on Empty Paragraph. medium.com-like UI.', 'lasso' );?>
296
+						<input type="radio" name="lasso_editor[insert_comp_ui]" value="mediumcom" <?php echo checked($insert_comp_ui, 'mediumcom'); ?>> <?php _e('Auto Button on Empty Paragraph. medium.com-like UI.', 'lasso'); ?>
297 297
 						</div>
298 298
 					</div>
299 299
                     
300 300
 				</div>
301 301
 				
302
-				<h3><?php _e( 'Component', 'lasso' );?></h3>
302
+				<h3><?php _e('Component', 'lasso'); ?></h3>
303 303
                 <div class="lasso-editor-settings--option-wrap" style="border:none;" >
304 304
                     <div class="lasso-editor-settings--option-inner" style="border:none">
305
-						<input type="checkbox" class="checkbox" name="lasso_editor[add_table]" id="lasso_editor[add_table]" <?php echo checked( $add_table, 'on' );?> >
306
-						<label for="lasso_editor[add_table]"><?php _e( 'Additional Component: Table', 'lasso' );?></label>
307
-						<span class="lasso--setting-description"><?php _e( 'Allow user to add and edit tables.', 'lasso' );?></span>
305
+						<input type="checkbox" class="checkbox" name="lasso_editor[add_table]" id="lasso_editor[add_table]" <?php echo checked($add_table, 'on'); ?> >
306
+						<label for="lasso_editor[add_table]"><?php _e('Additional Component: Table', 'lasso'); ?></label>
307
+						<span class="lasso--setting-description"><?php _e('Allow user to add and edit tables.', 'lasso'); ?></span>
308 308
 
309 309
 					</div>
310 310
                 
311
-                <?php if ( 'ase-active' != $ase_status ) { ?>
311
+                <?php if ('ase-active' != $ase_status) { ?>
312 312
                     <script>
313 313
                     $(document).ready(function(){
314 314
                         $("#lasso_editor\\[use_old_wpimg\\]").on('change', function(){                        
@@ -334,131 +334,131 @@  discard block
 block discarded – undo
334 334
                     </script>
335 335
                 
336 336
                     <div class="lasso-editor-settings--option-inner" style="border:none">
337
-						<input type="checkbox" class="checkbox" name="lasso_editor[use_old_wpimg]" id="lasso_editor[use_old_wpimg]" <?php echo checked( $use_old_wpimg, 'on' );?> >
338
-						<label for="lasso_editor[use_old_wpimg]"><?php _e( 'Use Simple Image', 'lasso' );?></label>
339
-						<span class="lasso--setting-description"><?php _e( 'Use Simple Image Component without Extra Options.', 'lasso' );?></span>
337
+						<input type="checkbox" class="checkbox" name="lasso_editor[use_old_wpimg]" id="lasso_editor[use_old_wpimg]" <?php echo checked($use_old_wpimg, 'on'); ?> >
338
+						<label for="lasso_editor[use_old_wpimg]"><?php _e('Use Simple Image', 'lasso'); ?></label>
339
+						<span class="lasso--setting-description"><?php _e('Use Simple Image Component without Extra Options.', 'lasso'); ?></span>
340 340
 
341 341
 					</div>
342 342
                 
343 343
                 
344 344
                     <div class="lasso-editor-settings--option-inner" style="border:none">
345
-						<input type="checkbox" class="checkbox" name="lasso_editor[use_wp_block_image]" id="lasso_editor[use_wp_block_image]" <?php echo checked( $use_wp_block_image, 'on' );?> >
346
-						<label for="lasso_editor[use_wp_block_image]"><?php _e( 'Use WP Image Block', 'lasso' );?></label>
347
-						<span class="lasso--setting-description"><?php _e( 'Use WP Image Block as the image component. Gutenberg Block Editor needs to be enabled.', 'lasso' );?></span>
345
+						<input type="checkbox" class="checkbox" name="lasso_editor[use_wp_block_image]" id="lasso_editor[use_wp_block_image]" <?php echo checked($use_wp_block_image, 'on'); ?> >
346
+						<label for="lasso_editor[use_wp_block_image]"><?php _e('Use WP Image Block', 'lasso'); ?></label>
347
+						<span class="lasso--setting-description"><?php _e('Use WP Image Block as the image component. Gutenberg Block Editor needs to be enabled.', 'lasso'); ?></span>
348 348
 
349 349
 					</div>
350 350
                 <?php }?>
351 351
                 </div>
352 352
 				
353 353
 
354
-				<h3><?php _e( 'Post Settings UI', 'lasso' );?></h3>
354
+				<h3><?php _e('Post Settings UI', 'lasso'); ?></h3>
355 355
 				<div class="lasso-editor-settings--option-wrap"  >
356 356
 					<div class="lasso-editor-settings--option-inner" style="border:none">
357
-						<input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked( $post_settings_disabled, 'on' );?> >
358
-						<label for="lasso_editor[post_settings_disabled]"> <?php _e( 'Disable Post Settings', 'lasso' );?></label>
359
-						<span class="lasso--setting-description"><?php _e( 'Check this to disable users from being able to edit post settings from the front-end.', 'lasso' );?></span>
357
+						<input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked($post_settings_disabled, 'on'); ?> >
358
+						<label for="lasso_editor[post_settings_disabled]"> <?php _e('Disable Post Settings', 'lasso'); ?></label>
359
+						<span class="lasso--setting-description"><?php _e('Check this to disable users from being able to edit post settings from the front-end.', 'lasso'); ?></span>
360 360
 					</div>
361 361
 					
362 362
 					<div class="lasso-editor-settings--option-inner" style="border:none">
363
-						<input type="checkbox" class="checkbox" name="lasso_editor[allow_change_date]" id="lasso_editor[allow_change_date]" <?php echo checked( $allow_change_date, 'on' );?> >
364
-						<label for="lasso_editor[allow_change_date]"> <?php _e( 'Allow Changing Post Date', 'lasso' );?></label>
365
-						<span class="lasso--setting-description"><?php _e( 'Add the date selector to change the post\'s date to the Post Setting dialog', 'lasso' );?></span>
363
+						<input type="checkbox" class="checkbox" name="lasso_editor[allow_change_date]" id="lasso_editor[allow_change_date]" <?php echo checked($allow_change_date, 'on'); ?> >
364
+						<label for="lasso_editor[allow_change_date]"> <?php _e('Allow Changing Post Date', 'lasso'); ?></label>
365
+						<span class="lasso--setting-description"><?php _e('Add the date selector to change the post\'s date to the Post Setting dialog', 'lasso'); ?></span>
366 366
 					</div>
367 367
                     
368 368
                     <div class="lasso-editor-settings--option-inner" style="border:none">
369
-						<input type="checkbox" class="checkbox" name="lasso_editor[allow_edit_excerpt]" id="lasso_editor[allow_edit_excerpt]" <?php echo checked( $allow_edit_excerpt, 'on' );?> >
370
-						<label for="lasso_editor[allow_edit_excerpt]"> <?php _e( 'Allow Editing Excerpt', 'lasso' );?></label>
371
-						<span class="lasso--setting-description"><?php _e( 'Allow the post\'s excerpt to be edited in the Post Setting dialog', 'lasso' );?></span>
369
+						<input type="checkbox" class="checkbox" name="lasso_editor[allow_edit_excerpt]" id="lasso_editor[allow_edit_excerpt]" <?php echo checked($allow_edit_excerpt, 'on'); ?> >
370
+						<label for="lasso_editor[allow_edit_excerpt]"> <?php _e('Allow Editing Excerpt', 'lasso'); ?></label>
371
+						<span class="lasso--setting-description"><?php _e('Allow the post\'s excerpt to be edited in the Post Setting dialog', 'lasso'); ?></span>
372 372
 					</div>
373 373
 					
374 374
 					<div class="lasso-editor-settings--option-inner" style="border:none">
375
-						<input type="checkbox" class="checkbox" name="lasso_editor[allow_new_category]" id="lasso_editor[allow_new_category]" <?php echo checked( $allow_new_category, 'on' );?> >
376
-						<label for="lasso_editor[allow_new_category]"> <?php _e( 'Allow Adding New Category', 'lasso' );?></label>
377
-						<span class="lasso--setting-description"><?php _e( 'Add the user to create new, previously non-existing categories for posts.', 'lasso' );?></span>
375
+						<input type="checkbox" class="checkbox" name="lasso_editor[allow_new_category]" id="lasso_editor[allow_new_category]" <?php echo checked($allow_new_category, 'on'); ?> >
376
+						<label for="lasso_editor[allow_new_category]"> <?php _e('Allow Adding New Category', 'lasso'); ?></label>
377
+						<span class="lasso--setting-description"><?php _e('Add the user to create new, previously non-existing categories for posts.', 'lasso'); ?></span>
378 378
 					</div>
379 379
 					
380 380
 					<div class="lasso-editor-settings--option-inner" style="border:none">
381
-						<input type="checkbox" class="checkbox" name="lasso_editor[no_pending_status]" id="lasso_editor[no_pending_status]" <?php echo checked( $no_pending_status, 'on' );?> >
382
-						<label for="lasso_editor[no_pending_status]"> <?php _e( 'Do Not Allow "Pending" Status', 'lasso' );?></label>
383
-						<span class="lasso--setting-description"><?php _e( 'Remove the Option to Set the Status to Pending.', 'lasso' );?></span>
381
+						<input type="checkbox" class="checkbox" name="lasso_editor[no_pending_status]" id="lasso_editor[no_pending_status]" <?php echo checked($no_pending_status, 'on'); ?> >
382
+						<label for="lasso_editor[no_pending_status]"> <?php _e('Do Not Allow "Pending" Status', 'lasso'); ?></label>
383
+						<span class="lasso--setting-description"><?php _e('Remove the Option to Set the Status to Pending.', 'lasso'); ?></span>
384 384
 					</div>
385 385
 					
386 386
 					<div class="lasso-editor-settings--option-inner" style="border:none">
387
-						<input type="checkbox" class="checkbox" name="lasso_editor[no_url_setting]" id="lasso_editor[no_slug_setting]" <?php echo checked( $no_url_setting, 'on' );?> >
388
-						<label for="lasso_editor[no_url_setting]"> <?php _e( 'Remove POST URL Option', 'lasso' );?></label>
389
-						<span class="lasso--setting-description"><?php _e( 'Remove the Option to Set the URL for the Post.', 'lasso' );?></span>
387
+						<input type="checkbox" class="checkbox" name="lasso_editor[no_url_setting]" id="lasso_editor[no_slug_setting]" <?php echo checked($no_url_setting, 'on'); ?> >
388
+						<label for="lasso_editor[no_url_setting]"> <?php _e('Remove POST URL Option', 'lasso'); ?></label>
389
+						<span class="lasso--setting-description"><?php _e('Remove the Option to Set the URL for the Post.', 'lasso'); ?></span>
390 390
 					</div>
391 391
 				
392 392
 					<div class="lasso-editor-settings--option-inner" >
393
-						<input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked( $post_new_disabled, 'on' );?> >
394
-						<label for="lasso_editor[post_adding_disabled]"><?php _e( 'Disable Post Adding', 'lasso' );?></label>
395
-						<span class="lasso--setting-description"><?php _e( 'Check this box to disable users from being able to add new posts from the front-end.', 'lasso' );?></span>
393
+						<input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked($post_new_disabled, 'on'); ?> >
394
+						<label for="lasso_editor[post_adding_disabled]"><?php _e('Disable Post Adding', 'lasso'); ?></label>
395
+						<span class="lasso--setting-description"><?php _e('Check this box to disable users from being able to add new posts from the front-end.', 'lasso'); ?></span>
396 396
 					</div>
397 397
 					
398 398
 
399 399
 				</div>
400 400
 				
401
-				<h3><?php _e( 'Misc', 'lasso' );?></h3>
401
+				<h3><?php _e('Misc', 'lasso'); ?></h3>
402 402
 				<div class="lasso-editor-settings--option-wrap">
403 403
 					<div class="lasso-editor-settings--option-inner" style="border:none">
404
-						<input type="checkbox" class="checkbox" name="lasso_editor[disable_tour]" id="lasso_editor[disable_tour]" <?php echo checked( $disable_tour, 'on' );?> >
405
-						<label for="lasso_editor[disable_tour]"> <?php _e( 'Do Not Show Tour Dialog', 'lasso' );?></label>
406
-						<span class="lasso--setting-description"><?php _e( 'Check this box to disable the tour dialog box for all users.', 'lasso' );?></span>
404
+						<input type="checkbox" class="checkbox" name="lasso_editor[disable_tour]" id="lasso_editor[disable_tour]" <?php echo checked($disable_tour, 'on'); ?> >
405
+						<label for="lasso_editor[disable_tour]"> <?php _e('Do Not Show Tour Dialog', 'lasso'); ?></label>
406
+						<span class="lasso--setting-description"><?php _e('Check this box to disable the tour dialog box for all users.', 'lasso'); ?></span>
407 407
 					</div>
408 408
 
409 409
 					<div class="lasso-editor-settings--option-inner" style="border:none">
410
-					    <label for="lasso_editor[bold_tag]"> <?php _e( '"Bold" Tag', 'lasso' );?></label>
411
-						<span class="lasso--setting-description"><?php _e( 'Choose the HTML tag used for the "Bold" style.', 'lasso' );?></span>
412
-					    <input type="radio" name="lasso_editor[bold_tag]" value='b' <?php echo checked( $bold_tag, 'b' );?>> b
413
-						<input type="radio" name="lasso_editor[bold_tag]" value="strong" <?php echo checked( $bold_tag, 'strong' );?>> strong
410
+					    <label for="lasso_editor[bold_tag]"> <?php _e('"Bold" Tag', 'lasso'); ?></label>
411
+						<span class="lasso--setting-description"><?php _e('Choose the HTML tag used for the "Bold" style.', 'lasso'); ?></span>
412
+					    <input type="radio" name="lasso_editor[bold_tag]" value='b' <?php echo checked($bold_tag, 'b'); ?>> b
413
+						<input type="radio" name="lasso_editor[bold_tag]" value="strong" <?php echo checked($bold_tag, 'strong'); ?>> strong
414 414
 					</div>
415 415
 					<div class="lasso-editor-settings--option-inner" style="border:none">
416
-					    <label for="lasso_editor[i_tag]"> <?php _e( '"Italic" Tag', 'lasso' );?></label>
417
-						<span class="lasso--setting-description"><?php _e( 'Choose the HTML tag used for the "Italic" style.', 'lasso' );?></span>
418
-					    <input type="radio" name="lasso_editor[i_tag]" value='i' <?php echo checked( $i_tag, 'i' );?>> i
419
-						<input type="radio" name="lasso_editor[i_tag]" value="em" <?php echo checked( $i_tag, 'em' );?>> em
416
+					    <label for="lasso_editor[i_tag]"> <?php _e('"Italic" Tag', 'lasso'); ?></label>
417
+						<span class="lasso--setting-description"><?php _e('Choose the HTML tag used for the "Italic" style.', 'lasso'); ?></span>
418
+					    <input type="radio" name="lasso_editor[i_tag]" value='i' <?php echo checked($i_tag, 'i'); ?>> i
419
+						<input type="radio" name="lasso_editor[i_tag]" value="em" <?php echo checked($i_tag, 'em'); ?>> em
420 420
 					</div>
421 421
                     <div class="lasso-editor-settings--option-inner" >
422
-						<input type="checkbox" class="checkbox" name="lasso_editor[link_prefix_http]" id="lasso_editor[link_prefix_http]" <?php echo checked( $link_prefix_http, 'on' );?> >
423
-						<label for="lasso_editor[link_prefix_http]"><?php _e( 'Auto Prefix HTTP to links', 'lasso' );?></label>
424
-						<span class="lasso--setting-description"><?php _e( 'When user adds a hyperlink, automatically add http:// if the user does not specify it explicitly.', 'lasso' );?></span>
422
+						<input type="checkbox" class="checkbox" name="lasso_editor[link_prefix_http]" id="lasso_editor[link_prefix_http]" <?php echo checked($link_prefix_http, 'on'); ?> >
423
+						<label for="lasso_editor[link_prefix_http]"><?php _e('Auto Prefix HTTP to links', 'lasso'); ?></label>
424
+						<span class="lasso--setting-description"><?php _e('When user adds a hyperlink, automatically add http:// if the user does not specify it explicitly.', 'lasso'); ?></span>
425 425
 					</div>
426 426
 				</div>
427 427
 
428
-				<h3><?php _e( 'Advanced Options', 'lasso' );?></h3>
429
-                <span class="lasso--setting-description"><?php _e( 'Suggested not to turn these options on without consulting the developer.', 'lasso' );?></span>
428
+				<h3><?php _e('Advanced Options', 'lasso'); ?></h3>
429
+                <span class="lasso--setting-description"><?php _e('Suggested not to turn these options on without consulting the developer.', 'lasso'); ?></span>
430 430
                 <span class="lasso--setting-description"> </span>
431 431
 				<div class="lasso-editor-settings--option-wrap ">
432 432
 					<div class="lasso-editor-settings--option-inner" style="border:none">
433
-						<input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked( $shortcodify_disabled, 'on' );?> >
434
-						<label for="lasso_editor[shortcodify_disabled]"><?php _e( 'Disable Aesop Component Conversion', 'lasso' );?></label>
435
-						<span class="lasso--setting-description"><?php _e( 'Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso' );?></span>
433
+						<input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked($shortcodify_disabled, 'on'); ?> >
434
+						<label for="lasso_editor[shortcodify_disabled]"><?php _e('Disable Aesop Component Conversion', 'lasso'); ?></label>
435
+						<span class="lasso--setting-description"><?php _e('Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso'); ?></span>
436 436
 					</div>
437 437
 				
438 438
 					<div class="lasso-editor-settings--option-inner" style="border:none">
439
-						<input type="checkbox" class="checkbox" name="lasso_editor[enable_autosave]" id="lasso_editor[enable_autosave]" <?php echo checked( $enable_autosave, 'on' );?> >
440
-						<label for="lasso_editor[enable_autosave]"><?php _e( 'Enable Auto Save', 'lasso' );?></label>
441
-						<span class="lasso--setting-description"><?php _e( 'Check this box to enable auto save.', 'lasso' );?></span>
439
+						<input type="checkbox" class="checkbox" name="lasso_editor[enable_autosave]" id="lasso_editor[enable_autosave]" <?php echo checked($enable_autosave, 'on'); ?> >
440
+						<label for="lasso_editor[enable_autosave]"><?php _e('Enable Auto Save', 'lasso'); ?></label>
441
+						<span class="lasso--setting-description"><?php _e('Check this box to enable auto save.', 'lasso'); ?></span>
442 442
 					</div>
443 443
 				
444 444
 					<div class="lasso-editor-settings--option-inner" style="border:none">
445
-						<input type="checkbox" class="checkbox" name="lasso_editor[post_save_disabled]" id="lasso_editor[post_save_disabled]" <?php echo checked( $save_to_post_disabled, 'on' );?> >
446
-						<label for="lasso_editor[post_save_disabled]"><?php _e( 'Disable Post Saving', 'lasso' );?></label>
447
-						<span class="lasso--setting-description"><?php _e( 'By default the editor will update the database with the post or page it is being used on. Check this box to disable this. If you check this box, it is assumed that you will be using the provided filters to save your own content.', 'lasso' );?></span>
445
+						<input type="checkbox" class="checkbox" name="lasso_editor[post_save_disabled]" id="lasso_editor[post_save_disabled]" <?php echo checked($save_to_post_disabled, 'on'); ?> >
446
+						<label for="lasso_editor[post_save_disabled]"><?php _e('Disable Post Saving', 'lasso'); ?></label>
447
+						<span class="lasso--setting-description"><?php _e('By default the editor will update the database with the post or page it is being used on. Check this box to disable this. If you check this box, it is assumed that you will be using the provided filters to save your own content.', 'lasso'); ?></span>
448 448
 
449 449
 					</div>
450 450
 					
451 451
 					<div class="lasso-editor-settings--option-inner" style="border:none">
452
-						<input type="checkbox" class="checkbox" name="lasso_editor[post_edit_disabled]" id="lasso_editor[post_edit_disabled]" <?php echo checked( $edit_post_disabled, 'on' );?> >
453
-						<label for="lasso_editor[post_edit_disabled]"><?php _e( 'Disable Post Editing', 'lasso' );?></label>
454
-						<span class="lasso--setting-description"><?php _e( 'You may use this option if you only want to edit custom fields. Refer <a href="https://edituswp.com/editing-and-updating-custom-fields-from-frontend/">here</a> for more information. The custom fields you specify will be still editable under the editing mode.', 'lasso' );?></span>
452
+						<input type="checkbox" class="checkbox" name="lasso_editor[post_edit_disabled]" id="lasso_editor[post_edit_disabled]" <?php echo checked($edit_post_disabled, 'on'); ?> >
453
+						<label for="lasso_editor[post_edit_disabled]"><?php _e('Disable Post Editing', 'lasso'); ?></label>
454
+						<span class="lasso--setting-description"><?php _e('You may use this option if you only want to edit custom fields. Refer <a href="https://edituswp.com/editing-and-updating-custom-fields-from-frontend/">here</a> for more information. The custom fields you specify will be still editable under the editing mode.', 'lasso'); ?></span>
455 455
 
456 456
 					</div>
457 457
 				
458 458
 					<div class="lasso-editor-settings--option-inner">
459
-						<input type="checkbox" class="checkbox" name="lasso_editor[save_using_rest_disabled]" id="lasso_editor[save_using_rest_disabled]" <?php echo checked( $save_using_rest_disabled, 'on' );?> >
460
-						<label for="lasso_editor[save_using_rest_disabled]"><?php _e( "Don't Use REST API to Save", 'lasso' );?></label>
461
-						<span class="lasso--setting-description"><?php _e( 'By default the editor will use REST API to save posts. Check this box to use custom AJAX calls instead.', 'lasso' );?></span>
459
+						<input type="checkbox" class="checkbox" name="lasso_editor[save_using_rest_disabled]" id="lasso_editor[save_using_rest_disabled]" <?php echo checked($save_using_rest_disabled, 'on'); ?> >
460
+						<label for="lasso_editor[save_using_rest_disabled]"><?php _e("Don't Use REST API to Save", 'lasso'); ?></label>
461
+						<span class="lasso--setting-description"><?php _e('By default the editor will use REST API to save posts. Check this box to use custom AJAX calls instead.', 'lasso'); ?></span>
462 462
 
463 463
 					</div>
464 464
 				</div>
@@ -468,11 +468,11 @@  discard block
 block discarded – undo
468 468
 
469 469
 				<div class="lasso-editor-settings--submit">
470 470
 				    <input type="hidden" name="action" value="lasso-editor-settings" />
471
-				    <input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save Settings', 'lasso' );?>" />
472
-					<?php wp_nonce_field( 'nonce', 'lasso_editor_settings' ); ?>
471
+				    <input type="submit" class="button-primary" value="<?php esc_attr_e('Save Settings', 'lasso'); ?>" />
472
+					<?php wp_nonce_field('nonce', 'lasso_editor_settings'); ?>
473 473
 				</div>
474 474
 				
475
-				<?php do_action('lasso_settings_after');?>
475
+				<?php do_action('lasso_settings_after'); ?>
476 476
 			</form>
477 477
 
478 478
 		</div><?php
Please login to merge, or discard this patch.
lasso.php 2 patches
Indentation   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 add_filter('register_post_type_args', 'lasso_show_in_rest', 10, 2);
49 49
 function lasso_show_in_rest($args, $post_type){
50 50
  
51
-    $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( ) );
51
+	$allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( ) );
52 52
 	$allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
53 53
 	if (in_array( $post_type,$allowed_post_types)) {
54 54
 		$args['show_in_rest'] = true;
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 		}
58 58
 	}
59 59
  
60
-    return $args;
60
+	return $args;
61 61
 }
62 62
 
63 63
 
@@ -106,25 +106,25 @@  discard block
 block discarded – undo
106 106
 //table codes to be added
107 107
 class editus_table {
108 108
     
109
-    public function __construct(){
110
-        $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
111
-        if ($add_table) {
112
-            add_action('wp_enqueue_scripts', array($this,'scripts'));
109
+	public function __construct(){
110
+		$add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
111
+		if ($add_table) {
112
+			add_action('wp_enqueue_scripts', array($this,'scripts'));
113 113
             
114
-        }
114
+		}
115 115
 	}
116 116
     
117
-    function scripts()
118
-    {
119
-        add_action('lasso_editor_controls_after_outside', array($this,'editus_table_edit_menu'));
120
-            add_filter('lasso_components',array($this,'editus_components_add_table'),10,1);
121
-            add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_table'), 10 );
122
-            wp_enqueue_style( 'editus-table-style', LASSO_URL.  '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true );
123
-            wp_enqueue_script( 'editus_table',  LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true );
124
-    }
117
+	function scripts()
118
+	{
119
+		add_action('lasso_editor_controls_after_outside', array($this,'editus_table_edit_menu'));
120
+			add_filter('lasso_components',array($this,'editus_components_add_table'),10,1);
121
+			add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_table'), 10 );
122
+			wp_enqueue_style( 'editus-table-style', LASSO_URL.  '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true );
123
+			wp_enqueue_script( 'editus_table',  LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true );
124
+	}
125 125
     
126
-    function editus_table_edit_menu()
127
-    { ?>
126
+	function editus_table_edit_menu()
127
+	{ ?>
128 128
 
129 129
         <ul class='editus-table-menu'>
130 130
           <li data-action="insertcol"><?php echo __('Insert Column','lasso')?></li>
@@ -134,31 +134,31 @@  discard block
 block discarded – undo
134 134
           <li data-action="deltable"><?php echo __('Delete Table','lasso')?></li
135 135
         </ul>
136 136
     <?php
137
-    }
137
+	}
138 138
     
139 139
     
140
-    function editus_html_table()
141
-    {   
142
-        return '<figure class="wp-block-table"><table><tr><th>Cell 1</th><th>Cell 2</th></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table></figure><p><br></p>';
143
-    }
140
+	function editus_html_table()
141
+	{   
142
+		return '<figure class="wp-block-table"><table><tr><th>Cell 1</th><th>Cell 2</th></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table></figure><p><br></p>';
143
+	}
144 144
 
145 145
 
146
-    function editus_components_add_table( $array ){
147
-        $custom = array(
148
-               'htmltable' => array(
149
-                         'name'    => __('HTML Table','lasso'),
150
-                          'content' => self::editus_html_table(),
151
-                )
152
-        );
153
-        return array_merge( $array, $custom );
154
-    }
146
+	function editus_components_add_table( $array ){
147
+		$custom = array(
148
+			   'htmltable' => array(
149
+						 'name'    => __('HTML Table','lasso'),
150
+						  'content' => self::editus_html_table(),
151
+				)
152
+		);
153
+		return array_merge( $array, $custom );
154
+	}
155 155
 
156 156
 
157
-    function editus_toolbar_components_add_table( ) {
158
-          ?>
157
+	function editus_toolbar_components_add_table( ) {
158
+		  ?>
159 159
           <li data-type="htmltable" title="<?php esc_attr_e( 'HTML Table', 'lasso' );?>" class="quote lasso-toolbar--component__htmltable dashicons dashicons-grid-view"></li>
160 160
           <?php
161
-    }
161
+	}
162 162
 }
163 163
 
164 164
 
@@ -169,37 +169,37 @@  discard block
 block discarded – undo
169 169
 //table codes to be added
170 170
 class editus_paragraph {
171 171
     
172
-    public function __construct(){
173
-        add_action('wp_enqueue_scripts', array($this,'scripts'));
172
+	public function __construct(){
173
+		add_action('wp_enqueue_scripts', array($this,'scripts'));
174 174
 	}
175 175
     
176
-    function scripts()
177
-    {
178
-            add_action('lasso_editor_controls_after_outside', array($this,'editus_paragraph_style'));
179
-            add_filter('lasso_components',array($this,'editus_components_add_paragraph'),10,1);
180
-            add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_paragraph'), 10 );
181
-            //wp_enqueue_style( 'editus-table-style', LASSO_URL.  '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true );
182
-            //wp_enqueue_script( 'editus_table',  LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true );
183
-    }
176
+	function scripts()
177
+	{
178
+			add_action('lasso_editor_controls_after_outside', array($this,'editus_paragraph_style'));
179
+			add_filter('lasso_components',array($this,'editus_components_add_paragraph'),10,1);
180
+			add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_paragraph'), 10 );
181
+			//wp_enqueue_style( 'editus-table-style', LASSO_URL.  '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true );
182
+			//wp_enqueue_script( 'editus_table',  LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true );
183
+	}
184 184
    
185
-    function editus_components_add_paragraph( $array ){
186
-        $custom = array(
187
-               'htmlparagraph' => array(
188
-                         'name'    => __('HTML Paragraph','lasso'),
189
-                          'content' => self::editus_html_paragraph(),
190
-                )
191
-        );
192
-        return array_merge( $array, $custom );
193
-    }
185
+	function editus_components_add_paragraph( $array ){
186
+		$custom = array(
187
+			   'htmlparagraph' => array(
188
+						 'name'    => __('HTML Paragraph','lasso'),
189
+						  'content' => self::editus_html_paragraph(),
190
+				)
191
+		);
192
+		return array_merge( $array, $custom );
193
+	}
194 194
     
195 195
     
196
-    function editus_html_paragraph()
197
-    {   
198
-        return '<p contenteditable="true"><br></p>';
199
-    }
196
+	function editus_html_paragraph()
197
+	{   
198
+		return '<p contenteditable="true"><br></p>';
199
+	}
200 200
 
201
-    function editus_paragraph_style()
202
-    { ?>
201
+	function editus_paragraph_style()
202
+	{ ?>
203 203
         <style>
204 204
         #lasso-toolbar--components__list .lasso-toolbar--component__htmlparagraph:before
205 205
         { 
@@ -208,14 +208,14 @@  discard block
 block discarded – undo
208 208
         }
209 209
         </style>
210 210
     <?php
211
-    }
211
+	}
212 212
     
213 213
 
214
-    function editus_toolbar_components_add_paragraph( ) {
215
-          ?>
214
+	function editus_toolbar_components_add_paragraph( ) {
215
+		  ?>
216 216
           <li data-type="htmlparagraph" title="<?php esc_attr_e( 'HTML Paragraph', 'lasso' );?>" class="quote lasso-toolbar--component__htmlparagraph dashicons dashicons-editor-paragraph"></li>
217 217
           <?php
218
-    }
218
+	}
219 219
 }
220 220
 
221 221
 //Disable it for now
Please login to merge, or discard this patch.
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -18,27 +18,27 @@  discard block
 block discarded – undo
18 18
  */
19 19
 
20 20
 // If this file is called directly, abort.
21
-if ( ! defined( 'WPINC' ) ) {
21
+if (!defined('WPINC')) {
22 22
 	die;
23 23
 }
24 24
 
25 25
 // Set some constants
26
-define( 'LASSO_VERSION', '1.3.7' );
27
-define( 'LASSO_DIR', plugin_dir_path( __FILE__ ) );
28
-define( 'LASSO_URL', plugins_url( '', __FILE__ ) );
29
-define( 'LASSO_FILE', __FILE__ );
26
+define('LASSO_VERSION', '1.3.7');
27
+define('LASSO_DIR', plugin_dir_path(__FILE__));
28
+define('LASSO_URL', plugins_url('', __FILE__));
29
+define('LASSO_FILE', __FILE__);
30 30
 
31 31
 /**
32 32
  * Load plugin if PHP version is 5.4 or later.
33 33
  */
34
-if ( version_compare( PHP_VERSION, '5.4.0', '>=' ) ) {
34
+if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
35 35
 
36
-	include_once( LASSO_DIR . '/bootstrap.php' );
36
+	include_once(LASSO_DIR.'/bootstrap.php');
37 37
 
38 38
 } else {
39 39
 
40 40
 	add_action('admin_head', 'lasso_fail_notice');
41
-	function lasso_fail_notice(){
41
+	function lasso_fail_notice() {
42 42
 
43 43
 		printf('<div class="error"><p>Editus requires PHP 5.4 or higher.</p></div>');
44 44
 
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
 }
47 47
 
48 48
 add_filter('register_post_type_args', 'lasso_show_in_rest', 10, 2);
49
-function lasso_show_in_rest($args, $post_type){
49
+function lasso_show_in_rest($args, $post_type) {
50 50
  
51
-    $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( ) );
52
-	$allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
53
-	if (in_array( $post_type,$allowed_post_types)) {
51
+    $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array( ));
52
+	$allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types);
53
+	if (in_array($post_type, $allowed_post_types)) {
54 54
 		$args['show_in_rest'] = true;
55 55
 		if ($post_type != 'post' && $post_type != 'page') {
56 56
 			$args['rest_base'] = $post_type;
@@ -61,21 +61,21 @@  discard block
 block discarded – undo
61 61
 }
62 62
 
63 63
 
64
-function lasso_editor_get_option( $option, $section, $default = '' ) {
64
+function lasso_editor_get_option($option, $section, $default = '') {
65 65
 
66
-	if ( empty( $option ) )
66
+	if (empty($option))
67 67
 		return;
68 68
 
69
-	if ( function_exists( 'is_multisite' ) && is_multisite() ) {
69
+	if (function_exists('is_multisite') && is_multisite()) {
70 70
 
71
-		$options = get_site_option( $section );
71
+		$options = get_site_option($section);
72 72
 
73 73
 	} else {
74 74
 
75
-		$options = get_option( $section );
75
+		$options = get_option($section);
76 76
 	}
77 77
 
78
-	if ( isset( $options[$option] ) ) {
78
+	if (isset($options[$option])) {
79 79
 		return $options[$option];
80 80
 	}
81 81
 
@@ -88,17 +88,17 @@  discard block
 block discarded – undo
88 88
 ));
89 89
 
90 90
 // Gutenberg
91
-if( function_exists( 'is_gutenberg_page' ) ) {
92
-	function add_raw_to_post( $response, $post, $request ) {
91
+if (function_exists('is_gutenberg_page')) {
92
+	function add_raw_to_post($response, $post, $request) {
93 93
 		$response_data = $response->get_data();
94
-		if ( is_array( $response_data['content'] )) {
95
-			$response_data['content']['raw'] =  $post->post_content ;
96
-			$response->set_data( $response_data );
94
+		if (is_array($response_data['content'])) {
95
+			$response_data['content']['raw'] = $post->post_content;
96
+			$response->set_data($response_data);
97 97
 		}
98 98
 
99 99
 		return $response;
100 100
 	}
101
-	add_filter( "rest_prepare_post", 'add_raw_to_post', 10, 3 );
101
+	add_filter("rest_prepare_post", 'add_raw_to_post', 10, 3);
102 102
 }
103 103
 
104 104
 
@@ -106,32 +106,32 @@  discard block
 block discarded – undo
106 106
 //table codes to be added
107 107
 class editus_table {
108 108
     
109
-    public function __construct(){
109
+    public function __construct() {
110 110
         $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
111 111
         if ($add_table) {
112
-            add_action('wp_enqueue_scripts', array($this,'scripts'));
112
+            add_action('wp_enqueue_scripts', array($this, 'scripts'));
113 113
             
114 114
         }
115 115
 	}
116 116
     
117 117
     function scripts()
118 118
     {
119
-        add_action('lasso_editor_controls_after_outside', array($this,'editus_table_edit_menu'));
120
-            add_filter('lasso_components',array($this,'editus_components_add_table'),10,1);
121
-            add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_table'), 10 );
122
-            wp_enqueue_style( 'editus-table-style', LASSO_URL.  '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true );
123
-            wp_enqueue_script( 'editus_table',  LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true );
119
+        add_action('lasso_editor_controls_after_outside', array($this, 'editus_table_edit_menu'));
120
+            add_filter('lasso_components', array($this, 'editus_components_add_table'), 10, 1);
121
+            add_action('lasso_toolbar_components', array($this, 'editus_toolbar_components_add_table'), 10);
122
+            wp_enqueue_style('editus-table-style', LASSO_URL.'/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true);
123
+            wp_enqueue_script('editus_table', LASSO_URL.'/public/assets/js/editus-table-edit-public.js', array('jquery'), LASSO_VERSION, true);
124 124
     }
125 125
     
126 126
     function editus_table_edit_menu()
127 127
     { ?>
128 128
 
129 129
         <ul class='editus-table-menu'>
130
-          <li data-action="insertcol"><?php echo __('Insert Column','lasso')?></li>
131
-          <li data-action="insertrow"><?php echo __('Insert Row','lasso')?></li>
132
-          <li data-action="delcol"><?php echo __('Delete Column','lasso')?></li>
133
-          <li data-action="delrow"><?php echo __('Delete Row','lasso')?></li>
134
-          <li data-action="deltable"><?php echo __('Delete Table','lasso')?></li
130
+          <li data-action="insertcol"><?php echo __('Insert Column', 'lasso')?></li>
131
+          <li data-action="insertrow"><?php echo __('Insert Row', 'lasso')?></li>
132
+          <li data-action="delcol"><?php echo __('Delete Column', 'lasso')?></li>
133
+          <li data-action="delrow"><?php echo __('Delete Row', 'lasso')?></li>
134
+          <li data-action="deltable"><?php echo __('Delete Table', 'lasso')?></li
135 135
         </ul>
136 136
     <?php
137 137
     }
@@ -143,20 +143,20 @@  discard block
 block discarded – undo
143 143
     }
144 144
 
145 145
 
146
-    function editus_components_add_table( $array ){
146
+    function editus_components_add_table($array) {
147 147
         $custom = array(
148 148
                'htmltable' => array(
149
-                         'name'    => __('HTML Table','lasso'),
149
+                         'name'    => __('HTML Table', 'lasso'),
150 150
                           'content' => self::editus_html_table(),
151 151
                 )
152 152
         );
153
-        return array_merge( $array, $custom );
153
+        return array_merge($array, $custom);
154 154
     }
155 155
 
156 156
 
157 157
     function editus_toolbar_components_add_table( ) {
158 158
           ?>
159
-          <li data-type="htmltable" title="<?php esc_attr_e( 'HTML Table', 'lasso' );?>" class="quote lasso-toolbar--component__htmltable dashicons dashicons-grid-view"></li>
159
+          <li data-type="htmltable" title="<?php esc_attr_e('HTML Table', 'lasso'); ?>" class="quote lasso-toolbar--component__htmltable dashicons dashicons-grid-view"></li>
160 160
           <?php
161 161
     }
162 162
 }
@@ -169,27 +169,27 @@  discard block
 block discarded – undo
169 169
 //table codes to be added
170 170
 class editus_paragraph {
171 171
     
172
-    public function __construct(){
173
-        add_action('wp_enqueue_scripts', array($this,'scripts'));
172
+    public function __construct() {
173
+        add_action('wp_enqueue_scripts', array($this, 'scripts'));
174 174
 	}
175 175
     
176 176
     function scripts()
177 177
     {
178
-            add_action('lasso_editor_controls_after_outside', array($this,'editus_paragraph_style'));
179
-            add_filter('lasso_components',array($this,'editus_components_add_paragraph'),10,1);
180
-            add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_paragraph'), 10 );
178
+            add_action('lasso_editor_controls_after_outside', array($this, 'editus_paragraph_style'));
179
+            add_filter('lasso_components', array($this, 'editus_components_add_paragraph'), 10, 1);
180
+            add_action('lasso_toolbar_components', array($this, 'editus_toolbar_components_add_paragraph'), 10);
181 181
             //wp_enqueue_style( 'editus-table-style', LASSO_URL.  '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true );
182 182
             //wp_enqueue_script( 'editus_table',  LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true );
183 183
     }
184 184
    
185
-    function editus_components_add_paragraph( $array ){
185
+    function editus_components_add_paragraph($array) {
186 186
         $custom = array(
187 187
                'htmlparagraph' => array(
188
-                         'name'    => __('HTML Paragraph','lasso'),
188
+                         'name'    => __('HTML Paragraph', 'lasso'),
189 189
                           'content' => self::editus_html_paragraph(),
190 190
                 )
191 191
         );
192
-        return array_merge( $array, $custom );
192
+        return array_merge($array, $custom);
193 193
     }
194 194
     
195 195
     
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 
214 214
     function editus_toolbar_components_add_paragraph( ) {
215 215
           ?>
216
-          <li data-type="htmlparagraph" title="<?php esc_attr_e( 'HTML Paragraph', 'lasso' );?>" class="quote lasso-toolbar--component__htmlparagraph dashicons dashicons-editor-paragraph"></li>
216
+          <li data-type="htmlparagraph" title="<?php esc_attr_e('HTML Paragraph', 'lasso'); ?>" class="quote lasso-toolbar--component__htmlparagraph dashicons dashicons-editor-paragraph"></li>
217 217
           <?php
218 218
     }
219 219
 }
Please login to merge, or discard this patch.
public/includes/editor-modules.php 3 patches
Indentation   +168 added lines, -168 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 				height: 42px;
115 115
 			}
116 116
 		<?php
117
-            } 
117
+			} 
118 118
 		} else { 
119 119
 		?> 
120 120
 
@@ -123,8 +123,8 @@  discard block
 block discarded – undo
123 123
             }
124 124
             
125 125
         <?php
126
-        }
127
-        ?>
126
+		}
127
+		?>
128 128
         </style>
129 129
 		<div id="lasso--controls" class="lasso-post-status--<?php echo sanitize_html_class( $status );?> <?php echo sanitize_html_class( $custom_classes );?>" data-post-id="<?php echo get_the_ID();?>" >
130 130
 
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 	$toolbar_class  = $toolbar_headings ? 'toolbar-extended' : false;
234 234
 	
235 235
 	// mobile styles
236
-    $mobile_class = $is_mobile ? 'lasso-mobile' : false;
236
+	$mobile_class = $is_mobile ? 'lasso-mobile' : false;
237 237
 	$mobile_style =$is_mobile ? 'style="bottom:0px;"' : null;
238 238
 	
239 239
 	//show color
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 	
249 249
 	$sc_saving_class = ('on' == $shortcodify_disabled || $ase_status == 'ase-not-active')  ? 'shortcodify-disabled' : 'shortcodify-enabled';
250 250
 
251
-    $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
251
+	$use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
252 252
 
253 253
 	?>
254 254
 	<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 ?>>
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
 	
462 462
 	//editor options
463 463
 	$allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor');
464
-    $allow_edit_excerpt = lasso_editor_get_option('allow_edit_excerpt', 'lasso_editor');
464
+	$allow_edit_excerpt = lasso_editor_get_option('allow_edit_excerpt', 'lasso_editor');
465 465
 	$no_url_setting = lasso_editor_get_option('no_url_setting', 'lasso_editor');
466 466
 
467 467
 	// are we singular
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
 	// do we support pending status
475 475
 	$no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor');
476 476
     
477
-    $excerpt = $post->post_excerpt;
477
+	$excerpt = $post->post_excerpt;
478 478
 
479 479
 ?>
480 480
 	<div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>">
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
 						}?>
554 554
 						<?php 
555 555
 						if ($allow_change_date) { 
556
-						    $dateformat = get_option( 'date_format' ); 
556
+							$dateformat = get_option( 'date_format' ); 
557 557
 						?>
558 558
 						    <label><?php _e( 'Post Date', 'lasso' ); ?></label>
559 559
 							<input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/>
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
 						if ( !empty( $types ) ) {
669 669
 							// get the first element
670 670
 							$keys = array_keys($types);
671
-						    $type =$keys[0];						
671
+							$type =$keys[0];						
672 672
 							$type = preg_replace( '/s\b/','', $type );
673 673
 							printf( '<input type="hidden" name="object" value="%s">', lcfirst( esc_attr( $type ) ) );		
674 674
 						}
@@ -696,8 +696,8 @@  discard block
 block discarded – undo
696 696
 	global $post;
697 697
 	
698 698
 	global $wp_post_types;
699
-    $labels = &$wp_post_types['post']->labels;
700
-    $labels->name = 'Articles';
699
+	$labels = &$wp_post_types['post']->labels;
700
+	$labels->name = 'Articles';
701 701
 
702 702
 	ob_start();
703 703
 
@@ -757,7 +757,7 @@  discard block
 block discarded – undo
757 757
 	ob_start();
758 758
 
759 759
 
760
-    $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
760
+	$use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
761 761
     
762 762
 	// let users add custom css classes
763 763
 	$custom_classes = apply_filters( 'lasso_wpimg_classes', '' );
@@ -859,9 +859,9 @@  discard block
 block discarded – undo
859 859
 function lasso_editor_options_blob() {
860 860
 
861 861
 	$codes   = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : array();
862
-    $codes   = add_wpimg_options( $codes );
862
+	$codes   = add_wpimg_options( $codes );
863 863
 	$codes   = add_wpimg_block_options( $codes );
864
-    $codes   = apply_filters( 'lasso_custom_options', $codes );
864
+	$codes   = apply_filters( 'lasso_custom_options', $codes );
865 865
 	$galleries  = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery';
866 866
 
867 867
 	$nonce = wp_create_nonce( 'lasso_gallery' );
@@ -963,9 +963,9 @@  discard block
 block discarded – undo
963 963
 		$return .= '</form>';
964 964
 
965 965
 		// extra JS codes
966
-        if (isset($shortcode['codes'])) {
967
-		    $return .= $shortcode['codes'];
968
-        }
966
+		if (isset($shortcode['codes'])) {
967
+			$return .= $shortcode['codes'];
968
+		}
969 969
 		$blob[$slug] = $return;
970 970
 	}
971 971
 
@@ -974,95 +974,95 @@  discard block
 block discarded – undo
974 974
 
975 975
 
976 976
 function add_wpimg_options( $shortcodes ) {
977
-    $custom = array(
978
-        'wpimg'    => array(
979
-            'name'     => __( 'Image', 'lasso' ),
980
-            'type'     => 'single',
981
-            'atts'     => array(
982
-                'img'    => array(
983
-                    'type'  => 'media_upload',
984
-                    'default'  => '',
985
-                    'desc'   => __( 'Image URL', 'lasso' ),
986
-                    'tip'  => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' )
987
-                ),
988
-                'align'    => array(
989
-                    'type'  => 'select',
990
-                    'values'  => array(						
991
-                        array(
992
-                            'value' => 'center',
993
-                            'name' => __( 'Center', 'aesop-core' )
994
-                        ),
995
-                        array(
996
-                            'value' => 'left',
997
-                            'name' => __( 'Left', 'aesop-core' )
998
-                        ),
999
-                        array(
1000
-                            'value' => 'right',
1001
-                            'name' => __( 'Right', 'aesop-core' )
1002
-                        ),
1003
-                    ),
1004
-                    'default'  => 'center',
1005
-                    'desc'   => __( 'Alignment', 'lasso' ),
1006
-                    'tip'=>''
1007
-                ),			
977
+	$custom = array(
978
+		'wpimg'    => array(
979
+			'name'     => __( 'Image', 'lasso' ),
980
+			'type'     => 'single',
981
+			'atts'     => array(
982
+				'img'    => array(
983
+					'type'  => 'media_upload',
984
+					'default'  => '',
985
+					'desc'   => __( 'Image URL', 'lasso' ),
986
+					'tip'  => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' )
987
+				),
988
+				'align'    => array(
989
+					'type'  => 'select',
990
+					'values'  => array(						
991
+						array(
992
+							'value' => 'center',
993
+							'name' => __( 'Center', 'aesop-core' )
994
+						),
995
+						array(
996
+							'value' => 'left',
997
+							'name' => __( 'Left', 'aesop-core' )
998
+						),
999
+						array(
1000
+							'value' => 'right',
1001
+							'name' => __( 'Right', 'aesop-core' )
1002
+						),
1003
+					),
1004
+					'default'  => 'center',
1005
+					'desc'   => __( 'Alignment', 'lasso' ),
1006
+					'tip'=>''
1007
+				),			
1008 1008
                 
1009
-                'imgwidth'    => array(
1010
-                    'type'  => 'text_small',
1011
-                    'default'  => '300px',
1012
-                    'desc'   => __( 'Image Width', 'lasso' ),
1013
-                    'tip'  => __( 'Width of the image. You can enter the size in pixels or percentage such as <code>40%</code> or <code>500px</code>.', 'aesop-core' )
1014
-                ),
1015
-                'imgheight'    => array(
1016
-                    'type'  => 'text_small',
1017
-                    'default'  => '',
1018
-                    'desc'   => __( 'Image Height', 'lasso' ),
1019
-                    'tip'  => __( 'Used only for the Panorama mode. Can be set using pixel values such as <code>500px</code>. If unspecified, the original height would be used. ', 'aesop-core' )
1020
-                ),	
1021
-                'linkoption'    => array(
1022
-                    'type'  => 'select',
1023
-                    'values'  => array(						
1024
-                        array(
1025
-                            'value' => 'none',
1026
-                            'name' => __( 'None', 'aesop-core' )
1027
-                        ),
1028
-                        array(
1029
-                            'value' => 'img',
1030
-                            'name' => __( 'Image', 'aesop-core' )
1031
-                        ),
1032
-                        array(
1033
-                            'value' => 'url',
1034
-                            'name' => __( 'URL', 'aesop-core' )
1035
-                        ),
1036
-                    ),
1037
-                    'default'  => 'none',
1038
-                    'desc'   => __( 'Link', 'lasso' ),
1039
-                    'tip'  => __( 'Click leads to:', 'lasso' )
1040
-                ),				
1009
+				'imgwidth'    => array(
1010
+					'type'  => 'text_small',
1011
+					'default'  => '300px',
1012
+					'desc'   => __( 'Image Width', 'lasso' ),
1013
+					'tip'  => __( 'Width of the image. You can enter the size in pixels or percentage such as <code>40%</code> or <code>500px</code>.', 'aesop-core' )
1014
+				),
1015
+				'imgheight'    => array(
1016
+					'type'  => 'text_small',
1017
+					'default'  => '',
1018
+					'desc'   => __( 'Image Height', 'lasso' ),
1019
+					'tip'  => __( 'Used only for the Panorama mode. Can be set using pixel values such as <code>500px</code>. If unspecified, the original height would be used. ', 'aesop-core' )
1020
+				),	
1021
+				'linkoption'    => array(
1022
+					'type'  => 'select',
1023
+					'values'  => array(						
1024
+						array(
1025
+							'value' => 'none',
1026
+							'name' => __( 'None', 'aesop-core' )
1027
+						),
1028
+						array(
1029
+							'value' => 'img',
1030
+							'name' => __( 'Image', 'aesop-core' )
1031
+						),
1032
+						array(
1033
+							'value' => 'url',
1034
+							'name' => __( 'URL', 'aesop-core' )
1035
+						),
1036
+					),
1037
+					'default'  => 'none',
1038
+					'desc'   => __( 'Link', 'lasso' ),
1039
+					'tip'  => __( 'Click leads to:', 'lasso' )
1040
+				),				
1041 1041
                 
1042
-                'link'    => array(
1043
-                    'type'  => 'text',
1044
-                    'default'  => '',
1045
-                    'desc'   => __( 'URL Link', 'lasso' ),
1046
-                    'tip'  => __( 'URL link', 'lasso' )
1047
-                ),
1048
-                'alt'    => array(
1049
-                    'type'  => 'text',
1050
-                    'default'  => '',
1051
-                    'desc'   => __( 'Image ALT', 'lasso' ),
1052
-                    'tip'  => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' )
1053
-                ),
1042
+				'link'    => array(
1043
+					'type'  => 'text',
1044
+					'default'  => '',
1045
+					'desc'   => __( 'URL Link', 'lasso' ),
1046
+					'tip'  => __( 'URL link', 'lasso' )
1047
+				),
1048
+				'alt'    => array(
1049
+					'type'  => 'text',
1050
+					'default'  => '',
1051
+					'desc'   => __( 'Image ALT', 'lasso' ),
1052
+					'tip'  => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' )
1053
+				),
1054 1054
                 
1055
-                'caption'    => array(
1056
-                    'type'  => 'text_area',
1057
-                    'default'  => '',
1058
-                    'desc'   => __( 'Caption', 'lasso' ),
1059
-                    'tip'  => __( 'Optional caption for the image.', 'lasso' )
1060
-                ),
1055
+				'caption'    => array(
1056
+					'type'  => 'text_area',
1057
+					'default'  => '',
1058
+					'desc'   => __( 'Caption', 'lasso' ),
1059
+					'tip'  => __( 'Optional caption for the image.', 'lasso' )
1060
+				),
1061 1061
                 
1062 1062
 
1063
-            ),
1064
-            'desc'     => __( 'An image.', 'aesop-core' ),
1065
-            'codes'    => '<script>	            
1063
+			),
1064
+			'desc'     => __( 'An image.', 'aesop-core' ),
1065
+			'codes'    => '<script>	            
1066 1066
 						jQuery(document).ready(function($){
1067 1067
                             function linkSetting(l){								
1068 1068
 							    if ( l=="url") {
@@ -1082,69 +1082,69 @@  discard block
 block discarded – undo
1082 1082
 							})
1083 1083
 						});
1084 1084
 			           </script>'
1085
-        )
1086
-    );
1085
+		)
1086
+	);
1087 1087
 
1088
-    return array_merge( $shortcodes, $custom );
1088
+	return array_merge( $shortcodes, $custom );
1089 1089
 }
1090 1090
 
1091 1091
 function add_wpimg_block_options( $shortcodes ) {
1092
-    $custom = array(
1093
-        'wpimg-block'    => array(
1094
-            'name'     => __( 'Image', 'lasso' ),
1095
-            'type'     => 'single',
1096
-            'atts'     => array(
1097
-                'img'    => array(
1098
-                    'type'  => 'media_upload',
1099
-                    'default'  => '',
1100
-                    'desc'   => __( 'Image URL', 'lasso' ),
1101
-                    'tip'  => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' )
1102
-                ),
1103
-                'align'    => array(
1104
-                    'type'  => 'select',
1105
-                    'values'  => array(						
1106
-                        array(
1107
-                            'value' => 'center',
1108
-                            'name' => __( 'Center', 'aesop-core' )
1109
-                        ),
1110
-                        array(
1111
-                            'value' => 'left',
1112
-                            'name' => __( 'Left', 'aesop-core' )
1113
-                        ),
1114
-                        array(
1115
-                            'value' => 'right',
1116
-                            'name' => __( 'Right', 'aesop-core' )
1117
-                        ),
1118
-                    ),
1119
-                    'default'  => 'center',
1120
-                    'desc'   => __( 'Alignment', 'lasso' ),
1121
-                    'tip'=>''
1122
-                ),		
1123
-                'alt'    => array(
1124
-                    'type'  => 'text',
1125
-                    'default'  => '',
1126
-                    'desc'   => __( 'Image ALT', 'lasso' ),
1127
-                    'tip'  => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' )
1128
-                ),
1129
-                'caption'    => array(
1130
-                    'type'  => 'text',
1131
-                    'default'  => '',
1132
-                    'desc'   => __( 'Caption', 'lasso' ),
1133
-                    'tip'  => __( 'Caption for the image.', 'lasso' )
1134
-                ),
1092
+	$custom = array(
1093
+		'wpimg-block'    => array(
1094
+			'name'     => __( 'Image', 'lasso' ),
1095
+			'type'     => 'single',
1096
+			'atts'     => array(
1097
+				'img'    => array(
1098
+					'type'  => 'media_upload',
1099
+					'default'  => '',
1100
+					'desc'   => __( 'Image URL', 'lasso' ),
1101
+					'tip'  => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' )
1102
+				),
1103
+				'align'    => array(
1104
+					'type'  => 'select',
1105
+					'values'  => array(						
1106
+						array(
1107
+							'value' => 'center',
1108
+							'name' => __( 'Center', 'aesop-core' )
1109
+						),
1110
+						array(
1111
+							'value' => 'left',
1112
+							'name' => __( 'Left', 'aesop-core' )
1113
+						),
1114
+						array(
1115
+							'value' => 'right',
1116
+							'name' => __( 'Right', 'aesop-core' )
1117
+						),
1118
+					),
1119
+					'default'  => 'center',
1120
+					'desc'   => __( 'Alignment', 'lasso' ),
1121
+					'tip'=>''
1122
+				),		
1123
+				'alt'    => array(
1124
+					'type'  => 'text',
1125
+					'default'  => '',
1126
+					'desc'   => __( 'Image ALT', 'lasso' ),
1127
+					'tip'  => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' )
1128
+				),
1129
+				'caption'    => array(
1130
+					'type'  => 'text',
1131
+					'default'  => '',
1132
+					'desc'   => __( 'Caption', 'lasso' ),
1133
+					'tip'  => __( 'Caption for the image.', 'lasso' )
1134
+				),
1135 1135
                
1136 1136
 
1137
-            ),
1138
-            'desc'     => __( 'A WP Image Block.', 'aesop-core' ),
1139
-            'codes'    => '<script>	            
1137
+			),
1138
+			'desc'     => __( 'A WP Image Block.', 'aesop-core' ),
1139
+			'codes'    => '<script>	            
1140 1140
 						jQuery(document).ready(function($){
1141 1141
                             
1142 1142
 						});
1143 1143
 			           </script>'
1144
-        )
1145
-    );
1144
+		)
1145
+	);
1146 1146
 
1147
-    return array_merge( $shortcodes, $custom );
1147
+	return array_merge( $shortcodes, $custom );
1148 1148
 }
1149 1149
 
1150 1150
 /**
@@ -1189,23 +1189,23 @@  discard block
 block discarded – undo
1189 1189
  * @return string
1190 1190
  */
1191 1191
 function lasso_editor_adjustBrightness($hex, $steps) { 
1192
-    $steps = max(-255, min(255, $steps));
1192
+	$steps = max(-255, min(255, $steps));
1193 1193
 
1194
-    // Normalize into a six character long hex string
1195
-    $hex = str_replace('#', '', $hex);
1196
-    if (strlen($hex) == 3) {
1197
-        $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2);
1198
-    }
1194
+	// Normalize into a six character long hex string
1195
+	$hex = str_replace('#', '', $hex);
1196
+	if (strlen($hex) == 3) {
1197
+		$hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2);
1198
+	}
1199 1199
 
1200
-    // Split into three parts: R, G and B
1201
-    $color_parts = str_split($hex, 2);
1202
-    $return = '#';
1200
+	// Split into three parts: R, G and B
1201
+	$color_parts = str_split($hex, 2);
1202
+	$return = '#';
1203 1203
 
1204
-    foreach ($color_parts as $color) {
1205
-        $color   = hexdec($color); // Convert to decimal
1206
-        $color   = max(0,min(255,$color + $steps)); // Adjust color
1207
-        $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code
1208
-    }
1204
+	foreach ($color_parts as $color) {
1205
+		$color   = hexdec($color); // Convert to decimal
1206
+		$color   = max(0,min(255,$color + $steps)); // Adjust color
1207
+		$return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code
1208
+	}
1209 1209
 
1210
-    return $return;
1210
+	return $return;
1211 1211
 }
Please login to merge, or discard this patch.
Spacing   +314 added lines, -314 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
 		
63 63
 		
@@ -67,32 +67,32 @@  discard block
 block discarded – undo
67 67
 		?>
68 68
 		
69 69
 		.lasso-editor-controls--wrap, #lasso--post-settings2,#lasso--save,#lasso--post-delete,#lasso--exit,#lasso--publish {
70
-			background-image: -webkit-linear-gradient(top,<?php echo $button_color1;?> 0,<?php echo $button_color2;?> 100%);
71
-			background-image: -o-linear-gradient(top,<?php echo $button_color1;?> 0,<?php echo $button_color2;?> 100%);
72
-			background-image: linear-gradient(to bottom,<?php echo $button_color1;?> 0,<?php echo $button_color2;?> 100%);
73
-			color: <?php echo $text_color;?>;
70
+			background-image: -webkit-linear-gradient(top,<?php echo $button_color1; ?> 0,<?php echo $button_color2; ?> 100%);
71
+			background-image: -o-linear-gradient(top,<?php echo $button_color1; ?> 0,<?php echo $button_color2; ?> 100%);
72
+			background-image: linear-gradient(to bottom,<?php echo $button_color1; ?> 0,<?php echo $button_color2; ?> 100%);
73
+			color: <?php echo $text_color; ?>;
74 74
 		}
75 75
 		
76 76
 		.lasso--controls__right a:before, #lasso-toolbar--html__footer_desc, ul.lasso-editor-controls li:before,#lasso-side-comp-button.toolbar--side li:before
77 77
         {
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) { ?>
@@ -126,48 +126,48 @@  discard block
 block discarded – undo
126 126
         }
127 127
         ?>
128 128
         </style>
129
-		<div id="lasso--controls" class="lasso-post-status--<?php echo sanitize_html_class( $status );?> <?php echo sanitize_html_class( $custom_classes );?>" data-post-id="<?php echo get_the_ID();?>" >
129
+		<div id="lasso--controls" class="lasso-post-status--<?php echo sanitize_html_class($status); ?> <?php echo sanitize_html_class($custom_classes); ?>" data-post-id="<?php echo get_the_ID(); ?>" >
130 130
 
131
-			<ul class="lasso--controls__center lasso-editor-controls lasso-editor-controls--wrap <?php echo $post_access_class;?> "  <?php echo $mobile_style ?> >
131
+			<ul class="lasso--controls__center lasso-editor-controls lasso-editor-controls--wrap <?php echo $post_access_class; ?> "  <?php echo $mobile_style ?> >
132 132
 
133
-				<?php do_action( 'lasso_editor_controls_before' );
133
+				<?php do_action('lasso_editor_controls_before');
134 134
 
135
-				if ( $is_capable ) { ?>
135
+				if ($is_capable) { ?>
136 136
 
137
-					<li id="lasso--edit" title="<?php esc_attr_e( 'Edit Post', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
137
+					<li id="lasso--edit" title="<?php esc_attr_e('Edit Post', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
138 138
 
139
-					<?php if ( 'off' == $post_settings_disabled || empty( $post_settings_disabled ) ) { ?>
140
-						<li id="lasso--post-settings" title="<?php esc_attr_e( 'Post Settings', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
139
+					<?php if ('off' == $post_settings_disabled || empty($post_settings_disabled)) { ?>
140
+						<li id="lasso--post-settings" title="<?php esc_attr_e('Post Settings', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
141 141
 					<?php }
142 142
 
143 143
 				} ?>
144 144
 
145
-				<li id="lasso--post-all" title="<?php esc_attr_e( 'All Posts', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
145
+				<li id="lasso--post-all" title="<?php esc_attr_e('All Posts', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
146 146
 
147
-				<?php if ( $is_capable && wp_revisions_enabled( $post ) ) { ?>
148
-					<li id="lasso--post-revisions" title="<?php esc_attr_e( 'Revisions', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
147
+				<?php if ($is_capable && wp_revisions_enabled($post)) { ?>
148
+					<li id="lasso--post-revisions" title="<?php esc_attr_e('Revisions', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
149 149
 				<?php } ?>
150 150
 
151
-				<?php if ( ( 'off' == $post_new_disabled || empty( $post_new_disabled ) && lasso_user_can('edit_posts') ) ) { ?>
152
-					<li id="lasso--post-new" title="<?php esc_attr_e( 'Add Post', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
151
+				<?php if (('off' == $post_new_disabled || empty($post_new_disabled) && lasso_user_can('edit_posts'))) { ?>
152
+					<li id="lasso--post-new" title="<?php esc_attr_e('Add Post', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
153 153
 				<?php } ?>
154 154
 
155
-				<?php do_action( 'lasso_editor_controls_after' );?>
155
+				<?php do_action('lasso_editor_controls_after'); ?>
156 156
 
157 157
 			</ul>
158 158
 
159
-			<?php if ( is_singular() && !$is_mobile ) { ?>
159
+			<?php if (is_singular() && !$is_mobile) { ?>
160 160
 
161
-				<div class="lasso--controls__right" data-posttype="<?php echo get_post_type( get_the_ID() );?>" data-status="<?php echo $status;?>">
161
+				<div class="lasso--controls__right" data-posttype="<?php echo get_post_type(get_the_ID()); ?>" data-status="<?php echo $status; ?>">
162 162
 				
163
-					<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>
164
-					<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>
163
+					<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>
164
+					<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>
165 165
 
166 166
 
167
-					<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>
167
+					<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>
168 168
 
169
-					<?php if ( ('draft' == $status ) || ('pending' == $status && $can_publish) ) { ?>
170
-						<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>
169
+					<?php if (('draft' == $status) || ('pending' == $status && $can_publish)) { ?>
170
+						<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>
171 171
 					<?php } ?>
172 172
 					
173 173
 
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 		</div>
179 179
 		
180 180
 		
181
-		<?php do_action( 'lasso_editor_controls_after_outside' );?>
181
+		<?php do_action('lasso_editor_controls_after_outside'); ?>
182 182
 
183 183
 	<?php }
184 184
 }
@@ -196,9 +196,9 @@  discard block
 block discarded – undo
196 196
 
197 197
 
198 198
 	// let users add custom css classes
199
-	$custom_classes = apply_filters( 'lasso_sidebar_classes', '' );
199
+	$custom_classes = apply_filters('lasso_sidebar_classes', '');
200 200
 	?>
201
-	<div id="lasso--sidebar" class="<?php echo sanitize_html_class( $custom_classes );?>" >
201
+	<div id="lasso--sidebar" class="<?php echo sanitize_html_class($custom_classes); ?>" >
202 202
 		<div class="lasso--sidebar__inner">
203 203
 			<div id="aesop-generator-settings"><div id="lasso--component__settings"></div></div>
204 204
 		</div>
@@ -220,21 +220,21 @@  discard block
 block discarded – undo
220 220
 	$is_mobile = wp_is_mobile();
221 221
 
222 222
 	// check for lasso story engine and add a class doniting this
223
-	$ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active';
223
+	$ase_status = class_exists('Aesop_Core') || defined('LASSO_CUSTOM') ? 'ase-active' : 'ase-not-active';
224 224
 
225 225
 	// let users add custom css classes
226
-	$custom_classes = apply_filters( 'lasso_toolbar_classes', '' );
226
+	$custom_classes = apply_filters('lasso_toolbar_classes', '');
227 227
 
228 228
 	// are toolbar headings enabled
229
-	$toolbar_headings      = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' );
230
-	$toolbar_headings_h4      = lasso_editor_get_option( 'toolbar_headings_h4', 'lasso_editor' );
231
-	$toolbar_list      = lasso_editor_get_option( 'toolbar_list', 'lasso_editor' );
229
+	$toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor');
230
+	$toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
231
+	$toolbar_list = lasso_editor_get_option('toolbar_list', 'lasso_editor');
232 232
 
233
-	$toolbar_class  = $toolbar_headings ? 'toolbar-extended' : false;
233
+	$toolbar_class = $toolbar_headings ? 'toolbar-extended' : false;
234 234
 	
235 235
 	// mobile styles
236 236
     $mobile_class = $is_mobile ? 'lasso-mobile' : false;
237
-	$mobile_style =$is_mobile ? 'style="bottom:0px;"' : null;
237
+	$mobile_style = $is_mobile ? 'style="bottom:0px;"' : null;
238 238
 	
239 239
 	//show color
240 240
 	$show_color = lasso_editor_get_option('toolbar_show_color', 'lasso_editor');
@@ -242,131 +242,131 @@  discard block
 block discarded – undo
242 242
 	//show alignment
243 243
 	$show_align = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor');
244 244
 	
245
-	$status = get_post_status( get_the_ID() );
245
+	$status = get_post_status(get_the_ID());
246 246
 	
247
-	$shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' );
247
+	$shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor');
248 248
 	
249
-	$sc_saving_class = ('on' == $shortcodify_disabled || $ase_status == 'ase-not-active')  ? 'shortcodify-disabled' : 'shortcodify-enabled';
249
+	$sc_saving_class = ('on' == $shortcodify_disabled || $ase_status == 'ase-not-active') ? 'shortcodify-disabled' : 'shortcodify-enabled';
250 250
 
251
-    $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
251
+    $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor', 'off');
252 252
 
253 253
 	?>
254
-	<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 ?>>
255
-		<ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"';}?>>
256
-			<?php do_action( 'lasso_toolbar_components_before' );?>
257
-		    <li id="lasso-toolbar--bold" title="<?php esc_attr_e( 'Bold', 'lasso' );?>"></li>
258
-		    <li id="lasso-toolbar--underline" title="<?php esc_attr_e( 'Underline', 'lasso' );?>"></li>
259
-		    <li id="lasso-toolbar--italic" title="<?php esc_attr_e( 'Italicize', 'lasso' );?>"></li>
260
-		    <li id="lasso-toolbar--strike" title="<?php esc_attr_e( 'Strikethrough', 'lasso' );?>"></li>
261
-			<li id="lasso-toolbar--components" class="lasso-toolbar--components" title="<?php esc_attr_e( 'Insert Component', 'lasso' );?>" style="color:#ffffa0;">
254
+	<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 ?>>
255
+		<ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"'; }?>>
256
+			<?php do_action('lasso_toolbar_components_before'); ?>
257
+		    <li id="lasso-toolbar--bold" title="<?php esc_attr_e('Bold', 'lasso'); ?>"></li>
258
+		    <li id="lasso-toolbar--underline" title="<?php esc_attr_e('Underline', 'lasso'); ?>"></li>
259
+		    <li id="lasso-toolbar--italic" title="<?php esc_attr_e('Italicize', 'lasso'); ?>"></li>
260
+		    <li id="lasso-toolbar--strike" title="<?php esc_attr_e('Strikethrough', 'lasso'); ?>"></li>
261
+			<li id="lasso-toolbar--components" class="lasso-toolbar--components" title="<?php esc_attr_e('Insert Component', 'lasso'); ?>" style="color:#ffffa0;">
262 262
 			    <ul id="lasso-toolbar--components__list" style="display:none;color:white;">
263
-			    	<?php if ( 'ase-active' == $ase_status ): ?>
264
-						<li data-type="image" title="<?php esc_attr_e( 'Image', 'lasso' );?>" class="lasso-toolbar--component__image"></li>
265
-						<li data-type="character" title="<?php esc_attr_e( 'Character', 'lasso' );?>" class="lasso-toolbar--component__character"></li>
266
-						<li data-type="quote" title="<?php esc_attr_e( 'Quote', 'lasso' );?>"  class="lasso-toolbar--component__quote"></li>
267
-						<!--li data-type="content" title="<?php esc_attr_e( 'Content', 'lasso' );?>"  class="lasso-toolbar--component__content"></li-->
268
-						<li data-type="chapter" title="<?php esc_attr_e( 'Chapter', 'lasso' );?>"  class="lasso-toolbar--component__chapter"></li>
269
-						<li data-type="parallax" title="<?php esc_attr_e( 'Parallax', 'lasso' );?>"  class="lasso-toolbar--component__parallax"></li>
270
-						<li data-type="audio" title="<?php esc_attr_e( 'Audio', 'lasso' );?>"  class="lasso-toolbar--component__audio"></li>
271
-						<li data-type="video" title="<?php esc_attr_e( 'Video', 'lasso' );?>"  class="lasso-toolbar--component__video"></li>
272
-						<li data-type="map" title="<?php esc_attr_e( 'Map', 'lasso' );?>"  class="lasso-toolbar--component__map"></li>
273
-						<li data-type="timeline_stop" title="<?php esc_attr_e( 'Timeline', 'lasso' );?>"  class="lasso-toolbar--component__timeline"></li>
274
-						<li data-type="document" title="<?php esc_attr_e( 'Document', 'lasso' );?>"  class="lasso-toolbar--component__document"></li>
275
-						<li data-type="collection" title="<?php esc_attr_e( 'Collection', 'lasso' );?>"  class="lasso-toolbar--component__collection"></li>
276
-						<li data-type="gallery" title="<?php esc_attr_e( 'Gallery', 'lasso' );?>"  class="lasso-toolbar--component__gallery"></li>
277
-						<?php if ( class_exists ('Aesop_GalleryPop') ) { ?>
278
-						     <li data-type="gallery" title="<?php esc_attr_e( 'Gallery Pop', 'lasso' );?>"  class="lasso-toolbar--component__gallerypop"></li>
263
+			    	<?php if ('ase-active' == $ase_status): ?>
264
+						<li data-type="image" title="<?php esc_attr_e('Image', 'lasso'); ?>" class="lasso-toolbar--component__image"></li>
265
+						<li data-type="character" title="<?php esc_attr_e('Character', 'lasso'); ?>" class="lasso-toolbar--component__character"></li>
266
+						<li data-type="quote" title="<?php esc_attr_e('Quote', 'lasso'); ?>"  class="lasso-toolbar--component__quote"></li>
267
+						<!--li data-type="content" title="<?php esc_attr_e('Content', 'lasso'); ?>"  class="lasso-toolbar--component__content"></li-->
268
+						<li data-type="chapter" title="<?php esc_attr_e('Chapter', 'lasso'); ?>"  class="lasso-toolbar--component__chapter"></li>
269
+						<li data-type="parallax" title="<?php esc_attr_e('Parallax', 'lasso'); ?>"  class="lasso-toolbar--component__parallax"></li>
270
+						<li data-type="audio" title="<?php esc_attr_e('Audio', 'lasso'); ?>"  class="lasso-toolbar--component__audio"></li>
271
+						<li data-type="video" title="<?php esc_attr_e('Video', 'lasso'); ?>"  class="lasso-toolbar--component__video"></li>
272
+						<li data-type="map" title="<?php esc_attr_e('Map', 'lasso'); ?>"  class="lasso-toolbar--component__map"></li>
273
+						<li data-type="timeline_stop" title="<?php esc_attr_e('Timeline', 'lasso'); ?>"  class="lasso-toolbar--component__timeline"></li>
274
+						<li data-type="document" title="<?php esc_attr_e('Document', 'lasso'); ?>"  class="lasso-toolbar--component__document"></li>
275
+						<li data-type="collection" title="<?php esc_attr_e('Collection', 'lasso'); ?>"  class="lasso-toolbar--component__collection"></li>
276
+						<li data-type="gallery" title="<?php esc_attr_e('Gallery', 'lasso'); ?>"  class="lasso-toolbar--component__gallery"></li>
277
+						<?php if (class_exists('Aesop_GalleryPop')) { ?>
278
+						     <li data-type="gallery" title="<?php esc_attr_e('Gallery Pop', 'lasso'); ?>"  class="lasso-toolbar--component__gallerypop"></li>
279 279
 						<?php }?>
280
-						<?php if ( class_exists ('Aesop_Events') ) { ?>
281
-						     <li data-type="events" title="<?php esc_attr_e( 'Event', 'lasso' );?>"  class="lasso-toolbar--component__event"></li>
280
+						<?php if (class_exists('Aesop_Events')) { ?>
281
+						     <li data-type="events" title="<?php esc_attr_e('Event', 'lasso'); ?>"  class="lasso-toolbar--component__event"></li>
282 282
 						<?php }?>
283 283
 					<?php else: ?>
284 284
                         <?php if ($use_wp_block_image == 'on') { ?>
285
-                            <li data-type="wpimg-block" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li>
285
+                            <li data-type="wpimg-block" title="<?php esc_attr_e('WordPress Image', 'lasso'); ?>" class="image lasso-toolbar--component__image"></li>
286 286
                         <?php } else { ?>
287
-						    <li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li>
287
+						    <li data-type="wpimg" title="<?php esc_attr_e('WordPress Image', 'lasso'); ?>" class="image lasso-toolbar--component__image"></li>
288 288
                         <?php } ?>
289
-						<li data-type="wpquote" title="<?php esc_attr_e( 'WordPress Quote', 'lasso' );?>" class="quote lasso-toolbar--component__quote"></li>
290
-						<!--li data-type="wpvideo" title="<?php esc_attr_e( 'WordPress Video', 'lasso' );?>" class="video lasso-toolbar--component__video"></li-->
289
+						<li data-type="wpquote" title="<?php esc_attr_e('WordPress Quote', 'lasso'); ?>" class="quote lasso-toolbar--component__quote"></li>
290
+						<!--li data-type="wpvideo" title="<?php esc_attr_e('WordPress Video', 'lasso'); ?>" class="video lasso-toolbar--component__video"></li-->
291 291
 					<?php endif; ?>
292
-					<?php do_action( 'lasso_toolbar_components' );?>
292
+					<?php do_action('lasso_toolbar_components'); ?>
293 293
 			    </ul>
294 294
 			</li>
295
-		    <?php if ( $toolbar_headings ): ?>
296
-		    <li id="lasso-toolbar--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"></li>
297
-		    <li id="lasso-toolbar--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"></li>
295
+		    <?php if ($toolbar_headings): ?>
296
+		    <li id="lasso-toolbar--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"></li>
297
+		    <li id="lasso-toolbar--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"></li>
298 298
 			<?php endif; ?>
299 299
 			
300 300
 			
301 301
 			
302
-			<?php if ( $toolbar_headings_h4 ): ?>
303
-		    <li id="lasso-toolbar--h4" title="<?php esc_attr_e( 'H4 Heading', 'lasso' );?>"></li>
304
-		    <li id="lasso-toolbar--h5" title="<?php esc_attr_e( 'H5 Heading', 'lasso' );?>"></li>
305
-			<li id="lasso-toolbar--h6" title="<?php esc_attr_e( 'H6 Heading', 'lasso' );?>"></li>
302
+			<?php if ($toolbar_headings_h4): ?>
303
+		    <li id="lasso-toolbar--h4" title="<?php esc_attr_e('H4 Heading', 'lasso'); ?>"></li>
304
+		    <li id="lasso-toolbar--h5" title="<?php esc_attr_e('H5 Heading', 'lasso'); ?>"></li>
305
+			<li id="lasso-toolbar--h6" title="<?php esc_attr_e('H6 Heading', 'lasso'); ?>"></li>
306 306
 			<?php endif; ?>
307 307
 			
308
-			<?php if ( $show_color ): ?>
309
-		    <li id="lasso-toolbar--color-set" title="<?php esc_attr_e( 'Set Color for Selected Text', 'lasso' );?>"></li>
310
-		    <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e( 'Choose Color', 'lasso' );?>"></li>
308
+			<?php if ($show_color): ?>
309
+		    <li id="lasso-toolbar--color-set" title="<?php esc_attr_e('Set Color for Selected Text', 'lasso'); ?>"></li>
310
+		    <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e('Choose Color', 'lasso'); ?>"></li>
311 311
 			<?php endif; ?>
312 312
 			
313
-			<?php if ( $toolbar_list ): ?>
314
-		    <li id="lasso-toolbar--ol" title="<?php esc_attr_e( 'Ordered List', 'lasso' );?>"></li>
315
-		    <li id="lasso-toolbar--ul" title="<?php esc_attr_e( 'Unordered List', 'lasso' );?>"></li>
313
+			<?php if ($toolbar_list): ?>
314
+		    <li id="lasso-toolbar--ol" title="<?php esc_attr_e('Ordered List', 'lasso'); ?>"></li>
315
+		    <li id="lasso-toolbar--ul" title="<?php esc_attr_e('Unordered List', 'lasso'); ?>"></li>
316 316
 			<?php endif; ?>
317 317
 					
318 318
 		    
319
-			<li id="lasso-toolbar--link" title="<?php esc_attr_e( 'Anchor Link', 'lasso' );?>">
319
+			<li id="lasso-toolbar--link" title="<?php esc_attr_e('Anchor Link', 'lasso'); ?>">
320 320
 		    	<div id="lasso-toolbar--link__wrap" <?php echo $mobile_style ?> >
321
-		    		<div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'http://url.com', 'lasso' );?>"></div>
322
-		    		<a href="#" title="<?php esc_attr_e( 'Create Link', 'lasso' );?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a>
321
+		    		<div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e('http://url.com', 'lasso'); ?>"></div>
322
+		    		<a href="#" title="<?php esc_attr_e('Create Link', 'lasso'); ?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a>
323 323
 					<input class="styled-checkbox" type="checkbox" id="aesop-toolbar--link_newtab" checked/>
324
-                    <label for="aesop-toolbar--link_newtab"><?php esc_attr_e( 'Open in a New Tab', 'lasso' );?></label>
324
+                    <label for="aesop-toolbar--link_newtab"><?php esc_attr_e('Open in a New Tab', 'lasso'); ?></label>
325 325
 		    	</div>
326 326
 		    </li>
327
-		    <?php do_action( 'lasso_toolbar_components_after' );?>
328
-		    <li id="lasso-toolbar--html" title="<?php esc_attr_e( 'Insert HTML or Code', 'lasso' );?>">
327
+		    <?php do_action('lasso_toolbar_components_after'); ?>
328
+		    <li id="lasso-toolbar--html" title="<?php esc_attr_e('Insert HTML or Code', 'lasso'); ?>">
329 329
 		    	<div id="lasso-toolbar--html__wrap" <?php echo $mobile_style ?>>
330
-		    		<div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?>"></div>
330
+		    		<div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e('Enter HTML to insert', 'lasso'); ?>"></div>
331 331
 		    		<div id="lasso-toolbar--html__footer">
332 332
 					<div id="lasso-toolbar--html__footer_desc" >
333
-					<?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?><br>
334
-					<?php esc_attr_e( 'You can also use Shortcodes', 'lasso' );?><br>
335
-					<?php esc_attr_e( 'You can also enter a URL to embed, such as Youtube, Vimeo and Twitter URLs.', 'lasso' );?>
333
+					<?php esc_attr_e('Enter HTML to insert', 'lasso'); ?><br>
334
+					<?php esc_attr_e('You can also use Shortcodes', 'lasso'); ?><br>
335
+					<?php esc_attr_e('You can also enter a URL to embed, such as Youtube, Vimeo and Twitter URLs.', 'lasso'); ?>
336 336
 					</div>
337 337
 		    			<ul class="lasso-toolbar--html-snips">
338 338
 						
339
-		    				<?php if ( !$toolbar_headings ): ?>
340
-		    				<li id="lasso-html--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>">
341
-		    				<li id="lasso-html--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>">
339
+		    				<?php if (!$toolbar_headings): ?>
340
+		    				<li id="lasso-html--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>">
341
+		    				<li id="lasso-html--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>">
342 342
 		    				<?php endif; ?>
343
-		    				<li id="lasso-html--ol" title="<?php esc_attr_e( 'Ordered List', 'lasso' );?>">
344
-							<li id="lasso-html--ul" title="<?php esc_attr_e( 'Unordered List', 'lasso' );?>">
343
+		    				<li id="lasso-html--ol" title="<?php esc_attr_e('Ordered List', 'lasso'); ?>">
344
+							<li id="lasso-html--ul" title="<?php esc_attr_e('Unordered List', 'lasso'); ?>">
345 345
 							
346
-							<li id="lasso-html--table" title="<?php esc_attr_e( 'Table', 'lasso' );?>">
346
+							<li id="lasso-html--table" title="<?php esc_attr_e('Table', 'lasso'); ?>">
347 347
 		    			</ul>
348
-		    			<a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e( 'Cancel', 'lasso' );?></a>
349
-		    			<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>
348
+		    			<a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e('Cancel', 'lasso'); ?></a>
349
+		    			<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>
350 350
 		    		</div>
351 351
 		    	</div>
352 352
 		    </li>
353
-			<?php if ( $show_align ): ?>
354
-		    <li id="lasso-toolbar--left-align" title="<?php esc_attr_e( 'Text Left Align', 'lasso' );?>"></li>
355
-		    <li id="lasso-toolbar--center-align" title="<?php esc_attr_e( 'Text Center Align', 'lasso' );?>"></li>
356
-			<li id="lasso-toolbar--right-align" title="<?php esc_attr_e( 'Text Right Align', 'lasso' );?>"></li>
353
+			<?php if ($show_align): ?>
354
+		    <li id="lasso-toolbar--left-align" title="<?php esc_attr_e('Text Left Align', 'lasso'); ?>"></li>
355
+		    <li id="lasso-toolbar--center-align" title="<?php esc_attr_e('Text Center Align', 'lasso'); ?>"></li>
356
+			<li id="lasso-toolbar--right-align" title="<?php esc_attr_e('Text Right Align', 'lasso'); ?>"></li>
357 357
 			<?php endif; ?>
358 358
 		</ul>
359
-		<?php if ( is_singular() && $is_mobile ) { ?>
359
+		<?php if (is_singular() && $is_mobile) { ?>
360 360
 
361
-				<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;">
361
+				<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;">
362 362
 
363
-					<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>
364
-					<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>
363
+					<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>
364
+					<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>
365 365
 
366
-					<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>
366
+					<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>
367 367
 
368
-					<?php if ( 'draft' == $status && ( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') )  ) { ?>
369
-						<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>
368
+					<?php if ('draft' == $status && (lasso_user_can('publish_posts') || lasso_user_can('publish_pages'))) { ?>
369
+						<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>
370 370
 					<?php } ?>
371 371
 
372 372
 				</div>
@@ -384,20 +384,20 @@  discard block
 block discarded – undo
384 384
  */
385 385
 function lasso_editor_settings_toolbar() {
386 386
 
387
-	$delete_nonce = wp_create_nonce( 'lasso-delete-nonce' );
387
+	$delete_nonce = wp_create_nonce('lasso-delete-nonce');
388 388
 
389 389
 	ob_start();
390 390
 
391 391
 
392 392
 	// let users add custom css classes
393
-	$custom_classes = apply_filters( 'lasso_component_classes', '' );
393
+	$custom_classes = apply_filters('lasso_component_classes', '');
394 394
 
395 395
 	?>
396
-	<ul class="lasso-component--controls editus-center <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false">
397
-		<li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li>
398
-		<li class="lasso-component--settings__trigger  lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li>
399
-		<li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li>
400
-		<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>
396
+	<ul class="lasso-component--controls editus-center <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false">
397
+		<li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li>
398
+		<li class="lasso-component--settings__trigger  lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li>
399
+		<li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li>
400
+		<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>
401 401
 	</ul>
402 402
 
403 403
 	<?php return ob_get_clean();
@@ -415,13 +415,13 @@  discard block
 block discarded – undo
415 415
 
416 416
 
417 417
 	// has post thumbnail
418
-	$has_thumbnail = has_post_thumbnail( get_the_ID() ) ? 'class="lasso--featImg--has-thumb"' : false;
418
+	$has_thumbnail = has_post_thumbnail(get_the_ID()) ? 'class="lasso--featImg--has-thumb"' : false;
419 419
 
420 420
 	?>
421
-	<ul id="lasso--featImgControls" <?php echo $has_thumbnail;?>>
422
-		<li id="lasso--featImgUpload"><a title="<?php esc_attr_e( 'Replace Image', 'lasso' );?>" href="#"><i class="lasso-icon-image"></i></a></li>
423
-		<li id="lasso--featImgDelete"><a title="<?php esc_attr_e( 'Delete Image', 'lasso' );?>" href="#"><i class="lasso-icon-bin2"></i></a></li>
424
-		<li id="lasso--featImgSave"><a href="#"><?php esc_attr_e( 'save', 'lasso' );?></a></li>
421
+	<ul id="lasso--featImgControls" <?php echo $has_thumbnail; ?>>
422
+		<li id="lasso--featImgUpload"><a title="<?php esc_attr_e('Replace Image', 'lasso'); ?>" href="#"><i class="lasso-icon-image"></i></a></li>
423
+		<li id="lasso--featImgDelete"><a title="<?php esc_attr_e('Delete Image', 'lasso'); ?>" href="#"><i class="lasso-icon-bin2"></i></a></li>
424
+		<li id="lasso--featImgSave"><a href="#"><?php esc_attr_e('save', 'lasso'); ?></a></li>
425 425
 	</ul>
426 426
 
427 427
 	<?php return ob_get_clean();
@@ -445,19 +445,19 @@  discard block
 block discarded – undo
445 445
 
446 446
 	$postid = get_the_ID();
447 447
 
448
-	$status = get_post_status( $postid );
449
-	$nonce = wp_create_nonce( 'lasso-update-post-settings' );
448
+	$status = get_post_status($postid);
449
+	$nonce = wp_create_nonce('lasso-update-post-settings');
450 450
 
451 451
 	// let users add custom css classes
452
-	$custom_classes = apply_filters( 'lasso_modal_settings_classes', '' );
452
+	$custom_classes = apply_filters('lasso_modal_settings_classes', '');
453 453
 
454 454
 	// objects categories
455
-	$categories 		= lasso_get_post_objects( $postid, 'category' );
456
-	$tags 				= lasso_get_post_objects( $postid, 'tag' );
455
+	$categories = lasso_get_post_objects($postid, 'category');
456
+	$tags = lasso_get_post_objects($postid, 'tag');
457 457
 
458 458
 	// modal tabs
459
-	$tabs  				= lasso_modal_addons('tab');
460
-	$content 			= lasso_modal_addons('content');
459
+	$tabs = lasso_modal_addons('tab');
460
+	$content = lasso_modal_addons('content');
461 461
 	
462 462
 	//editor options
463 463
 	$allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor');
@@ -465,11 +465,11 @@  discard block
 block discarded – undo
465 465
 	$no_url_setting = lasso_editor_get_option('no_url_setting', 'lasso_editor');
466 466
 
467 467
 	// are we singular
468
-	$is_singular 		= is_singular();
468
+	$is_singular = is_singular();
469 469
 	$is_singular_class 	= $is_singular ? 'lasso--postsettings__2col' : 'lasso--postsettings__1col';
470 470
 	$has_thumb_class    = has_post_thumbnail() ? 'has-thumbnail' : 'no-thumbnail';
471 471
 	$theme_supports     = current_theme_supports('post-thumbnails');
472
-	$default_image 		= LASSO_URL.'/admin/assets/img/empty-img.png';
472
+	$default_image = LASSO_URL.'/admin/assets/img/empty-img.png';
473 473
 	
474 474
 	// do we support pending status
475 475
 	$no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor');
@@ -477,26 +477,26 @@  discard block
 block discarded – undo
477 477
     $excerpt = $post->post_excerpt;
478 478
 
479 479
 ?>
480
-	<div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>">
480
+	<div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>">
481 481
 		<div class="lasso--modal__inner">
482 482
 
483
-			<?php if( $tabs ) { echo $tabs; } ?>
483
+			<?php if ($tabs) { echo $tabs; } ?>
484 484
 
485 485
 			<div class="lasso--modal__content modal__content--core visible" data-addon-content="core">
486
-				<form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class;?>" >
486
+				<form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class; ?>" >
487 487
 
488
-					<?php if ( $is_singular && $theme_supports ) : ?>
488
+					<?php if ($is_singular && $theme_supports) : ?>
489 489
 					<div class="lasso--postsettings__left">
490
-						<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>
491
-						<div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url( $default_image );?>">
490
+						<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>
491
+						<div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url($default_image); ?>">
492 492
 
493 493
 							<div id="lasso--post-thumb__controls" class="lasso--post-thumb__controls">
494
-								<i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image','lasso');?>" class="dashicons dashicons-edit"></i>
495
-								<i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image','lasso');?>" class="dashicons dashicons-no-alt"></i>
494
+								<i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image', 'lasso'); ?>" class="dashicons dashicons-edit"></i>
495
+								<i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image', 'lasso'); ?>" class="dashicons dashicons-no-alt"></i>
496 496
 								<i id="lasso--save-status" class="lasso-icon lasso-icon-spinner6 not-visible"></i>
497 497
 							</div>
498 498
 
499
-							<?php echo has_post_thumbnail() ? get_the_post_thumbnail( $post->ID, 'medium' ) : '<img src="'.$default_image.'">'; ?>
499
+							<?php echo has_post_thumbnail() ? get_the_post_thumbnail($post->ID, 'medium') : '<img src="'.$default_image.'">'; ?>
500 500
 
501 501
 						</div>
502 502
 						<div id="lasso--featImgSave"><a href="#" class="not-visible">Save</a></div>
@@ -506,15 +506,15 @@  discard block
 block discarded – undo
506 506
 
507 507
 					<div class="lasso--postsettings__right">
508 508
 
509
-						<?php if( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ): ?>
509
+						<?php if (lasso_user_can('publish_posts') || lasso_user_can('publish_pages')): ?>
510 510
 						<div class="lasso--postsettings__option story-status-option">
511
-							<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>
512
-							<ul class="story-status story-status-<?php echo sanitize_html_class( $status );?>">
513
-								<li id="lasso--status-draft"><?php _e( 'Draft', 'lasso' );?></li>
514
-								<?php if( !$no_pending_status ): ?>								
515
-								<li id="lasso--status-pending"><?php _e( 'Pending', 'lasso' );?></li>
511
+							<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>
512
+							<ul class="story-status story-status-<?php echo sanitize_html_class($status); ?>">
513
+								<li id="lasso--status-draft"><?php _e('Draft', 'lasso'); ?></li>
514
+								<?php if (!$no_pending_status): ?>								
515
+								<li id="lasso--status-pending"><?php _e('Pending', 'lasso'); ?></li>
516 516
 								<?php endif; ?>
517
-								<li id="lasso--status-publish"><?php _e( 'Publish', 'lasso' );?></li>
517
+								<li id="lasso--status-publish"><?php _e('Publish', 'lasso'); ?></li>
518 518
 							</ul>
519 519
 							<div class="lasso--slider_wrap">
520 520
 								<div id="lasso--slider"></div>
@@ -522,10 +522,10 @@  discard block
 block discarded – undo
522 522
 						</div>
523 523
 						<?php endif; ?>
524 524
 
525
-						<?php if ( 'publish' == $status  && !$no_url_setting): ?>
525
+						<?php if ('publish' == $status && !$no_url_setting): ?>
526 526
 						<div class="lasso--postsettings__option story-slug-option">
527
-							<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>
528
-							<input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset( $post ) ? esc_attr( $post->post_name ) : false;?>">
527
+							<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>
528
+							<input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset($post) ? esc_attr($post->post_name) : false; ?>">
529 529
 						</div>
530 530
 						<?php endif; ?>
531 531
 
@@ -534,30 +534,30 @@  discard block
 block discarded – undo
534 534
 					<div class="lasso--postsettings__middle">
535 535
 
536 536
 						<div class="lasso--postsettings__option story-categories-option">
537
-							<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>
538
-							<input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories;?>">
537
+							<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>
538
+							<input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories; ?>">
539 539
 						</div>
540 540
 
541 541
 						<div class="lasso--postsettings__option story-tags-option">
542
-							<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>
543
-							<input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags;?>">
542
+							<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>
543
+							<input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags; ?>">
544 544
 						</div>
545 545
                         <?php 
546 546
 						if ($allow_edit_excerpt) { 
547 547
 						?>
548 548
                         <div class="lasso--postsettings__option story-excerpt-option">
549
-							<label><?php _e( 'Excerpt', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Edit excerpt', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label>
550
-							<input id="lasso--excerpt" class="lasso--modal__trigger-footer" type="text" name="excerpt" value="<?php echo $excerpt;?>" style="width:100%">
549
+							<label><?php _e('Excerpt', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Edit excerpt', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label>
550
+							<input id="lasso--excerpt" class="lasso--modal__trigger-footer" type="text" name="excerpt" value="<?php echo $excerpt; ?>" style="width:100%">
551 551
 						</div>
552 552
                         <?php
553 553
 						}?>
554 554
 						<?php 
555 555
 						if ($allow_change_date) { 
556
-						    $dateformat = get_option( 'date_format' ); 
556
+						    $dateformat = get_option('date_format'); 
557 557
 						?>
558
-						    <label><?php _e( 'Post Date', 'lasso' ); ?></label>
559
-							<input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/>
560
-							<a href="#" id="lasso--postsettings-setnow"><?php _e( 'Set to Now', 'lasso' ); ?></a>
558
+						    <label><?php _e('Post Date', 'lasso'); ?></label>
559
+							<input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid); ?>"/>
560
+							<a href="#" id="lasso--postsettings-setnow"><?php _e('Set to Now', 'lasso'); ?></a>
561 561
 						<?php
562 562
 						}?>
563 563
 
@@ -579,23 +579,23 @@  discard block
 block discarded – undo
579 579
 					?>
580 580
 					<!--/div-->
581 581
 
582
-					<?php do_action( 'lasso_modal_post_form' ); // action ?>
582
+					<?php do_action('lasso_modal_post_form'); // action ?>
583 583
 
584 584
 					<div class="lasso--postsettings__footer" >
585
-						<a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a>
585
+						<a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a>
586 586
 						<input type="hidden" name="status" value="">
587 587
 						<input type="hidden" name="categories" value="">
588
-						<input type="hidden" name="postid" value="<?php echo get_the_ID();?>">
588
+						<input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>">
589 589
 						<input type="hidden" name="action" value="process_update-object_post">
590
-						<input type="hidden" name="nonce" value="<?php echo $nonce;?>">
591
-						<?php do_action( 'lasso_modal_post_form_footer' ); // action ?>
592
-						<input type="submit" id="lasso--postsettings-submit" value="<?php esc_attr_e( 'Save', 'lasso' );?>">
590
+						<input type="hidden" name="nonce" value="<?php echo $nonce; ?>">
591
+						<?php do_action('lasso_modal_post_form_footer'); // action ?>
592
+						<input type="submit" id="lasso--postsettings-submit" value="<?php esc_attr_e('Save', 'lasso'); ?>">
593 593
 					</div>
594 594
 
595 595
 				</form>
596 596
 			</div>
597 597
 
598
-			<?php if( $tabs ) { echo $content; } ?>
598
+			<?php if ($tabs) { echo $content; } ?>
599 599
 
600 600
 		</div>
601 601
 
@@ -617,41 +617,41 @@  discard block
 block discarded – undo
617 617
 	ob_start();
618 618
 
619 619
 
620
-	$status = get_post_status( get_the_ID() );
620
+	$status = get_post_status(get_the_ID());
621 621
 
622
-	$nonce = wp_create_nonce( 'lasso-editor-new-post' );
622
+	$nonce = wp_create_nonce('lasso-editor-new-post');
623 623
 
624 624
 	// let users add custom css classes
625
-	$custom_classes = apply_filters( 'lasso_modal_post_classes', '' );
625
+	$custom_classes = apply_filters('lasso_modal_post_classes', '');
626 626
 
627 627
 	// return the post type
628
-	$type = get_post_type( get_the_ID() );
628
+	$type = get_post_type(get_the_ID());
629 629
 
630 630
 	$mobile_style = "";
631 631
 	if (wp_is_mobile()) {
632 632
 		//$mobile_style = 'style="top:140px !important;"';
633 633
 	}
634 634
 	?>
635
-	<div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style;?>">
635
+	<div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" <?php echo $mobile_style; ?>">
636 636
 		<div class="lasso--modal__inner lasso--hasnewform">
637 637
 
638 638
 			<form id="lasso--postnew__form" enctype="multipart/form-data" class="lasso--post-form">
639 639
 
640 640
 				<div class="lasso--postsettings__option story-slug-option lasso--last-option">
641
-					<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>
642
-					<input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e( 'Type Your Title Here', 'lasso' );?>">
641
+					<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>
642
+					<input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e('Type Your Title Here', 'lasso'); ?>">
643 643
 						<div class="lasso--select-wrap" style="width:90px">
644 644
 						<select id="lasso--select-type" name="story_type">
645 645
 
646 646
 							<?php
647 647
 								$types = lasso_post_types_names();
648
-								if ( !empty( $types ) ) {
649
-									foreach( $types as $name => $label ) {										
650
-										$type = preg_replace( '/s\b/','', $name );
648
+								if (!empty($types)) {
649
+									foreach ($types as $name => $label) {										
650
+										$type = preg_replace('/s\b/', '', $name);
651 651
 										if ($type == 'page' && !current_user_can('edit_pages')) {
652 652
 											continue;
653 653
 										}
654
-										printf( '<option value="%s">%s</option>', lcfirst( esc_attr( $type ) ) , ucfirst( esc_attr( $label ) ) );
654
+										printf('<option value="%s">%s</option>', lcfirst(esc_attr($type)), ucfirst(esc_attr($label)));
655 655
 									}
656 656
 
657 657
 								}
@@ -662,19 +662,19 @@  discard block
 block discarded – undo
662 662
 				</div>
663 663
 
664 664
 				<div class="lasso--postsettings__footer">
665
-					<a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a>
665
+					<a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a>
666 666
 					<input type="hidden" name="action" value="process_new-object_post">
667 667
 					<?php
668
-						if ( !empty( $types ) ) {
668
+						if (!empty($types)) {
669 669
 							// get the first element
670 670
 							$keys = array_keys($types);
671
-						    $type =$keys[0];						
672
-							$type = preg_replace( '/s\b/','', $type );
673
-							printf( '<input type="hidden" name="object" value="%s">', lcfirst( esc_attr( $type ) ) );		
671
+						    $type = $keys[0];						
672
+							$type = preg_replace('/s\b/', '', $type);
673
+							printf('<input type="hidden" name="object" value="%s">', lcfirst(esc_attr($type)));		
674 674
 						}
675 675
 					?>
676
-					<input type="hidden" name="nonce" value="<?php echo $nonce;?>">
677
-					<input type="submit" value="<?php esc_attr_e( 'Create', 'lasso' );?>">
676
+					<input type="hidden" name="nonce" value="<?php echo $nonce; ?>">
677
+					<input type="submit" value="<?php esc_attr_e('Create', 'lasso'); ?>">
678 678
 				</div>
679 679
 
680 680
 			</form>
@@ -702,18 +702,18 @@  discard block
 block discarded – undo
702 702
 	ob_start();
703 703
 
704 704
 	// post status
705
-	$status = get_post_status( get_the_ID() );
705
+	$status = get_post_status(get_the_ID());
706 706
 
707 707
 	// let users add custom css classes
708
-	$custom_classes = apply_filters( 'lasso_modal_all_post_classes', '' );
708
+	$custom_classes = apply_filters('lasso_modal_all_post_classes', '');
709 709
 
710 710
 	?>
711
-	<div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" style="max-height:100%">
711
+	<div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" style="max-height:100%">
712 712
 		<div class="lasso--modal__inner">
713 713
 
714 714
 			<div class="lasso--post-filtering not-visible">
715 715
 				<div class="lasso--search__results">
716
-					<span id="lasso--results-found"></span><?php _e('results found','lasso');?>
716
+					<span id="lasso--results-found"></span><?php _e('results found', 'lasso'); ?>
717 717
 				</div>
718 718
 				<div class="lasso--search">
719 719
 					<i id="lasso--search__toggle" class="dashicons dashicons-search"></i>
@@ -727,18 +727,18 @@  discard block
 block discarded – undo
727 727
 				$post_types = lasso_post_types_names();
728 728
 				$rest_bases = lasso_post_types_rest_base();
729 729
 
730
-				if ( ! empty( $post_types ) ) {
730
+				if (!empty($post_types)) {
731 731
 					$first = 'active';
732
-					foreach( $post_types as $name => $label ) {
732
+					foreach ($post_types as $name => $label) {
733 733
 						if (array_key_exists($name, $rest_bases)) {
734
-							printf( '<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr( $first), esc_attr( $rest_bases[$name] ), esc_attr( $label ) );
734
+							printf('<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr($first), esc_attr($rest_bases[$name]), esc_attr($label));
735 735
 						}
736 736
 						$first = '';
737 737
 					}
738 738
 
739 739
 				}
740 740
 
741
-				do_action('lasso_modal_post_objects');?>
741
+				do_action('lasso_modal_post_objects'); ?>
742 742
 
743 743
 			</ul>
744 744
 			<div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div>
@@ -757,21 +757,21 @@  discard block
 block discarded – undo
757 757
 	ob_start();
758 758
 
759 759
 
760
-    $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
760
+    $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor', 'off');
761 761
     
762 762
 	// let users add custom css classes
763
-	$custom_classes = apply_filters( 'lasso_wpimg_classes', '' );
763
+	$custom_classes = apply_filters('lasso_wpimg_classes', '');
764 764
 
765 765
 	?>
766
-	<ul class="lasso-component--controls editus-center <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false">
767
-		<li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li>
768
-        <?php if ($use_old_wpimg=='on') {?>
769
-            <li  class="lasso--wpimg-edit lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li>
766
+	<ul class="lasso-component--controls editus-center <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false">
767
+		<li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li>
768
+        <?php if ($use_old_wpimg == 'on') {?>
769
+            <li  class="lasso--wpimg-edit lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li>
770 770
         <?php } else {?>
771
-            <li  class="lasso-component--settings__trigger lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li>
771
+            <li  class="lasso-component--settings__trigger lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li>
772 772
         <?php } ?>
773
-		<li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li>
774
-		<li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li>
773
+		<li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li>
774
+		<li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li>
775 775
 	</ul>
776 776
 
777 777
 	<?php return ob_get_clean();
@@ -782,10 +782,10 @@  discard block
 block discarded – undo
782 782
 
783 783
 	?>
784 784
 	<ul class="lasso-component--controls editus-center" contenteditable="false">
785
-		<li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li>
786
-            <li  class="lasso-component--settings__trigger lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li>
787
-		<li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li>
788
-		<li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li>
785
+		<li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li>
786
+            <li  class="lasso-component--settings__trigger lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li>
787
+		<li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li>
788
+		<li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li>
789 789
 	</ul>
790 790
 
791 791
 	<?php return ob_get_clean();
@@ -797,14 +797,14 @@  discard block
 block discarded – undo
797 797
 
798 798
 
799 799
 	// let users add custom css classes
800
-	$custom_classes = apply_filters( 'lasso_wpimg_classes', '' );
800
+	$custom_classes = apply_filters('lasso_wpimg_classes', '');
801 801
 
802 802
 	?>
803
-	<ul class="lasso-component--controls editus-center <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false">
804
-		<li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li>
805
-		<li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li>
806
-		<li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li>
807
-		<li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li>
803
+	<ul class="lasso-component--controls editus-center <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false">
804
+		<li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li>
805
+		<li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li>
806
+		<li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li>
807
+		<li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li>
808 808
 	</ul>
809 809
 
810 810
 	<?php return ob_get_clean();
@@ -817,16 +817,16 @@  discard block
 block discarded – undo
817 817
  */
818 818
 function lasso_map_form_footer() {
819 819
 
820
-	$nonce = wp_create_nonce( 'lasso-process-map' );
820
+	$nonce = wp_create_nonce('lasso-process-map');
821 821
 
822 822
 	ob_start();
823 823
 
824 824
 	?>
825 825
 	<div class="lasso--map-form__footer">
826
-		<input type="hidden" name="postid" value="<?php echo get_the_ID();?>">
827
-		<input type="hidden" name="nonce" value="<?php echo $nonce;?>">
826
+		<input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>">
827
+		<input type="hidden" name="nonce" value="<?php echo $nonce; ?>">
828 828
 		<input type="hidden" name="action" value="process_map_save">
829
-		<input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e( 'Save Locations', 'lasso' );?>">
829
+		<input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e('Save Locations', 'lasso'); ?>">
830 830
 	</div>
831 831
 
832 832
 	<?php return ob_get_clean();
@@ -844,7 +844,7 @@  discard block
 block discarded – undo
844 844
 
845 845
 	?>
846 846
 	<div id="lasso--pagerefresh" class="visible">
847
-		<?php _e( 'Save this post and refesh the page to see these changes.', 'lasso' );?>
847
+		<?php _e('Save this post and refesh the page to see these changes.', 'lasso'); ?>
848 848
 	</div>
849 849
 
850 850
 	<?php return ob_get_clean();
@@ -858,46 +858,46 @@  discard block
 block discarded – undo
858 858
  */
859 859
 function lasso_editor_options_blob() {
860 860
 
861
-	$codes   = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : array();
862
-    $codes   = add_wpimg_options( $codes );
863
-	$codes   = add_wpimg_block_options( $codes );
864
-    $codes   = apply_filters( 'lasso_custom_options', $codes );
865
-	$galleries  = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery';
861
+	$codes   = function_exists('aesop_shortcodes') ? aesop_shortcodes() : array();
862
+    $codes   = add_wpimg_options($codes);
863
+	$codes   = add_wpimg_block_options($codes);
864
+    $codes   = apply_filters('lasso_custom_options', $codes);
865
+	$galleries  = function_exists('lasso_editor_galleries_exist') && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery';
866 866
 
867
-	$nonce = wp_create_nonce( 'lasso_gallery' );
867
+	$nonce = wp_create_nonce('lasso_gallery');
868 868
 
869 869
 	$blob = array();
870 870
 
871
-	if ( empty( $codes ) )
871
+	if (empty($codes))
872 872
 		return;
873 873
 
874
-	foreach ( $codes as $slug => $shortcode ) {
874
+	foreach ($codes as $slug => $shortcode) {
875 875
 		$return = '';
876 876
 		// Shortcode has atts
877 877
 
878
-		if ( count( $shortcode['atts'] ) && $shortcode['atts'] ) {
878
+		if (count($shortcode['atts']) && $shortcode['atts']) {
879 879
 
880
-			foreach ( $shortcode['atts'] as $attr_name => $attr_info ) {
880
+			foreach ($shortcode['atts'] as $attr_name => $attr_info) {
881 881
 
882 882
 
883
-				$prefix = isset( $attr_info['prefix'] ) ? sprintf( '<span class="lasso-option-prefix">%s</span>', $attr_info['prefix'] ) : null;
883
+				$prefix = isset($attr_info['prefix']) ? sprintf('<span class="lasso-option-prefix">%s</span>', $attr_info['prefix']) : null;
884 884
 
885 885
 				$return .= '<form id="aesop-generator-settings" class="lasso--component-settings-form" class="'.$galleries.'" method="post">';
886 886
 				$return .= '<p data-option="'.$attr_name.'" class="lasso-option aesop-'.$slug.'-'.$attr_name.'">';
887
-				$return .= '<label for="aesop-generator-attr-' . $attr_name . '">' . $attr_info['desc'] . '</label>';
887
+				$return .= '<label for="aesop-generator-attr-'.$attr_name.'">'.$attr_info['desc'].'</label>';
888 888
 				$return .= '<small class="lasso-option-desc">'.$attr_info['tip'].'</small>';
889 889
 				// Select
890 890
 
891
-				if ( isset( $attr_info['values'] ) ) {
891
+				if (isset($attr_info['values'])) {
892 892
 
893
-					$return .= '<select name="' . $attr_name . '" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr">';
893
+					$return .= '<select name="'.$attr_name.'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr">';
894 894
 
895
-					$i=0;
895
+					$i = 0;
896 896
 
897
-					foreach ( $attr_info['values'] as $attr_value ) {
897
+					foreach ($attr_info['values'] as $attr_value) {
898 898
 						$attr_value_selected = $attr_info['default'] == $attr_value ? ' selected="selected"' : '';
899 899
 
900
-						$return .= '<option value="'.$attr_info['values'][$i]['value'].'" ' . $attr_value_selected . '>'.$attr_info['values'][$i]['name'].'</option>';
900
+						$return .= '<option value="'.$attr_info['values'][$i]['value'].'" '.$attr_value_selected.'>'.$attr_info['values'][$i]['name'].'</option>';
901 901
 
902 902
 						$i++;
903 903
 					}
@@ -906,24 +906,24 @@  discard block
 block discarded – undo
906 906
 
907 907
 				} else {
908 908
 
909
-					$attr_field_type = isset( $attr_info['type'] ) ? $attr_info['type'] : 'text';
909
+					$attr_field_type = isset($attr_info['type']) ? $attr_info['type'] : 'text';
910 910
 
911 911
 					// image upload
912
-					if ( 'media_upload' == $attr_info['type'] ) {
912
+					if ('media_upload' == $attr_info['type']) {
913 913
 
914
-						$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.'" />';
914
+						$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.'" />';
915 915
 						$return .= '<a href="#" id="lasso-upload-img" class="lasso-option-button" /></a>';
916 916
 
917
-					} elseif ( 'color' == $attr_info['type'] ) {
917
+					} elseif ('color' == $attr_info['type']) {
918 918
 
919
-						$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.'" />';
919
+						$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.'" />';
920 920
 
921
-					} elseif ( 'text_area' == $attr_info['type'] ) {
921
+					} elseif ('text_area' == $attr_info['type']) {
922 922
 
923
-						$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.'';
923
+						$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.'';
924 924
 
925 925
 					} else {
926
-						$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.'';
926
+						$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.'';
927 927
 					}
928 928
 				}
929 929
 				$return .= '</p>';
@@ -934,9 +934,9 @@  discard block
 block discarded – undo
934 934
 		///////////////////////////
935 935
 		// START GALLERY AND MAP FRONT END STUFFS
936 936
 		///////////////////////////
937
-		if ( isset( $shortcode['front'] ) && true == $shortcode['front'] ) {
937
+		if (isset($shortcode['front']) && true == $shortcode['front']) {
938 938
 
939
-			if ( 'gallery' == $shortcode['front_type'] ) {
939
+			if ('gallery' == $shortcode['front_type']) {
940 940
 
941 941
 				$return .= lasso_gallery_editor_module();
942 942
 
@@ -947,13 +947,13 @@  discard block
 block discarded – undo
947 947
 		///////////////////////////
948 948
 
949 949
 		// Single shortcode (not closed)
950
-		if ( 'single' == $shortcode['type'] ) {
950
+		if ('single' == $shortcode['type']) {
951 951
 
952 952
 			$return .= '<input type="hidden" name="lasso-generator-content" id="lasso-generator-content" value="false" />';
953 953
 
954 954
 		} else {
955 955
 
956
-			$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>';
956
+			$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>';
957 957
 		}
958 958
 
959 959
 		$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>';
@@ -973,95 +973,95 @@  discard block
 block discarded – undo
973 973
 }
974 974
 
975 975
 
976
-function add_wpimg_options( $shortcodes ) {
976
+function add_wpimg_options($shortcodes) {
977 977
     $custom = array(
978 978
         'wpimg'    => array(
979
-            'name'     => __( 'Image', 'lasso' ),
979
+            'name'     => __('Image', 'lasso'),
980 980
             'type'     => 'single',
981 981
             'atts'     => array(
982 982
                 'img'    => array(
983 983
                     'type'  => 'media_upload',
984 984
                     'default'  => '',
985
-                    'desc'   => __( 'Image URL', 'lasso' ),
986
-                    'tip'  => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' )
985
+                    'desc'   => __('Image URL', 'lasso'),
986
+                    'tip'  => __('URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core')
987 987
                 ),
988 988
                 'align'    => array(
989 989
                     'type'  => 'select',
990 990
                     'values'  => array(						
991 991
                         array(
992 992
                             'value' => 'center',
993
-                            'name' => __( 'Center', 'aesop-core' )
993
+                            'name' => __('Center', 'aesop-core')
994 994
                         ),
995 995
                         array(
996 996
                             'value' => 'left',
997
-                            'name' => __( 'Left', 'aesop-core' )
997
+                            'name' => __('Left', 'aesop-core')
998 998
                         ),
999 999
                         array(
1000 1000
                             'value' => 'right',
1001
-                            'name' => __( 'Right', 'aesop-core' )
1001
+                            'name' => __('Right', 'aesop-core')
1002 1002
                         ),
1003 1003
                     ),
1004 1004
                     'default'  => 'center',
1005
-                    'desc'   => __( 'Alignment', 'lasso' ),
1005
+                    'desc'   => __('Alignment', 'lasso'),
1006 1006
                     'tip'=>''
1007 1007
                 ),			
1008 1008
                 
1009 1009
                 'imgwidth'    => array(
1010 1010
                     'type'  => 'text_small',
1011 1011
                     'default'  => '300px',
1012
-                    'desc'   => __( 'Image Width', 'lasso' ),
1013
-                    'tip'  => __( 'Width of the image. You can enter the size in pixels or percentage such as <code>40%</code> or <code>500px</code>.', 'aesop-core' )
1012
+                    'desc'   => __('Image Width', 'lasso'),
1013
+                    'tip'  => __('Width of the image. You can enter the size in pixels or percentage such as <code>40%</code> or <code>500px</code>.', 'aesop-core')
1014 1014
                 ),
1015 1015
                 'imgheight'    => array(
1016 1016
                     'type'  => 'text_small',
1017 1017
                     'default'  => '',
1018
-                    'desc'   => __( 'Image Height', 'lasso' ),
1019
-                    'tip'  => __( 'Used only for the Panorama mode. Can be set using pixel values such as <code>500px</code>. If unspecified, the original height would be used. ', 'aesop-core' )
1018
+                    'desc'   => __('Image Height', 'lasso'),
1019
+                    'tip'  => __('Used only for the Panorama mode. Can be set using pixel values such as <code>500px</code>. If unspecified, the original height would be used. ', 'aesop-core')
1020 1020
                 ),	
1021 1021
                 'linkoption'    => array(
1022 1022
                     'type'  => 'select',
1023 1023
                     'values'  => array(						
1024 1024
                         array(
1025 1025
                             'value' => 'none',
1026
-                            'name' => __( 'None', 'aesop-core' )
1026
+                            'name' => __('None', 'aesop-core')
1027 1027
                         ),
1028 1028
                         array(
1029 1029
                             'value' => 'img',
1030
-                            'name' => __( 'Image', 'aesop-core' )
1030
+                            'name' => __('Image', 'aesop-core')
1031 1031
                         ),
1032 1032
                         array(
1033 1033
                             'value' => 'url',
1034
-                            'name' => __( 'URL', 'aesop-core' )
1034
+                            'name' => __('URL', 'aesop-core')
1035 1035
                         ),
1036 1036
                     ),
1037 1037
                     'default'  => 'none',
1038
-                    'desc'   => __( 'Link', 'lasso' ),
1039
-                    'tip'  => __( 'Click leads to:', 'lasso' )
1038
+                    'desc'   => __('Link', 'lasso'),
1039
+                    'tip'  => __('Click leads to:', 'lasso')
1040 1040
                 ),				
1041 1041
                 
1042 1042
                 'link'    => array(
1043 1043
                     'type'  => 'text',
1044 1044
                     'default'  => '',
1045
-                    'desc'   => __( 'URL Link', 'lasso' ),
1046
-                    'tip'  => __( 'URL link', 'lasso' )
1045
+                    'desc'   => __('URL Link', 'lasso'),
1046
+                    'tip'  => __('URL link', 'lasso')
1047 1047
                 ),
1048 1048
                 'alt'    => array(
1049 1049
                     'type'  => 'text',
1050 1050
                     'default'  => '',
1051
-                    'desc'   => __( 'Image ALT', 'lasso' ),
1052
-                    'tip'  => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' )
1051
+                    'desc'   => __('Image ALT', 'lasso'),
1052
+                    'tip'  => __('ALT tag used for the image. Primarily used for SEO purposes.', 'lasso')
1053 1053
                 ),
1054 1054
                 
1055 1055
                 'caption'    => array(
1056 1056
                     'type'  => 'text_area',
1057 1057
                     'default'  => '',
1058
-                    'desc'   => __( 'Caption', 'lasso' ),
1059
-                    'tip'  => __( 'Optional caption for the image.', 'lasso' )
1058
+                    'desc'   => __('Caption', 'lasso'),
1059
+                    'tip'  => __('Optional caption for the image.', 'lasso')
1060 1060
                 ),
1061 1061
                 
1062 1062
 
1063 1063
             ),
1064
-            'desc'     => __( 'An image.', 'aesop-core' ),
1064
+            'desc'     => __('An image.', 'aesop-core'),
1065 1065
             'codes'    => '<script>	            
1066 1066
 						jQuery(document).ready(function($){
1067 1067
                             function linkSetting(l){								
@@ -1085,57 +1085,57 @@  discard block
 block discarded – undo
1085 1085
         )
1086 1086
     );
1087 1087
 
1088
-    return array_merge( $shortcodes, $custom );
1088
+    return array_merge($shortcodes, $custom);
1089 1089
 }
1090 1090
 
1091
-function add_wpimg_block_options( $shortcodes ) {
1091
+function add_wpimg_block_options($shortcodes) {
1092 1092
     $custom = array(
1093 1093
         'wpimg-block'    => array(
1094
-            'name'     => __( 'Image', 'lasso' ),
1094
+            'name'     => __('Image', 'lasso'),
1095 1095
             'type'     => 'single',
1096 1096
             'atts'     => array(
1097 1097
                 'img'    => array(
1098 1098
                     'type'  => 'media_upload',
1099 1099
                     'default'  => '',
1100
-                    'desc'   => __( 'Image URL', 'lasso' ),
1101
-                    'tip'  => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' )
1100
+                    'desc'   => __('Image URL', 'lasso'),
1101
+                    'tip'  => __('URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core')
1102 1102
                 ),
1103 1103
                 'align'    => array(
1104 1104
                     'type'  => 'select',
1105 1105
                     'values'  => array(						
1106 1106
                         array(
1107 1107
                             'value' => 'center',
1108
-                            'name' => __( 'Center', 'aesop-core' )
1108
+                            'name' => __('Center', 'aesop-core')
1109 1109
                         ),
1110 1110
                         array(
1111 1111
                             'value' => 'left',
1112
-                            'name' => __( 'Left', 'aesop-core' )
1112
+                            'name' => __('Left', 'aesop-core')
1113 1113
                         ),
1114 1114
                         array(
1115 1115
                             'value' => 'right',
1116
-                            'name' => __( 'Right', 'aesop-core' )
1116
+                            'name' => __('Right', 'aesop-core')
1117 1117
                         ),
1118 1118
                     ),
1119 1119
                     'default'  => 'center',
1120
-                    'desc'   => __( 'Alignment', 'lasso' ),
1120
+                    'desc'   => __('Alignment', 'lasso'),
1121 1121
                     'tip'=>''
1122 1122
                 ),		
1123 1123
                 'alt'    => array(
1124 1124
                     'type'  => 'text',
1125 1125
                     'default'  => '',
1126
-                    'desc'   => __( 'Image ALT', 'lasso' ),
1127
-                    'tip'  => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' )
1126
+                    'desc'   => __('Image ALT', 'lasso'),
1127
+                    'tip'  => __('ALT tag used for the image. Primarily used for SEO purposes.', 'lasso')
1128 1128
                 ),
1129 1129
                 'caption'    => array(
1130 1130
                     'type'  => 'text',
1131 1131
                     'default'  => '',
1132
-                    'desc'   => __( 'Caption', 'lasso' ),
1133
-                    'tip'  => __( 'Caption for the image.', 'lasso' )
1132
+                    'desc'   => __('Caption', 'lasso'),
1133
+                    'tip'  => __('Caption for the image.', 'lasso')
1134 1134
                 ),
1135 1135
                
1136 1136
 
1137 1137
             ),
1138
-            'desc'     => __( 'A WP Image Block.', 'aesop-core' ),
1138
+            'desc'     => __('A WP Image Block.', 'aesop-core'),
1139 1139
             'codes'    => '<script>	            
1140 1140
 						jQuery(document).ready(function($){
1141 1141
                             
@@ -1144,7 +1144,7 @@  discard block
 block discarded – undo
1144 1144
         )
1145 1145
     );
1146 1146
 
1147
-    return array_merge( $shortcodes, $custom );
1147
+    return array_merge($shortcodes, $custom);
1148 1148
 }
1149 1149
 
1150 1150
 /**
@@ -1164,14 +1164,14 @@  discard block
 block discarded – undo
1164 1164
 				<div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div>
1165 1165
 				<div id="lasso--hide" style="display:none;" class="lasso--post-form">
1166 1166
 					<i class="lasso-icon lasso-icon-move"></i>
1167
-					<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>
1167
+					<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>
1168 1168
 					<div class="lasso--slider_wrap">
1169 1169
 						<div id="lasso--slider"></div>
1170 1170
 					</div>
1171 1171
 					<ul id="lasso--revision-list"></ul>
1172 1172
 					<div class="lasso--btn-group lasso--btn-group-small">
1173
-						<a href="#" class="lasso--btn-secondary" id="lasso--close-modal"><?php _e( 'Cancel', 'lasso' );?></a>
1174
-						<a href="#" class="lasso--btn-primary" id="lasso--select-revision"><?php _e( 'Select', 'lasso' );?></a>
1173
+						<a href="#" class="lasso--btn-secondary" id="lasso--close-modal"><?php _e('Cancel', 'lasso'); ?></a>
1174
+						<a href="#" class="lasso--btn-primary" id="lasso--select-revision"><?php _e('Select', 'lasso'); ?></a>
1175 1175
 					</div>
1176 1176
 				</div>
1177 1177
 
@@ -1194,7 +1194,7 @@  discard block
 block discarded – undo
1194 1194
     // Normalize into a six character long hex string
1195 1195
     $hex = str_replace('#', '', $hex);
1196 1196
     if (strlen($hex) == 3) {
1197
-        $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2);
1197
+        $hex = str_repeat(substr($hex, 0, 1), 2).str_repeat(substr($hex, 1, 1), 2).str_repeat(substr($hex, 2, 1), 2);
1198 1198
     }
1199 1199
 
1200 1200
     // Split into three parts: R, G and B
@@ -1203,7 +1203,7 @@  discard block
 block discarded – undo
1203 1203
 
1204 1204
     foreach ($color_parts as $color) {
1205 1205
         $color   = hexdec($color); // Convert to decimal
1206
-        $color   = max(0,min(255,$color + $steps)); // Adjust color
1206
+        $color   = max(0, min(255, $color + $steps)); // Adjust color
1207 1207
         $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code
1208 1208
     }
1209 1209
 
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -280,9 +280,12 @@  discard block
 block discarded – undo
280 280
 						<?php if ( class_exists ('Aesop_Events') ) { ?>
281 281
 						     <li data-type="events" title="<?php esc_attr_e( 'Event', 'lasso' );?>"  class="lasso-toolbar--component__event"></li>
282 282
 						<?php }?>
283
-					<?php else: ?>
283
+					<?php else {
284
+	: ?>
284 285
                         <?php if ($use_wp_block_image == 'on') { ?>
285
-                            <li data-type="wpimg-block" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li>
286
+                            <li data-type="wpimg-block" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );
287
+}
288
+?>" class="image lasso-toolbar--component__image"></li>
286 289
                         <?php } else { ?>
287 290
 						    <li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li>
288 291
                         <?php } ?>
@@ -868,8 +871,9 @@  discard block
 block discarded – undo
868 871
 
869 872
 	$blob = array();
870 873
 
871
-	if ( empty( $codes ) )
872
-		return;
874
+	if ( empty( $codes ) ) {
875
+			return;
876
+	}
873 877
 
874 878
 	foreach ( $codes as $slug => $shortcode ) {
875 879
 		$return = '';
Please login to merge, or discard this patch.
public/includes/lasso.php 3 patches
Indentation   +118 added lines, -118 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 		
60 60
 		add_action( 'wp_ajax_get_aesop_component',     array( $this, 'get_aesop_component' ) );
61 61
 		add_action( 'wp_ajax_editus_do_shortcode',     array( $this, 'editus_do_shortcode' ) );
62
-        add_action( 'wp_ajax_editus_do_block',     array( $this, 'editus_do_block' ) );
62
+		add_action( 'wp_ajax_editus_do_block',     array( $this, 'editus_do_block' ) );
63 63
 		add_action( 'wp_ajax_editus_lock_post',     array( $this, 'editus_lock_post' ) );
64 64
 		add_action( 'wp_ajax_editus_unlock_post',     array( $this, 'editus_unlock_post' ) );
65 65
 		add_action( 'wp_ajax_editus_hide_tour',     array( $this, 'editus_hide_tour' ) );
@@ -69,10 +69,10 @@  discard block
 block discarded – undo
69 69
 		add_action( 'wp_ajax_editus_featured_img',     array( $this, 'set_featured_img' ) );
70 70
 		add_action( 'wp_ajax_editus_del_featured_img',     array( $this, 'del_featured_img' ) );
71 71
         
72
-        add_action( 'wp_ajax_editus_publish_post',     array( $this, 'on_publish_post' ) );
72
+		add_action( 'wp_ajax_editus_publish_post',     array( $this, 'on_publish_post' ) );
73 73
         
74
-        add_action( 'wp_ajax_editus_create_gallery',     array( $this, 'create_gallery' ) );
75
-        add_action( 'wp_ajax_editus_update_gallery',     array( $this, 'update_gallery' ) );
74
+		add_action( 'wp_ajax_editus_create_gallery',     array( $this, 'create_gallery' ) );
75
+		add_action( 'wp_ajax_editus_update_gallery',     array( $this, 'update_gallery' ) );
76 76
 
77 77
 		// enable saving custom fields through REST API
78 78
 		self::enable_metasave('post');
@@ -272,14 +272,14 @@  discard block
 block discarded – undo
272 272
 		$out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' );
273 273
 	}
274 274
 	
275
-    // new ajax function to lock post for editing
275
+	// new ajax function to lock post for editing
276 276
 	public function editus_lock_post()
277 277
 	{
278 278
 		$post_id= $_POST["postid"];
279 279
 		$locked = wp_check_post_lock($post_id);
280 280
 		
281 281
 		if (!$locked) {
282
-		    wp_set_post_lock($post_id);
282
+			wp_set_post_lock($post_id);
283 283
 			echo "true";
284 284
 		} else {
285 285
 			$user_info = get_userdata($locked);
@@ -292,9 +292,9 @@  discard block
 block discarded – undo
292 292
 	{
293 293
 		$post_id= $_POST["postid"];
294 294
 		$locked = wp_check_post_lock($post_id);
295
-        if (!$locked) {
296
-            delete_post_meta( $post_id, '_edit_lock');
297
-        }
295
+		if (!$locked) {
296
+			delete_post_meta( $post_id, '_edit_lock');
297
+		}
298 298
 		echo "true";
299 299
 		
300 300
 		exit;
@@ -324,14 +324,14 @@  discard block
 block discarded – undo
324 324
 		$status = isset( $data['status'] ) ? $data['status'] : false;
325 325
 		$postid = isset( $data['postid'] ) ? $data['postid'] : false;
326 326
 		$slug   = isset( $data['story_slug'] ) ? $data['story_slug'] : false;
327
-        $excerpt   = isset( $data['excerpt'] ) ? $data['excerpt'] : false;
327
+		$excerpt   = isset( $data['excerpt'] ) ? $data['excerpt'] : false;
328 328
 	
329 329
 
330 330
 		$args = array(
331 331
 			'ID'   			=> (int) $postid,
332 332
 			'post_name'  	=> $slug,
333 333
 			'post_status' 	=> $status,
334
-            'post_excerpt'  => $excerpt
334
+			'post_excerpt'  => $excerpt
335 335
 		);
336 336
 		
337 337
 		
@@ -399,12 +399,12 @@  discard block
 block discarded – undo
399 399
 		exit;
400 400
 	}
401 401
     
402
-    public function editus_do_block()
402
+	public function editus_do_block()
403 403
 	{
404 404
 		
405 405
 		$code= $_POST["code"];
406 406
 
407
-        $out = do_blocks( $code );
407
+		$out = do_blocks( $code );
408 408
 		
409 409
 		echo $out;
410 410
 		exit;
@@ -423,63 +423,63 @@  discard block
 block discarded – undo
423 423
 			}
424 424
 		}
425 425
 		if ($code == "aesop_video") {
426
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
427
-		    echo aesop_video_shortcode($atts);
426
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
427
+			echo aesop_video_shortcode($atts);
428 428
 		}
429 429
 		else if ($code == "aesop_image") {
430
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
431
-		    echo aesop_image_shortcode($atts);
430
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
431
+			echo aesop_image_shortcode($atts);
432 432
 		}
433 433
 		else if ($code == "aesop_quote") {
434
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
435
-		    echo aesop_quote_shortcode($atts);
434
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
435
+			echo aesop_quote_shortcode($atts);
436 436
 		}
437 437
 		else if ($code == "aesop_parallax") {
438
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
439
-		    echo aesop_parallax_shortcode($atts);
438
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
439
+			echo aesop_parallax_shortcode($atts);
440 440
 		}
441 441
 		else if ($code == "aesop_character") {
442
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
443
-		    echo aesop_character_shortcode($atts);
442
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
443
+			echo aesop_character_shortcode($atts);
444 444
 		}
445 445
 		else if ($code == "aesop_collection") {
446
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
447
-		    echo aesop_collection_shortcode($atts);
446
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
447
+			echo aesop_collection_shortcode($atts);
448 448
 		}
449 449
 		else if ($code == "aesop_chapter") {
450
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
451
-		    echo aesop_chapter_shortcode($atts);
450
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
451
+			echo aesop_chapter_shortcode($atts);
452 452
 		}
453 453
 		else if ($code == "aesop_content") {
454
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
455
-		    echo aesop_content_shortcode($atts, $atts['content_data']);
454
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
455
+			echo aesop_content_shortcode($atts, $atts['content_data']);
456 456
 		}
457 457
 		else if ($code == "aesop_gallery") {
458
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
459
-		    echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
458
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
459
+			echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
460 460
 		}
461 461
 		else if ($code == "aesop_audio") {
462
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
463
-		    echo aesop_audio_shortcode($atts);
462
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
463
+			echo aesop_audio_shortcode($atts);
464 464
 		}
465 465
 		else if ($code == "aesop_document") {
466
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php');
467
-		    echo aesop_document_shortcode($atts);
466
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php');
467
+			echo aesop_document_shortcode($atts);
468 468
 		}
469
-        /*else if ($code == "aesop_content") {
469
+		/*else if ($code == "aesop_content") {
470 470
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-content.php');
471 471
 		    echo aesop_content_shortcode($atts);
472 472
 		}*/
473
-        else if ($code == "aesop_wpimg") {
474
-            self::wpimg($atts);
473
+		else if ($code == "aesop_wpimg") {
474
+			self::wpimg($atts);
475 475
 		}
476 476
 		else if ($code == "aesop_wpimg-block") {
477
-            self::wpimg_block($atts);
477
+			self::wpimg_block($atts);
478 478
 		}
479 479
 		else {
480 480
 			$code = '['.$code.' ';
481 481
 			foreach ($atts as $key => $value) {
482
-			    $code = ''.$key.'="'.$value.'" ';
482
+				$code = ''.$key.'="'.$value.'" ';
483 483
 			}
484 484
 			$code = $code.']';
485 485
 			echo do_shortcode($code);
@@ -488,88 +488,88 @@  discard block
 block discarded – undo
488 488
 		exit; 
489 489
 	}
490 490
     
491
-    public static function wpimg($atts) {
491
+	public static function wpimg($atts) {
492 492
 
493
-        echo '<figure data-component-type="wpimg"';
493
+		echo '<figure data-component-type="wpimg"';
494 494
         
495
-        $extra = "";
495
+		$extra = "";
496 496
         
497
-        // try to use srcset and sizes on new WP installs
497
+		// try to use srcset and sizes on new WP installs
498 498
 		if ( function_exists('wp_get_attachment_image_srcset') && $attachment_id = attachment_url_to_postid( $atts['img'] ) ) {
499 499
 			$srcset = wp_get_attachment_image_srcset( $attachment_id, 'full' );
500 500
 			$sizes = wp_get_attachment_image_sizes( $attachment_id, 'full' );
501
-            $extra = "srcset='$srcset' sizes='$sizes' ";
502
-        }
503
-        if ($atts['align']=="left") {
504
-            $extra .= 'class="alignleft';
505
-        } else if ($atts['align']=="right") {
506
-            $extra .= 'class="alignright';
507
-        } else {
508
-            $extra .= 'class="aligncenter';
509
-        }
510
-        if ($atts['imgwidth'] || $atts['imgheight']) {
511
-            if ($atts['imgwidth']) {
512
-                $extra .= 'width:'. $atts['imgwidth'].';';
513
-            }
514
-            if ($atts['imgheight']) {
515
-                $extra .= 'height:'. $atts['imgheight'].';';
516
-            }
501
+			$extra = "srcset='$srcset' sizes='$sizes' ";
502
+		}
503
+		if ($atts['align']=="left") {
504
+			$extra .= 'class="alignleft';
505
+		} else if ($atts['align']=="right") {
506
+			$extra .= 'class="alignright';
507
+		} else {
508
+			$extra .= 'class="aligncenter';
509
+		}
510
+		if ($atts['imgwidth'] || $atts['imgheight']) {
511
+			if ($atts['imgwidth']) {
512
+				$extra .= 'width:'. $atts['imgwidth'].';';
513
+			}
514
+			if ($atts['imgheight']) {
515
+				$extra .= 'height:'. $atts['imgheight'].';';
516
+			}
517 517
             
518
-        }
519
-        $extra .= '"';
518
+		}
519
+		$extra .= '"';
520 520
         
521
-        foreach ($atts as $key => $value) {
521
+		foreach ($atts as $key => $value) {
522 522
 			 echo ' data-'.$key.'="'.$value.'"';
523 523
 		}
524
-        //echo ' class="wp-image- lasso--wpimg__wrap lasso-component">';
525
-        echo ' class="wp-caption lasso-component">';
526
-        $hrefset = false;
527
-        if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption']=="url" ))
528
-        {
529
-            echo '<a href="' . $atts['link'] . '">';
530
-            $hrefset = true;
531
-        } else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img' ) {
532
-            echo '<a href="' . $atts['img'] . '">';
533
-            $hrefset = true;
534
-        }
535
-        echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  .  '" '. $extra. '>';
536
-        if ($hrefset)
537
-        {
538
-            echo '</a>';
539
-        }
540
-        if ($atts['caption'])
541
-        {
542
-            echo '<figcaption class="wp-caption-text">'.$atts['caption'].'</figcaption>';
543
-        }
544
-        echo '</figure>';
545
-        echo '<p><br></p>';
546
-        return;
547
-    }
524
+		//echo ' class="wp-image- lasso--wpimg__wrap lasso-component">';
525
+		echo ' class="wp-caption lasso-component">';
526
+		$hrefset = false;
527
+		if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption']=="url" ))
528
+		{
529
+			echo '<a href="' . $atts['link'] . '">';
530
+			$hrefset = true;
531
+		} else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img' ) {
532
+			echo '<a href="' . $atts['img'] . '">';
533
+			$hrefset = true;
534
+		}
535
+		echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  .  '" '. $extra. '>';
536
+		if ($hrefset)
537
+		{
538
+			echo '</a>';
539
+		}
540
+		if ($atts['caption'])
541
+		{
542
+			echo '<figcaption class="wp-caption-text">'.$atts['caption'].'</figcaption>';
543
+		}
544
+		echo '</figure>';
545
+		echo '<p><br></p>';
546
+		return;
547
+	}
548 548
 	
549 549
 	public static function wpimg_block($atts) {
550 550
 		$imgextra = '';
551 551
 		if (!empty($atts['id'])) {
552 552
 			$imgextra = 'class="wp-image-'.$atts['id'].'"';
553 553
 		}
554
-        $figclass = 'aligncenter';
555
-        if ($atts['align']=="left") {
556
-            $figclass = 'alignleft';
557
-        } else if ($atts['align']=="right") {
558
-            $figclass = 'alignright';
559
-        } else {
560
-            $figclass = 'aligncenter';
561
-        }
562
-        echo '<div class="wp-block-image" data-component-type="wpimg-block">'; 
563
-        echo '<figure class="'.$figclass.' size-large" data-component-type="wpimg-block">';        
564
-        echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  . '"' . $imgextra . ' ">';
565
-        if ($atts['caption'])
566
-        {
567
-            echo '<figcaption>'.$atts['caption'].'</figcaption>';
568
-        }
569
-        echo '</figure></div>';
570
-        echo '<p><br></p>';
571
-        return;
572
-    }
554
+		$figclass = 'aligncenter';
555
+		if ($atts['align']=="left") {
556
+			$figclass = 'alignleft';
557
+		} else if ($atts['align']=="right") {
558
+			$figclass = 'alignright';
559
+		} else {
560
+			$figclass = 'aligncenter';
561
+		}
562
+		echo '<div class="wp-block-image" data-component-type="wpimg-block">'; 
563
+		echo '<figure class="'.$figclass.' size-large" data-component-type="wpimg-block">';        
564
+		echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  . '"' . $imgextra . ' ">';
565
+		if ($atts['caption'])
566
+		{
567
+			echo '<figcaption>'.$atts['caption'].'</figcaption>';
568
+		}
569
+		echo '</figure></div>';
570
+		echo '<p><br></p>';
571
+		return;
572
+	}
573 573
 	
574 574
 	
575 575
 	public function get_ase_options()
@@ -605,12 +605,12 @@  discard block
 block discarded – undo
605 605
 		exit;
606 606
 	}
607 607
     
608
-    /* This function doesn't actually publish post, but should be called when a post is published */
609
-    public function on_publish_post( ) {
608
+	/* This function doesn't actually publish post, but should be called when a post is published */
609
+	public function on_publish_post( ) {
610 610
 
611 611
 		$post_id = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
612 612
         
613
-        do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) );
613
+		do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) );
614 614
 
615 615
 		exit;
616 616
 	}
@@ -668,14 +668,14 @@  discard block
 block discarded – undo
668 668
 			$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
669 669
 			
670 670
 			if ($taxonomy =='category') {
671
-                // convert from names to category ids
671
+				// convert from names to category ids
672 672
 				$cats = array();
673 673
 				foreach ($value as $cat) {
674 674
 					$cat_id = get_cat_ID($cat);
675 675
 					if ($cat_id !=0) {
676 676
 						$cats [] = $cat_id;
677 677
 					} else if ($allow_new_category) {
678
-					    $cats [] = wp_create_category($cat);
678
+						$cats [] = wp_create_category($cat);
679 679
 					}
680 680
 				}
681 681
 				$value = $cats;
@@ -695,7 +695,7 @@  discard block
 block discarded – undo
695 695
 		}
696 696
 	}
697 697
     
698
-    public function create_gallery( ) {
698
+	public function create_gallery( ) {
699 699
 
700 700
 		$postid  	= isset( $_POST['postid'] ) ? $_POST['postid'] : false;
701 701
         
@@ -749,10 +749,10 @@  discard block
 block discarded – undo
749 749
 			'message' => 'gallery-created',
750 750
 			'id' => $postid)
751 751
 		);
752
-        exit;
752
+		exit;
753 753
 	}
754 754
     
755
-    public function update_gallery( ) {
755
+	public function update_gallery( ) {
756 756
         
757 757
 		$options      = isset( $_POST['fields'] ) ? $_POST['fields'] : false;
758 758
         
@@ -768,12 +768,12 @@  discard block
 block discarded – undo
768 768
 
769 769
 		self::save_gallery_options( $postid, $gallery_ids, $options, $type );
770 770
 
771
-        echo json_encode( array('message' => 'gallery-updated') );
771
+		echo json_encode( array('message' => 'gallery-updated') );
772 772
 
773
-        exit;
773
+		exit;
774 774
 	}
775 775
     
776
-    public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) {
776
+	public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) {
777 777
 
778 778
 		// gallery width
779 779
 		$gallery_width = isset( $options['width'] ) ? $options['width'] : false;
@@ -857,7 +857,7 @@  discard block
 block discarded – undo
857 857
 	public function set_date( $postid, $value) {
858 858
 		if( $value ) {
859 859
 			$value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time( 'timestamp', 1 ));
860
-            wp_update_post(
860
+			wp_update_post(
861 861
 				array (
862 862
 					'ID'            => $postid, // ID of the post to update
863 863
 					'post_date'     => date( 'Y-m-d H:i:s',  strtotime($value) ),
Please login to merge, or discard this patch.
Spacing   +186 added lines, -186 removed lines patch added patch discarded remove patch
@@ -52,27 +52,27 @@  discard block
 block discarded – undo
52 52
 		require_once LASSO_DIR.'/public/includes/wrap-shortcodes.php';
53 53
 
54 54
 		// Activate plugin when new blog is added
55
-		add_action( 'wpmu_new_blog', array( $this, 'activate_new_site' ) );
55
+		add_action('wpmu_new_blog', array($this, 'activate_new_site'));
56 56
 
57 57
 		// Load plugin text domain
58
-		add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
58
+		add_action('init', array($this, 'load_plugin_textdomain'));
59 59
 		
60
-		add_action( 'wp_ajax_get_aesop_component',     array( $this, 'get_aesop_component' ) );
61
-		add_action( 'wp_ajax_editus_do_shortcode',     array( $this, 'editus_do_shortcode' ) );
62
-        add_action( 'wp_ajax_editus_do_block',     array( $this, 'editus_do_block' ) );
63
-		add_action( 'wp_ajax_editus_lock_post',     array( $this, 'editus_lock_post' ) );
64
-		add_action( 'wp_ajax_editus_unlock_post',     array( $this, 'editus_unlock_post' ) );
65
-		add_action( 'wp_ajax_editus_hide_tour',     array( $this, 'editus_hide_tour' ) );
66
-		add_action( 'wp_ajax_editus_set_post_setting',     array( $this, 'editus_set_post_setting' ) );
67
-		add_action( 'wp_ajax_editus_get_ase_options',     array( $this, 'get_ase_options' ) );
68
-		add_action( 'wp_ajax_editus_delete_post',     array( $this, 'delete_post' ) );
69
-		add_action( 'wp_ajax_editus_featured_img',     array( $this, 'set_featured_img' ) );
70
-		add_action( 'wp_ajax_editus_del_featured_img',     array( $this, 'del_featured_img' ) );
60
+		add_action('wp_ajax_get_aesop_component', array($this, 'get_aesop_component'));
61
+		add_action('wp_ajax_editus_do_shortcode', array($this, 'editus_do_shortcode'));
62
+        add_action('wp_ajax_editus_do_block', array($this, 'editus_do_block'));
63
+		add_action('wp_ajax_editus_lock_post', array($this, 'editus_lock_post'));
64
+		add_action('wp_ajax_editus_unlock_post', array($this, 'editus_unlock_post'));
65
+		add_action('wp_ajax_editus_hide_tour', array($this, 'editus_hide_tour'));
66
+		add_action('wp_ajax_editus_set_post_setting', array($this, 'editus_set_post_setting'));
67
+		add_action('wp_ajax_editus_get_ase_options', array($this, 'get_ase_options'));
68
+		add_action('wp_ajax_editus_delete_post', array($this, 'delete_post'));
69
+		add_action('wp_ajax_editus_featured_img', array($this, 'set_featured_img'));
70
+		add_action('wp_ajax_editus_del_featured_img', array($this, 'del_featured_img'));
71 71
         
72
-        add_action( 'wp_ajax_editus_publish_post',     array( $this, 'on_publish_post' ) );
72
+        add_action('wp_ajax_editus_publish_post', array($this, 'on_publish_post'));
73 73
         
74
-        add_action( 'wp_ajax_editus_create_gallery',     array( $this, 'create_gallery' ) );
75
-        add_action( 'wp_ajax_editus_update_gallery',     array( $this, 'update_gallery' ) );
74
+        add_action('wp_ajax_editus_create_gallery', array($this, 'create_gallery'));
75
+        add_action('wp_ajax_editus_update_gallery', array($this, 'update_gallery'));
76 76
 
77 77
 		// enable saving custom fields through REST API
78 78
 		self::enable_metasave('post');
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	public static function get_instance() {
104 104
 
105 105
 		// If the single instance hasn't been set, set it now.
106
-		if ( null == self::$instance ) {
106
+		if (null == self::$instance) {
107 107
 			self::$instance = new self;
108 108
 		}
109 109
 
@@ -120,18 +120,18 @@  discard block
 block discarded – undo
120 120
 	 *                                       WPMU is disabled or plugin is
121 121
 	 *                                       activated on an individual blog.
122 122
 	 */
123
-	public static function activate( $network_wide ) {
123
+	public static function activate($network_wide) {
124 124
 
125
-		if ( function_exists( 'is_multisite' ) && is_multisite() ) {
125
+		if (function_exists('is_multisite') && is_multisite()) {
126 126
 
127
-			if ( $network_wide  ) {
127
+			if ($network_wide) {
128 128
 
129 129
 				// Get all blog ids
130 130
 				$blog_ids = self::get_blog_ids();
131 131
 
132
-				foreach ( $blog_ids as $blog_id ) {
132
+				foreach ($blog_ids as $blog_id) {
133 133
 
134
-					switch_to_blog( $blog_id );
134
+					switch_to_blog($blog_id);
135 135
 					self::single_activate();
136 136
 				}
137 137
 
@@ -157,18 +157,18 @@  discard block
 block discarded – undo
157 157
 	 *                                       WPMU is disabled or plugin is
158 158
 	 *                                       deactivated on an individual blog.
159 159
 	 */
160
-	public static function deactivate( $network_wide ) {
160
+	public static function deactivate($network_wide) {
161 161
 
162
-		if ( function_exists( 'is_multisite' ) && is_multisite() ) {
162
+		if (function_exists('is_multisite') && is_multisite()) {
163 163
 
164
-			if ( $network_wide ) {
164
+			if ($network_wide) {
165 165
 
166 166
 				// Get all blog ids
167 167
 				$blog_ids = self::get_blog_ids();
168 168
 
169
-				foreach ( $blog_ids as $blog_id ) {
169
+				foreach ($blog_ids as $blog_id) {
170 170
 
171
-					switch_to_blog( $blog_id );
171
+					switch_to_blog($blog_id);
172 172
 					self::single_deactivate();
173 173
 
174 174
 				}
@@ -192,13 +192,13 @@  discard block
 block discarded – undo
192 192
 	 *
193 193
 	 * @param int     $blog_id ID of the new blog.
194 194
 	 */
195
-	public function activate_new_site( $blog_id ) {
195
+	public function activate_new_site($blog_id) {
196 196
 
197
-		if ( 1 !== did_action( 'wpmu_new_blog' ) ) {
197
+		if (1 !== did_action('wpmu_new_blog')) {
198 198
 			return;
199 199
 		}
200 200
 
201
-		switch_to_blog( $blog_id );
201
+		switch_to_blog($blog_id);
202 202
 		self::single_activate();
203 203
 		restore_current_blog();
204 204
 
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 			WHERE archived = '0' AND spam = '0'
224 224
 			AND deleted = '0'";
225 225
 
226
-		return $wpdb->get_col( $sql );
226
+		return $wpdb->get_col($sql);
227 227
 
228 228
 	}
229 229
 
@@ -234,18 +234,18 @@  discard block
 block discarded – undo
234 234
 	 */
235 235
 	private static function single_activate() {
236 236
 
237
-		$curr_version = get_option( 'lasso_version' );
237
+		$curr_version = get_option('lasso_version');
238 238
 
239 239
 		// update upgraded from
240
-		if ( $curr_version ) {
241
-			update_option( 'lasso_updated_from', $curr_version );
240
+		if ($curr_version) {
241
+			update_option('lasso_updated_from', $curr_version);
242 242
 		}
243 243
 
244 244
 		// update lasso version option
245
-		update_option( 'lasso_version', LASSO_VERSION );
245
+		update_option('lasso_version', LASSO_VERSION);
246 246
 
247 247
 		// set transietn for activation welcome
248
-		set_transient( '_lasso_welcome_redirect', true, 30 );
248
+		set_transient('_lasso_welcome_redirect', true, 30);
249 249
 
250 250
 
251 251
 	}
@@ -267,15 +267,15 @@  discard block
 block discarded – undo
267 267
 	public function load_plugin_textdomain() {
268 268
 
269 269
 		$domain = $this->plugin_slug;
270
-		$locale = apply_filters( 'plugin_locale', get_locale(), $domain );
270
+		$locale = apply_filters('plugin_locale', get_locale(), $domain);
271 271
 
272
-		$out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' );
272
+		$out = load_textdomain($domain, trailingslashit(LASSO_DIR).'languages/'.$domain.'-'.$locale.'.mo');
273 273
 	}
274 274
 	
275 275
     // new ajax function to lock post for editing
276 276
 	public function editus_lock_post()
277 277
 	{
278
-		$post_id= $_POST["postid"];
278
+		$post_id = $_POST["postid"];
279 279
 		$locked = wp_check_post_lock($post_id);
280 280
 		
281 281
 		if (!$locked) {
@@ -283,17 +283,17 @@  discard block
 block discarded – undo
283 283
 			echo "true";
284 284
 		} else {
285 285
 			$user_info = get_userdata($locked);
286
-			echo _e( 'Post being edited by ', 'lasso' ).$user_info->first_name .  " " . $user_info->last_name;
286
+			echo _e('Post being edited by ', 'lasso').$user_info->first_name." ".$user_info->last_name;
287 287
 		}
288 288
 		exit;
289 289
 	}
290 290
 	
291 291
 	public function editus_unlock_post()
292 292
 	{
293
-		$post_id= $_POST["postid"];
293
+		$post_id = $_POST["postid"];
294 294
 		$locked = wp_check_post_lock($post_id);
295 295
         if (!$locked) {
296
-            delete_post_meta( $post_id, '_edit_lock');
296
+            delete_post_meta($post_id, '_edit_lock');
297 297
         }
298 298
 		echo "true";
299 299
 		
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 	{
306 306
 		$user_id = get_current_user_ID();
307 307
 				
308
-		update_user_meta( $user_id, 'lasso_hide_tour', true );
308
+		update_user_meta($user_id, 'lasso_hide_tour', true);
309 309
 		exit;
310 310
 	}
311 311
 	
@@ -316,15 +316,15 @@  discard block
 block discarded – undo
316 316
 		$data = array();
317 317
 		parse_str($_POST['data'], $data);
318 318
 		
319
-		if (!wp_verify_nonce( $data[ 'nonce' ], 'lasso-update-post-settings' )) {
319
+		if (!wp_verify_nonce($data['nonce'], 'lasso-update-post-settings')) {
320 320
 			wp_send_json_error();
321 321
 			exit;
322 322
 		}
323 323
 		
324
-		$status = isset( $data['status'] ) ? $data['status'] : false;
325
-		$postid = isset( $data['postid'] ) ? $data['postid'] : false;
326
-		$slug   = isset( $data['story_slug'] ) ? $data['story_slug'] : false;
327
-        $excerpt   = isset( $data['excerpt'] ) ? $data['excerpt'] : false;
324
+		$status = isset($data['status']) ? $data['status'] : false;
325
+		$postid = isset($data['postid']) ? $data['postid'] : false;
326
+		$slug   = isset($data['story_slug']) ? $data['story_slug'] : false;
327
+        $excerpt = isset($data['excerpt']) ? $data['excerpt'] : false;
328 328
 	
329 329
 
330 330
 		$args = array(
@@ -336,24 +336,24 @@  discard block
 block discarded – undo
336 336
 		
337 337
 		
338 338
 
339
-		wp_update_post( apply_filters( 'lasso_object_status_update_args', $args ) );
339
+		wp_update_post(apply_filters('lasso_object_status_update_args', $args));
340 340
 		
341 341
 		// update categories
342
-		$cats  = isset( $data['story_cats'] ) ? $data['story_cats'] : false;
342
+		$cats = isset($data['story_cats']) ? $data['story_cats'] : false;
343 343
 		
344
-		self::set_post_terms( $postid, $cats, 'category' );
344
+		self::set_post_terms($postid, $cats, 'category');
345 345
 		
346 346
 		// update tags
347
-		$tags = isset( $data['story_tags'] ) ? $data['story_tags'] : false;
348
-		self::set_post_terms( $postid, $tags, 'post_tag' );
347
+		$tags = isset($data['story_tags']) ? $data['story_tags'] : false;
348
+		self::set_post_terms($postid, $tags, 'post_tag');
349 349
 		
350 350
 		//update date
351
-		$date  = isset( $data['post_date'] ) ? $data['post_date'] : false;
352
-		self::set_date( $postid, $date );
351
+		$date = isset($data['post_date']) ? $data['post_date'] : false;
352
+		self::set_date($postid, $date);
353 353
 		
354
-		do_action( 'lasso_post_updated', $postid, $slug, $status, get_current_user_ID() );
355
-		$response= array(
356
-			'link'   => get_permalink($postid). (($status=='publish') ? '' : '&preview=true')
354
+		do_action('lasso_post_updated', $postid, $slug, $status, get_current_user_ID());
355
+		$response = array(
356
+			'link'   => get_permalink($postid).(($status == 'publish') ? '' : '&preview=true')
357 357
 		);
358 358
 		wp_send_json_success($response);
359 359
 		exit;
@@ -361,11 +361,11 @@  discard block
 block discarded – undo
361 361
 	
362 362
 	public static function enable_metasave($type)
363 363
 	{
364
-		register_rest_field( $type, 'metadata', array(
365
-			'get_callback' => function ( $data ) {
366
-				return get_post_meta( $data['id']);//, '', '' );
364
+		register_rest_field($type, 'metadata', array(
365
+			'get_callback' => function($data) {
366
+				return get_post_meta($data['id']); //, '', '' );
367 367
 			}, 
368
-			'update_callback' => function( $data, $post ) {
368
+			'update_callback' => function($data, $post) {
369 369
 				foreach ($data as $key => $value) {
370 370
 					update_post_meta($post->ID, $key, $value);
371 371
 				}
@@ -377,13 +377,13 @@  discard block
 block discarded – undo
377 377
 	public function editus_do_shortcode()
378 378
 	{
379 379
 		
380
-		$code= $_POST["code"];
380
+		$code = $_POST["code"];
381 381
 		$code = str_replace('\"', '"', $code);
382 382
 		
383
-		$code_wrapped = lasso_wrap_shortcodes( $code);
384
-		$out =  do_shortcode($code);
383
+		$code_wrapped = lasso_wrap_shortcodes($code);
384
+		$out = do_shortcode($code);
385 385
 		if ($out != '') {
386
-			$out =  do_shortcode($code_wrapped);
386
+			$out = do_shortcode($code_wrapped);
387 387
 			echo $out;
388 388
 			exit;
389 389
 		}
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 		/** @var \WP_Embed $wp_embed */
394 394
 		global $wp_embed;
395 395
 		$wp_embed->post_ID = $_POST["ID"];
396
-		$out =$wp_embed->run_shortcode( $code_wrapped );
396
+		$out = $wp_embed->run_shortcode($code_wrapped);
397 397
 		
398 398
 		echo $out;
399 399
 		exit;
@@ -402,9 +402,9 @@  discard block
 block discarded – undo
402 402
     public function editus_do_block()
403 403
 	{
404 404
 		
405
-		$code= $_POST["code"];
405
+		$code = $_POST["code"];
406 406
 
407
-        $out = do_blocks( $code );
407
+        $out = do_blocks($code);
408 408
 		
409 409
 		echo $out;
410 410
 		exit;
@@ -414,56 +414,56 @@  discard block
 block discarded – undo
414 414
 	{
415 415
 		
416 416
 		
417
-		$code= $_POST["code"];
417
+		$code = $_POST["code"];
418 418
 		$atts = array(
419 419
 		 );
420 420
 		foreach ($_POST as $key => $value) {
421
-			if ($key !="code" && $key !="action") {
421
+			if ($key != "code" && $key != "action") {
422 422
 				$atts[$key] = $value;
423 423
 			}
424 424
 		}
425 425
 		if ($code == "aesop_video") {
426
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
426
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
427 427
 		    echo aesop_video_shortcode($atts);
428 428
 		}
429 429
 		else if ($code == "aesop_image") {
430
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
430
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
431 431
 		    echo aesop_image_shortcode($atts);
432 432
 		}
433 433
 		else if ($code == "aesop_quote") {
434
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
434
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
435 435
 		    echo aesop_quote_shortcode($atts);
436 436
 		}
437 437
 		else if ($code == "aesop_parallax") {
438
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
438
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
439 439
 		    echo aesop_parallax_shortcode($atts);
440 440
 		}
441 441
 		else if ($code == "aesop_character") {
442
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
442
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
443 443
 		    echo aesop_character_shortcode($atts);
444 444
 		}
445 445
 		else if ($code == "aesop_collection") {
446
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
446
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
447 447
 		    echo aesop_collection_shortcode($atts);
448 448
 		}
449 449
 		else if ($code == "aesop_chapter") {
450
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
450
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
451 451
 		    echo aesop_chapter_shortcode($atts);
452 452
 		}
453 453
 		else if ($code == "aesop_content") {
454
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
454
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
455 455
 		    echo aesop_content_shortcode($atts, $atts['content_data']);
456 456
 		}
457 457
 		else if ($code == "aesop_gallery") {
458
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
459
-		    echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
458
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
459
+		    echo do_shortcode('[aesop_gallery id="'.$atts["id"].'"]');
460 460
 		}
461 461
 		else if ($code == "aesop_audio") {
462
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
462
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
463 463
 		    echo aesop_audio_shortcode($atts);
464 464
 		}
465 465
 		else if ($code == "aesop_document") {
466
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php');
466
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php');
467 467
 		    echo aesop_document_shortcode($atts);
468 468
 		}
469 469
         /*else if ($code == "aesop_content") {
@@ -495,24 +495,24 @@  discard block
 block discarded – undo
495 495
         $extra = "";
496 496
         
497 497
         // try to use srcset and sizes on new WP installs
498
-		if ( function_exists('wp_get_attachment_image_srcset') && $attachment_id = attachment_url_to_postid( $atts['img'] ) ) {
499
-			$srcset = wp_get_attachment_image_srcset( $attachment_id, 'full' );
500
-			$sizes = wp_get_attachment_image_sizes( $attachment_id, 'full' );
498
+		if (function_exists('wp_get_attachment_image_srcset') && $attachment_id = attachment_url_to_postid($atts['img'])) {
499
+			$srcset = wp_get_attachment_image_srcset($attachment_id, 'full');
500
+			$sizes = wp_get_attachment_image_sizes($attachment_id, 'full');
501 501
             $extra = "srcset='$srcset' sizes='$sizes' ";
502 502
         }
503
-        if ($atts['align']=="left") {
503
+        if ($atts['align'] == "left") {
504 504
             $extra .= 'class="alignleft';
505
-        } else if ($atts['align']=="right") {
505
+        } else if ($atts['align'] == "right") {
506 506
             $extra .= 'class="alignright';
507 507
         } else {
508 508
             $extra .= 'class="aligncenter';
509 509
         }
510 510
         if ($atts['imgwidth'] || $atts['imgheight']) {
511 511
             if ($atts['imgwidth']) {
512
-                $extra .= 'width:'. $atts['imgwidth'].';';
512
+                $extra .= 'width:'.$atts['imgwidth'].';';
513 513
             }
514 514
             if ($atts['imgheight']) {
515
-                $extra .= 'height:'. $atts['imgheight'].';';
515
+                $extra .= 'height:'.$atts['imgheight'].';';
516 516
             }
517 517
             
518 518
         }
@@ -524,15 +524,15 @@  discard block
 block discarded – undo
524 524
         //echo ' class="wp-image- lasso--wpimg__wrap lasso-component">';
525 525
         echo ' class="wp-caption lasso-component">';
526 526
         $hrefset = false;
527
-        if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption']=="url" ))
527
+        if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption'] == "url"))
528 528
         {
529
-            echo '<a href="' . $atts['link'] . '">';
529
+            echo '<a href="'.$atts['link'].'">';
530 530
             $hrefset = true;
531
-        } else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img' ) {
532
-            echo '<a href="' . $atts['img'] . '">';
531
+        } else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img') {
532
+            echo '<a href="'.$atts['img'].'">';
533 533
             $hrefset = true;
534 534
         }
535
-        echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  .  '" '. $extra. '>';
535
+        echo '<img src="'.$atts['img'].'" alt="'.$atts['alt'].'" '.$extra.'>';
536 536
         if ($hrefset)
537 537
         {
538 538
             echo '</a>';
@@ -552,16 +552,16 @@  discard block
 block discarded – undo
552 552
 			$imgextra = 'class="wp-image-'.$atts['id'].'"';
553 553
 		}
554 554
         $figclass = 'aligncenter';
555
-        if ($atts['align']=="left") {
555
+        if ($atts['align'] == "left") {
556 556
             $figclass = 'alignleft';
557
-        } else if ($atts['align']=="right") {
557
+        } else if ($atts['align'] == "right") {
558 558
             $figclass = 'alignright';
559 559
         } else {
560 560
             $figclass = 'aligncenter';
561 561
         }
562 562
         echo '<div class="wp-block-image" data-component-type="wpimg-block">'; 
563 563
         echo '<figure class="'.$figclass.' size-large" data-component-type="wpimg-block">';        
564
-        echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  . '"' . $imgextra . ' ">';
564
+        echo '<img src="'.$atts['img'].'" alt="'.$atts['alt'].'"'.$imgextra.' ">';
565 565
         if ($atts['caption'])
566 566
         {
567 567
             echo '<figcaption>'.$atts['caption'].'</figcaption>';
@@ -575,20 +575,20 @@  discard block
 block discarded – undo
575 575
 	public function get_ase_options()
576 576
 	{
577 577
 		$blob = lasso_editor_options_blob();
578
-		$code= $_POST["component"];
578
+		$code = $_POST["component"];
579 579
 		echo $blob[$code];
580 580
 		exit; 
581 581
 	}
582 582
 	
583 583
 	public function delete_post( ) {
584 584
 
585
-		$postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
585
+		$postid = isset($_POST['postid']) ? $_POST['postid'] : false;
586 586
 
587 587
 		// bail out if the current user can't publish posts
588
-		if ( !lasso_user_can( 'delete_post', $postid ) )
588
+		if (!lasso_user_can('delete_post', $postid))
589 589
 			return;
590 590
 		
591
-		if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_delete_post' )) {
591
+		if (!wp_verify_nonce($_POST['nonce'], 'lasso_delete_post')) {
592 592
 			wp_send_json_error();
593 593
 			exit;
594 594
 		}
@@ -598,9 +598,9 @@  discard block
 block discarded – undo
598 598
 			'post_status' 	=> 'trash'
599 599
 		);
600 600
 
601
-		wp_update_post( apply_filters( 'lasso_object_deleted_args', $args ) );
601
+		wp_update_post(apply_filters('lasso_object_deleted_args', $args));
602 602
 
603
-		do_action( 'lasso_object_deleted', $postid, get_current_user_ID() );
603
+		do_action('lasso_object_deleted', $postid, get_current_user_ID());
604 604
 
605 605
 		exit;
606 606
 	}
@@ -608,40 +608,40 @@  discard block
 block discarded – undo
608 608
     /* This function doesn't actually publish post, but should be called when a post is published */
609 609
     public function on_publish_post( ) {
610 610
 
611
-		$post_id = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
611
+		$post_id = isset($_POST['postid']) ? $_POST['postid'] : false;
612 612
         
613
-        do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) );
613
+        do_action('transition_post_status', 'publish', 'draft', get_post($post_id));
614 614
 
615 615
 		exit;
616 616
 	}
617 617
 	
618 618
 	public function set_featured_img( ) {
619 619
 
620
-		$postid  	= isset( $_POST['postid'] ) ? $_POST['postid'] : false;
621
-		$image_id  	= isset( $_POST['image_id'] ) ? absint( $_POST['image_id'] ) : false;
622
-		if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_gallery' )) {
620
+		$postid = isset($_POST['postid']) ? $_POST['postid'] : false;
621
+		$image_id = isset($_POST['image_id']) ? absint($_POST['image_id']) : false;
622
+		if (!wp_verify_nonce($_POST['nonce'], 'lasso_gallery')) {
623 623
 			wp_send_json_error();
624 624
 			exit;
625 625
 		}	
626 626
 
627
-		set_post_thumbnail( $postid, $image_id );
627
+		set_post_thumbnail($postid, $image_id);
628 628
 
629
-		do_action( 'lasso_featured_image_set', $postid, $image_id, get_current_user_ID() );
629
+		do_action('lasso_featured_image_set', $postid, $image_id, get_current_user_ID());
630 630
 
631 631
 		exit;
632 632
 	}
633 633
 	
634 634
 	public function del_featured_img( ) {
635 635
 
636
-		$postid  = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
637
-		if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_gallery' )) {
636
+		$postid = isset($_POST['postid']) ? $_POST['postid'] : false;
637
+		if (!wp_verify_nonce($_POST['nonce'], 'lasso_gallery')) {
638 638
 			wp_send_json_error();
639 639
 			exit;
640 640
 		}	
641 641
 
642
-		delete_post_thumbnail( $postid );
642
+		delete_post_thumbnail($postid);
643 643
 
644
-		do_action( 'lasso_featured_image_deleted', $postid, get_current_user_ID() );
644
+		do_action('lasso_featured_image_deleted', $postid, get_current_user_ID());
645 645
 
646 646
 		exit;
647 647
 	}
@@ -662,17 +662,17 @@  discard block
 block discarded – undo
662 662
 		return self::$revisions;
663 663
 	}*/
664 664
 	
665
-	public function set_post_terms( $postid, $value, $taxonomy ) {
666
-		if( $value ) {
667
-			$value = explode( ',', $value );
668
-			$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
665
+	public function set_post_terms($postid, $value, $taxonomy) {
666
+		if ($value) {
667
+			$value = explode(',', $value);
668
+			$allow_new_category = lasso_editor_get_option('allow_new_category', 'lasso_editor');
669 669
 			
670
-			if ($taxonomy =='category') {
670
+			if ($taxonomy == 'category') {
671 671
                 // convert from names to category ids
672 672
 				$cats = array();
673 673
 				foreach ($value as $cat) {
674 674
 					$cat_id = get_cat_ID($cat);
675
-					if ($cat_id !=0) {
675
+					if ($cat_id != 0) {
676 676
 						$cats [] = $cat_id;
677 677
 					} else if ($allow_new_category) {
678 678
 					    $cats [] = wp_create_category($cat);
@@ -681,71 +681,71 @@  discard block
 block discarded – undo
681 681
 				$value = $cats;
682 682
 			}
683 683
 	
684
-			$result = wp_set_object_terms( $postid, $value, $taxonomy );
684
+			$result = wp_set_object_terms($postid, $value, $taxonomy);
685 685
 		}
686
-		else  {
686
+		else {
687 687
 			//remove all terms from post
688
-			$result = wp_set_object_terms( $postid, null, $taxonomy );
688
+			$result = wp_set_object_terms($postid, null, $taxonomy);
689 689
 		}
690 690
 
691
-		if ( ! is_wp_error( $result ) ) {
691
+		if (!is_wp_error($result)) {
692 692
 			return true;
693
-		}else{
693
+		} else {
694 694
 			return false;
695 695
 		}
696 696
 	}
697 697
     
698 698
     public function create_gallery( ) {
699 699
 
700
-		$postid  	= isset( $_POST['postid'] ) ? $_POST['postid'] : false;
700
+		$postid = isset($_POST['postid']) ? $_POST['postid'] : false;
701 701
         
702
-		if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_gallery' )) {
702
+		if (!wp_verify_nonce($_POST['nonce'], 'lasso_gallery')) {
703 703
 			wp_send_json_error();
704 704
 			exit;
705 705
 		}	
706 706
 
707
-		if (  ! lasso_user_can( 'publish_posts' ) ) {
707
+		if (!lasso_user_can('publish_posts')) {
708 708
 			return false;
709 709
 
710 710
 		}
711 711
 
712
-		$gallery_ids = isset( $_POST['gallery_ids'] ) ? $_POST['gallery_ids'] : false;
712
+		$gallery_ids = isset($_POST['gallery_ids']) ? $_POST['gallery_ids'] : false;
713 713
 
714 714
 		// bail if no gallery ids
715
-		if ( empty( $gallery_ids ) ) {
715
+		if (empty($gallery_ids)) {
716 716
 			return false;
717 717
 		}
718 718
 
719
-		$type   		 = isset( $_POST['gallery_type'] ) ? $_POST['gallery_type'] : false;
720
-		$edgallerytitle	 = isset( $_POST['edgallerytitle'] ) ? $_POST['edgallerytitle'] : $postid.'-'.rand();
719
+		$type = isset($_POST['gallery_type']) ? $_POST['gallery_type'] : false;
720
+		$edgallerytitle = isset($_POST['edgallerytitle']) ? $_POST['edgallerytitle'] : $postid.'-'.rand();
721 721
 
722 722
 		// insert a new gallery
723 723
 		$args = array(
724
-			'post_title'    => $edgallerytitle ,
724
+			'post_title'    => $edgallerytitle,
725 725
 			'post_status'   => 'publish',
726 726
 			'post_type'     => 'ai_galleries'
727 727
 		);
728 728
 
729
-		$postid = wp_insert_post( apply_filters( 'lasso_insert_gallery_args', $args ) );
729
+		$postid = wp_insert_post(apply_filters('lasso_insert_gallery_args', $args));
730 730
 
731 731
 		// update gallery ids
732
-		if ( $gallery_ids ) {
732
+		if ($gallery_ids) {
733 733
 
734
-			update_post_meta( $postid, '_ase_gallery_images', $gallery_ids );
734
+			update_post_meta($postid, '_ase_gallery_images', $gallery_ids);
735 735
 
736 736
 		}
737 737
 
738 738
 		// update the gallery type
739
-		if ( !empty( $type ) ) {
739
+		if (!empty($type)) {
740 740
 
741
-			update_post_meta( $postid, 'aesop_gallery_type', $type );
741
+			update_post_meta($postid, 'aesop_gallery_type', $type);
742 742
 
743 743
 		}
744 744
 
745
-		do_action( 'lasso_gallery_published', $postid, $gallery_ids, get_current_user_ID() );
745
+		do_action('lasso_gallery_published', $postid, $gallery_ids, get_current_user_ID());
746 746
 
747 747
 
748
-		echo json_encode( array(
748
+		echo json_encode(array(
749 749
 			'message' => 'gallery-created',
750 750
 			'id' => $postid)
751 751
 		);
@@ -754,114 +754,114 @@  discard block
 block discarded – undo
754 754
     
755 755
     public function update_gallery( ) {
756 756
         
757
-		$options      = isset( $_POST['fields'] ) ? $_POST['fields'] : false;
757
+		$options      = isset($_POST['fields']) ? $_POST['fields'] : false;
758 758
         
759
-		$postid   	  = !empty( $options ) ? (int) $options['id'] : false;
760
-		$gallery_ids  = isset( $_POST['gallery_ids'] ) ? $_POST['gallery_ids'] : false;
761
-		if ( $_POST[ 'gallery_type' ] ) {
762
-			$type = $_POST[ 'gallery_type' ];
763
-		}elseif ( ! empty( $options ) && $options[ 'galleryType' ] ) {
764
-			$type = $options[ 'galleryType' ];
765
-		}else{
759
+		$postid = !empty($options) ? (int) $options['id'] : false;
760
+		$gallery_ids  = isset($_POST['gallery_ids']) ? $_POST['gallery_ids'] : false;
761
+		if ($_POST['gallery_type']) {
762
+			$type = $_POST['gallery_type'];
763
+		}elseif (!empty($options) && $options['galleryType']) {
764
+			$type = $options['galleryType'];
765
+		} else {
766 766
 			$type = false;
767 767
 		}
768 768
 
769
-		self::save_gallery_options( $postid, $gallery_ids, $options, $type );
769
+		self::save_gallery_options($postid, $gallery_ids, $options, $type);
770 770
 
771
-        echo json_encode( array('message' => 'gallery-updated') );
771
+        echo json_encode(array('message' => 'gallery-updated'));
772 772
 
773 773
         exit;
774 774
 	}
775 775
     
776
-    public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) {
776
+    public function save_gallery_options($postid, $gallery_ids, $options, $type = false) {
777 777
 
778 778
 		// gallery width
779
-		$gallery_width = isset( $options['width'] ) ? $options['width'] : false;
779
+		$gallery_width = isset($options['width']) ? $options['width'] : false;
780 780
 
781 781
 		// gallery grid item width
782
-		$item_width = isset( $options['itemwidth'] ) ? $options['itemwidth'] : false;
782
+		$item_width = isset($options['itemwidth']) ? $options['itemwidth'] : false;
783 783
 
784 784
 		// caption
785
-		$caption = isset( $options['caption'] ) ? $options['caption'] : false;
785
+		$caption = isset($options['caption']) ? $options['caption'] : false;
786 786
 
787 787
 		// gallery transition
788
-		$transition = isset( $options['transition'] ) ? $options['transition'] : false;
788
+		$transition = isset($options['transition']) ? $options['transition'] : false;
789 789
 
790 790
 		// gallery transition speed
791
-		$transitionSpeed = isset( $options['speed'] ) ? $options['speed'] : false;
791
+		$transitionSpeed = isset($options['speed']) ? $options['speed'] : false;
792 792
 
793 793
 		// gallery hide thumbs
794
-		$hideThumbs = isset( $options['hideThumbs'] ) ? $options['hideThumbs'] : false;
794
+		$hideThumbs = isset($options['hideThumbs']) ? $options['hideThumbs'] : false;
795 795
 
796 796
 		// photoset layout hardwired to on for now
797
-		$psLayout = isset( $options['pslayout'] ) ? $options['pslayout'] : false;
797
+		$psLayout = isset($options['pslayout']) ? $options['pslayout'] : false;
798 798
 
799 799
 		// photoset layout
800
-		$psLightbox = 'on';//isset( $options['pslightbox'] ) ? $options['pslightbox'] : false;
800
+		$psLightbox = 'on'; //isset( $options['pslightbox'] ) ? $options['pslightbox'] : false;
801 801
 		
802 802
 		// hero gallery height
803
-		$gallery_height = isset( $options['height'] ) ? $options['height'] : false;
803
+		$gallery_height = isset($options['height']) ? $options['height'] : false;
804 804
 
805 805
 		// update gallery ids
806
-		if ( !empty( $gallery_ids ) ) {
806
+		if (!empty($gallery_ids)) {
807 807
 
808
-			update_post_meta( $postid, '_ase_gallery_images', $gallery_ids );
808
+			update_post_meta($postid, '_ase_gallery_images', $gallery_ids);
809 809
 
810 810
 		}
811 811
 
812
-		update_post_meta( $postid, 'aesop_gallery_type', sanitize_text_field( trim( $type ) ) );
812
+		update_post_meta($postid, 'aesop_gallery_type', sanitize_text_field(trim($type)));
813 813
 
814
-		update_post_meta( $postid, 'aesop_gallery_width', sanitize_text_field( trim( $gallery_width ) ) );
814
+		update_post_meta($postid, 'aesop_gallery_width', sanitize_text_field(trim($gallery_width)));
815 815
 
816
-		update_post_meta( $postid, 'aesop_grid_gallery_width', sanitize_text_field( trim( $item_width ) ) );
816
+		update_post_meta($postid, 'aesop_grid_gallery_width', sanitize_text_field(trim($item_width)));
817 817
 
818
-		update_post_meta( $postid, 'aesop_gallery_caption', sanitize_text_field( trim( $caption ) ) );
818
+		update_post_meta($postid, 'aesop_gallery_caption', sanitize_text_field(trim($caption)));
819 819
 
820
-		update_post_meta( $postid, 'aesop_thumb_gallery_transition', sanitize_text_field( trim( $transition ) ) );
820
+		update_post_meta($postid, 'aesop_thumb_gallery_transition', sanitize_text_field(trim($transition)));
821 821
 
822
-		update_post_meta( $postid, 'aesop_thumb_gallery_transition_speed', absint( trim( $transitionSpeed ) ) );
822
+		update_post_meta($postid, 'aesop_thumb_gallery_transition_speed', absint(trim($transitionSpeed)));
823 823
 
824
-		update_post_meta( $postid, 'aesop_thumb_gallery_hide_thumbs', sanitize_text_field( trim( $hideThumbs ) ) );
824
+		update_post_meta($postid, 'aesop_thumb_gallery_hide_thumbs', sanitize_text_field(trim($hideThumbs)));
825 825
 
826
-		update_post_meta( $postid, 'aesop_photoset_gallery_layout', sanitize_text_field( trim( $psLayout ) ) );
826
+		update_post_meta($postid, 'aesop_photoset_gallery_layout', sanitize_text_field(trim($psLayout)));
827 827
 
828
-		update_post_meta( $postid, 'aesop_photoset_gallery_lightbox', sanitize_text_field( trim( $psLightbox ) ) );
828
+		update_post_meta($postid, 'aesop_photoset_gallery_lightbox', sanitize_text_field(trim($psLightbox)));
829 829
 		
830
-		update_post_meta( $postid, 'aesop_hero_gallery_height', sanitize_text_field( trim( $gallery_height ) ) );
830
+		update_post_meta($postid, 'aesop_hero_gallery_height', sanitize_text_field(trim($gallery_height)));
831 831
 		
832 832
 		//hardwired for now
833 833
 		
834
-		update_post_meta( $postid, 'aesop_hero_gallery_transition_speed', 300 );
834
+		update_post_meta($postid, 'aesop_hero_gallery_transition_speed', 300);
835 835
 
836 836
 	}
837 837
 	
838
-	function getEnglishMonthName($foreignMonthName){
838
+	function getEnglishMonthName($foreignMonthName) {
839 839
 
840 840
 		  setlocale(LC_ALL, 'en_US');
841 841
 
842
-		  $month_numbers = range(1,12);
842
+		  $month_numbers = range(1, 12);
843 843
 
844
-		  foreach($month_numbers as $month)
845
-			$english_months[] = strftime('%B',mktime(0,0,0,$month,1,2011));
844
+		  foreach ($month_numbers as $month)
845
+			$english_months[] = strftime('%B', mktime(0, 0, 0, $month, 1, 2011));
846 846
 
847 847
 		  setlocale(LC_ALL, get_locale());
848 848
 
849
-		  foreach($month_numbers as $month)
850
-			$foreign_months[] = utf8_encode(strftime('%B',mktime(0,0,0,$month,1,2011)));
849
+		  foreach ($month_numbers as $month)
850
+			$foreign_months[] = utf8_encode(strftime('%B', mktime(0, 0, 0, $month, 1, 2011)));
851 851
 
852 852
 		  return str_replace($foreign_months, $english_months, $foreignMonthName);
853 853
 	}
854 854
 
855 855
 
856 856
 	
857
-	public function set_date( $postid, $value) {
858
-		if( $value ) {
859
-			$value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time( 'timestamp', 1 ));
857
+	public function set_date($postid, $value) {
858
+		if ($value) {
859
+			$value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time('timestamp', 1));
860 860
             wp_update_post(
861
-				array (
861
+				array(
862 862
 					'ID'            => $postid, // ID of the post to update
863
-					'post_date'     => date( 'Y-m-d H:i:s',  strtotime($value) ),
864
-					'post_date_gmt'     => gmdate( 'Y-m-d H:i:s',  strtotime($value) ),
863
+					'post_date'     => date('Y-m-d H:i:s', strtotime($value)),
864
+					'post_date_gmt'     => gmdate('Y-m-d H:i:s', strtotime($value)),
865 865
 				)
866 866
 			);
867 867
 		}
Please login to merge, or discard this patch.
Braces   +25 added lines, -35 removed lines patch added patch discarded remove patch
@@ -425,44 +425,34 @@  discard block
 block discarded – undo
425 425
 		if ($code == "aesop_video") {
426 426
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
427 427
 		    echo aesop_video_shortcode($atts);
428
-		}
429
-		else if ($code == "aesop_image") {
428
+		} else if ($code == "aesop_image") {
430 429
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
431 430
 		    echo aesop_image_shortcode($atts);
432
-		}
433
-		else if ($code == "aesop_quote") {
431
+		} else if ($code == "aesop_quote") {
434 432
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
435 433
 		    echo aesop_quote_shortcode($atts);
436
-		}
437
-		else if ($code == "aesop_parallax") {
434
+		} else if ($code == "aesop_parallax") {
438 435
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
439 436
 		    echo aesop_parallax_shortcode($atts);
440
-		}
441
-		else if ($code == "aesop_character") {
437
+		} else if ($code == "aesop_character") {
442 438
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
443 439
 		    echo aesop_character_shortcode($atts);
444
-		}
445
-		else if ($code == "aesop_collection") {
440
+		} else if ($code == "aesop_collection") {
446 441
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
447 442
 		    echo aesop_collection_shortcode($atts);
448
-		}
449
-		else if ($code == "aesop_chapter") {
443
+		} else if ($code == "aesop_chapter") {
450 444
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
451 445
 		    echo aesop_chapter_shortcode($atts);
452
-		}
453
-		else if ($code == "aesop_content") {
446
+		} else if ($code == "aesop_content") {
454 447
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
455 448
 		    echo aesop_content_shortcode($atts, $atts['content_data']);
456
-		}
457
-		else if ($code == "aesop_gallery") {
449
+		} else if ($code == "aesop_gallery") {
458 450
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
459 451
 		    echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
460
-		}
461
-		else if ($code == "aesop_audio") {
452
+		} else if ($code == "aesop_audio") {
462 453
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
463 454
 		    echo aesop_audio_shortcode($atts);
464
-		}
465
-		else if ($code == "aesop_document") {
455
+		} else if ($code == "aesop_document") {
466 456
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php');
467 457
 		    echo aesop_document_shortcode($atts);
468 458
 		}
@@ -472,11 +462,9 @@  discard block
 block discarded – undo
472 462
 		}*/
473 463
         else if ($code == "aesop_wpimg") {
474 464
             self::wpimg($atts);
475
-		}
476
-		else if ($code == "aesop_wpimg-block") {
465
+		} else if ($code == "aesop_wpimg-block") {
477 466
             self::wpimg_block($atts);
478
-		}
479
-		else {
467
+		} else {
480 468
 			$code = '['.$code.' ';
481 469
 			foreach ($atts as $key => $value) {
482 470
 			    $code = ''.$key.'="'.$value.'" ';
@@ -585,8 +573,9 @@  discard block
 block discarded – undo
585 573
 		$postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
586 574
 
587 575
 		// bail out if the current user can't publish posts
588
-		if ( !lasso_user_can( 'delete_post', $postid ) )
589
-			return;
576
+		if ( !lasso_user_can( 'delete_post', $postid ) ) {
577
+					return;
578
+		}
590 579
 		
591 580
 		if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_delete_post' )) {
592 581
 			wp_send_json_error();
@@ -682,15 +671,14 @@  discard block
 block discarded – undo
682 671
 			}
683 672
 	
684 673
 			$result = wp_set_object_terms( $postid, $value, $taxonomy );
685
-		}
686
-		else  {
674
+		} else  {
687 675
 			//remove all terms from post
688 676
 			$result = wp_set_object_terms( $postid, null, $taxonomy );
689 677
 		}
690 678
 
691 679
 		if ( ! is_wp_error( $result ) ) {
692 680
 			return true;
693
-		}else{
681
+		} else{
694 682
 			return false;
695 683
 		}
696 684
 	}
@@ -760,9 +748,9 @@  discard block
 block discarded – undo
760 748
 		$gallery_ids  = isset( $_POST['gallery_ids'] ) ? $_POST['gallery_ids'] : false;
761 749
 		if ( $_POST[ 'gallery_type' ] ) {
762 750
 			$type = $_POST[ 'gallery_type' ];
763
-		}elseif ( ! empty( $options ) && $options[ 'galleryType' ] ) {
751
+		} elseif ( ! empty( $options ) && $options[ 'galleryType' ] ) {
764 752
 			$type = $options[ 'galleryType' ];
765
-		}else{
753
+		} else{
766 754
 			$type = false;
767 755
 		}
768 756
 
@@ -841,13 +829,15 @@  discard block
 block discarded – undo
841 829
 
842 830
 		  $month_numbers = range(1,12);
843 831
 
844
-		  foreach($month_numbers as $month)
845
-			$english_months[] = strftime('%B',mktime(0,0,0,$month,1,2011));
832
+		  foreach($month_numbers as $month) {
833
+		  			$english_months[] = strftime('%B',mktime(0,0,0,$month,1,2011));
834
+		  }
846 835
 
847 836
 		  setlocale(LC_ALL, get_locale());
848 837
 
849
-		  foreach($month_numbers as $month)
850
-			$foreign_months[] = utf8_encode(strftime('%B',mktime(0,0,0,$month,1,2011)));
838
+		  foreach($month_numbers as $month) {
839
+		  			$foreign_months[] = utf8_encode(strftime('%B',mktime(0,0,0,$month,1,2011)));
840
+		  }
851 841
 
852 842
 		  return str_replace($foreign_months, $english_months, $foreignMonthName);
853 843
 	}
Please login to merge, or discard this patch.
public/includes/assets.php 2 patches
Indentation   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -15,29 +15,29 @@  discard block
 block discarded – undo
15 15
 		add_action('wp_enqueue_scripts', array($this,'scripts'));
16 16
 	}
17 17
     
18
-    function is_multipage()
19
-    {
20
-        global $post;
21
-        $pos = strpos($post->post_content, "<!--nextpage-->");
22
-        if (!$pos) return -1;
18
+	function is_multipage()
19
+	{
20
+		global $post;
21
+		$pos = strpos($post->post_content, "<!--nextpage-->");
22
+		if (!$pos) return -1;
23 23
         
24
-        global $wp;
25
-        $url =  home_url( $wp->request );
26
-        $index = intval(basename($url)) == 0 ? 0 : intval(basename($url))-1;
27
-        return $index;        
28
-    }
24
+		global $wp;
25
+		$url =  home_url( $wp->request );
26
+		$index = intval(basename($url)) == 0 ? 0 : intval(basename($url))-1;
27
+		return $index;        
28
+	}
29 29
 
30 30
 	public function scripts(){
31 31
 
32 32
 	
33 33
 		global $post;
34 34
 		if ( lasso_user_can('edit_posts') 
35
-		     /* uncomment this line to disable Editus on Gutenberg posts*/
36
-             /* && !( function_exists( 'has_blocks' ) && has_blocks( $post->post_content)  && !is_home()) */              
37
-             ) {
35
+			 /* uncomment this line to disable Editus on Gutenberg posts*/
36
+			 /* && !( function_exists( 'has_blocks' ) && has_blocks( $post->post_content)  && !is_home()) */              
37
+			 ) {
38 38
 			
39 39
 			/**    Returns the time offset from UTC
40
-			*/
40
+			 */
41 41
 			function get_UTC_offset() {
42 42
 				$timezone_string = get_option( 'timezone_string' );
43 43
 				if (empty( $timezone_string ) ) {
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
 			wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true);
54 54
 
55
-            //don't load autocomplete if it's a stockholm theme
55
+			//don't load autocomplete if it's a stockholm theme
56 56
 			$themename  	= wp_get_theme()->get('Name');
57 57
 			if ($themename !='Stockholm' ) {
58 58
 				wp_enqueue_script('jquery-ui-autocomplete');
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
 			$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor','b');
91 91
 			$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor','i');
92 92
             
93
-            $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
93
+			$use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
94 94
             
95
-            $use_wpimgblock = false;
95
+			$use_wpimgblock = false;
96 96
             
97
-            $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor', 'off');
97
+			$link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor', 'off');
98 98
 
99 99
 			
100 100
 			//text alignement
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 			$tz_offset = get_UTC_offset();
133 133
 			$post_date = get_the_time('U', $postid);
134 134
 			$time = (time()+$tz_offset);
135
-            $delta = $time - $post_date;
135
+			$delta = $time - $post_date;
136 136
             
137 137
 			$strings = array(
138 138
 				'save' 				=> __('Save','lasso'),
@@ -187,11 +187,11 @@  discard block
 block discarded – undo
187 187
 			$gallery_nonce = wp_create_nonce( $gallery_nonce_action );
188 188
 			
189 189
 			
190
-            if ($allow_change_date) {
191
-			    $permalink = get_site_url().'/?p='.$postid;
192
-            } else {
193
-                $permalink = get_permalink($postid);
194
-            }
190
+			if ($allow_change_date) {
191
+				$permalink = get_site_url().'/?p='.$postid;
192
+			} else {
193
+				$permalink = get_permalink($postid);
194
+			}
195 195
 			
196 196
 			// rest api
197 197
 			$rest_nonce = '';
@@ -211,17 +211,17 @@  discard block
 block discarded – undo
211 211
 				}
212 212
 			}
213 213
             
214
-            //excerpt
215
-            $post_excerpt = "";
216
-            $post_excerpt = $post->post_excerpt;
214
+			//excerpt
215
+			$post_excerpt = "";
216
+			$post_excerpt = $post->post_excerpt;
217 217
             
218
-            //find if this is multi page. -1 if not
219
-            $multipage = self::is_multipage();
220
-            $post_content = "";
221
-            //pass post_content if we need to process multipage. In future we may need to pass this for other purposes
222
-            //if ($multipage != -1) {
223
-               $post_content = $post->post_content;
224
-            //}
218
+			//find if this is multi page. -1 if not
219
+			$multipage = self::is_multipage();
220
+			$post_content = "";
221
+			//pass post_content if we need to process multipage. In future we may need to pass this for other purposes
222
+			//if ($multipage != -1) {
223
+			   $post_content = $post->post_content;
224
+			//}
225 225
 
226 226
 			// localized objects
227 227
 			$objects = array(
@@ -298,18 +298,18 @@  discard block
 block discarded – undo
298 298
 				'customFields'      => $custom_fields,
299 299
 				'clickToInsert'     => ($insert_comp_ui =='click'),
300 300
 				'buttonOnEmptyP'     => ($insert_comp_ui =='mediumcom'),      // auto show a button to insert components on an empty paragraph      
301
-                'rtl'               => is_rtl(),				
301
+				'rtl'               => is_rtl(),				
302 302
 				'skipToEdit'        =>( $delta < 10 && $delta >=0 ), // if it's a new post, skip to edit mode
303 303
 				'linksEditable'    => $links_editable,
304 304
 				'supportPendingStatus' => !$no_pending_status,
305 305
 				'tableCode' => apply_filters( 'lasso_table_html_code','<table><tr><th>Cell 1</th><th>Cell 2</th></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table><p></p>'),
306
-                'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) || self::gutenberg_active(),//,
307
-                'multipages'=> $multipage,
308
-                'post_content'=>$post_content,
309
-                'post_excerpt'=>$post_excerpt,
310
-                'oldWPimg'=> $use_old_wpimg =='on',
311
-                'useWPImgBlk'=> $use_wpimgblock,
312
-                'prefixHTTP'=> $link_prefix_http =='on'
306
+				'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) || self::gutenberg_active(),//,
307
+				'multipages'=> $multipage,
308
+				'post_content'=>$post_content,
309
+				'post_excerpt'=>$post_excerpt,
310
+				'oldWPimg'=> $use_old_wpimg =='on',
311
+				'useWPImgBlk'=> $use_wpimgblock,
312
+				'prefixHTTP'=> $link_prefix_http =='on'
313 313
 			);
314 314
 
315 315
 
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 			
318 318
 			
319 319
 			if (!$using_restapiv2) {
320
-               // enqueue REST API V1
320
+			   // enqueue REST API V1
321 321
 			   wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
322 322
 			   $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) );
323 323
 			   wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings );
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 			if ($show_color) {
334 334
 				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true);
335 335
 			} else {
336
-			    wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
336
+				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
337 337
 			}
338 338
 			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) );
339 339
 
@@ -342,44 +342,44 @@  discard block
 block discarded – undo
342 342
 
343 343
 	}
344 344
     
345
-    function gutenberg_active() {
345
+	function gutenberg_active() {
346 346
         
347
-        // Gutenberg plugin is installed and activated.
348
-        $gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) );
349
-
350
-        // Block editor since 5.0.
351
-        $block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' );
352
-
353
-        if ( ! $gutenberg && ! $block_editor ) {
354
-            return false;
355
-        }
356
-
357
-        if ( self::is_classic_editor_plugin_active() ) {
358
-            $editor_option       = get_option( 'classic-editor-replace' );
359
-            $block_editor_active = array( 'no-replace', 'block' );
360
-
361
-            return in_array( $editor_option, $block_editor_active, true );
362
-        }
363
-
364
-        return true;
365
-    }
366
-
367
-    /**
368
-     * Check if Classic Editor plugin is active.
369
-     *
370
-     * @return bool
371
-     */
372
-    function is_classic_editor_plugin_active() {
373
-        if ( ! function_exists( 'is_plugin_active' ) ) {
374
-            include_once ABSPATH . 'wp-admin/includes/plugin.php';
375
-        }
376
-
377
-        if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) {
378
-            return true;
379
-        }
380
-
381
-        return false;
382
-    }
347
+		// Gutenberg plugin is installed and activated.
348
+		$gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) );
349
+
350
+		// Block editor since 5.0.
351
+		$block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' );
352
+
353
+		if ( ! $gutenberg && ! $block_editor ) {
354
+			return false;
355
+		}
356
+
357
+		if ( self::is_classic_editor_plugin_active() ) {
358
+			$editor_option       = get_option( 'classic-editor-replace' );
359
+			$block_editor_active = array( 'no-replace', 'block' );
360
+
361
+			return in_array( $editor_option, $block_editor_active, true );
362
+		}
363
+
364
+		return true;
365
+	}
366
+
367
+	/**
368
+	 * Check if Classic Editor plugin is active.
369
+	 *
370
+	 * @return bool
371
+	 */
372
+	function is_classic_editor_plugin_active() {
373
+		if ( ! function_exists( 'is_plugin_active' ) ) {
374
+			include_once ABSPATH . 'wp-admin/includes/plugin.php';
375
+		}
376
+
377
+		if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) {
378
+			return true;
379
+		}
380
+
381
+		return false;
382
+	}
383 383
 
384 384
 }
385 385
 
Please login to merge, or discard this patch.
Spacing   +108 added lines, -108 removed lines patch added patch discarded remove patch
@@ -10,9 +10,9 @@  discard block
 block discarded – undo
10 10
 
11 11
 class assets {
12 12
 
13
-	public function __construct(){
13
+	public function __construct() {
14 14
 
15
-		add_action('wp_enqueue_scripts', array($this,'scripts'));
15
+		add_action('wp_enqueue_scripts', array($this, 'scripts'));
16 16
 	}
17 17
     
18 18
     function is_multipage()
@@ -22,16 +22,16 @@  discard block
 block discarded – undo
22 22
         if (!$pos) return -1;
23 23
         
24 24
         global $wp;
25
-        $url =  home_url( $wp->request );
26
-        $index = intval(basename($url)) == 0 ? 0 : intval(basename($url))-1;
25
+        $url = home_url($wp->request);
26
+        $index = intval(basename($url)) == 0 ? 0 : intval(basename($url)) - 1;
27 27
         return $index;        
28 28
     }
29 29
 
30
-	public function scripts(){
30
+	public function scripts() {
31 31
 
32 32
 	
33 33
 		global $post;
34
-		if ( lasso_user_can('edit_posts') 
34
+		if (lasso_user_can('edit_posts') 
35 35
 		     /* uncomment this line to disable Editus on Gutenberg posts*/
36 36
              /* && !( function_exists( 'has_blocks' ) && has_blocks( $post->post_content)  && !is_home()) */              
37 37
              ) {
@@ -39,9 +39,9 @@  discard block
 block discarded – undo
39 39
 			/**    Returns the time offset from UTC
40 40
 			*/
41 41
 			function get_UTC_offset() {
42
-				$timezone_string = get_option( 'timezone_string' );
43
-				if (empty( $timezone_string ) ) {
44
-					return get_option('gmt_offset')*3600;
42
+				$timezone_string = get_option('timezone_string');
43
+				if (empty($timezone_string)) {
44
+					return get_option('gmt_offset') * 3600;
45 45
 				}
46 46
 				
47 47
 				$origin_dtz = new \DateTimeZone($timezone_string);				
@@ -53,8 +53,8 @@  discard block
 block discarded – undo
53 53
 			wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true);
54 54
 
55 55
             //don't load autocomplete if it's a stockholm theme
56
-			$themename  	= wp_get_theme()->get('Name');
57
-			if ($themename !='Stockholm' ) {
56
+			$themename = wp_get_theme()->get('Name');
57
+			if ($themename != 'Stockholm') {
58 58
 				wp_enqueue_script('jquery-ui-autocomplete');
59 59
 			}
60 60
 			wp_enqueue_script('jquery-ui-draggable');
@@ -67,30 +67,30 @@  discard block
 block discarded – undo
67 67
 			// url for json api
68 68
 			$home_url = function_exists('json_get_url_prefix') ? json_get_url_prefix() : false;
69 69
 
70
-			$article_object 	= lasso_editor_get_option('article_class','lasso_editor');
70
+			$article_object 	= lasso_editor_get_option('article_class', 'lasso_editor');
71 71
 
72
-			$article_object 	= empty( $article_object ) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object;
72
+			$article_object 	= empty($article_object) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object;
73 73
 
74
-			$featImgClass 		= lasso_editor_get_option('featimg_class','lasso_editor');
75
-			if (empty( $featImgClass )) {
74
+			$featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor');
75
+			if (empty($featImgClass)) {
76 76
 				$featImgClass = lasso_get_supported_theme_featured_image_class();
77 77
 			}
78
-			$titleClass 		= lasso_editor_get_option('title_class','lasso_editor');
79
-			if (empty( $titleClass )) {
78
+			$titleClass = lasso_editor_get_option('title_class', 'lasso_editor');
79
+			if (empty($titleClass)) {
80 80
 				$titleClass = lasso_get_supported_theme_title_class();
81 81
 			}
82
-			$toolbar_headings  	= lasso_editor_get_option('toolbar_headings', 'lasso_editor');
83
-			$toolbar_headings_h4  	= lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
82
+			$toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor');
83
+			$toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
84 84
 			$objectsNoSave  	= lasso_editor_get_option('dont_save', 'lasso_editor');
85
-			$objectsNonEditable  	= lasso_editor_get_option('non_editable', 'lasso_editor');
85
+			$objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor');
86 86
 			$disableRESTSave = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor');
87
-			$save_to_post_disabled  = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' );
88
-			$edit_post_disabled  = lasso_editor_get_option( 'post_edit_disabled', 'lasso_editor' );
87
+			$save_to_post_disabled = lasso_editor_get_option('post_save_disabled', 'lasso_editor');
88
+			$edit_post_disabled = lasso_editor_get_option('post_edit_disabled', 'lasso_editor');
89 89
 			
90
-			$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor','b');
91
-			$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor','i');
90
+			$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor', 'b');
91
+			$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor', 'i');
92 92
             
93
-            $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
93
+            $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor', 'off');
94 94
             
95 95
             $use_wpimgblock = false;
96 96
             
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
 			
112 112
 			if ($show_color) {
113 113
 				//color picker
114
-				wp_enqueue_style( 'wp-color-picker' );
115
-				wp_enqueue_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 );
114
+				wp_enqueue_style('wp-color-picker');
115
+				wp_enqueue_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), false, 1);
116 116
 			}
117 117
 			
118 118
 			// click to insert components, not drag and drop
@@ -124,54 +124,54 @@  discard block
 block discarded – undo
124 124
 			
125 125
 			// custom fields
126 126
 			
127
-			$custom_fields = apply_filters( 'editus_custom_fields', null ); 
127
+			$custom_fields = apply_filters('editus_custom_fields', null); 
128 128
 
129 129
 
130 130
 			// post id reference
131 131
 			$postid 			= get_the_ID();
132 132
 			$tz_offset = get_UTC_offset();
133 133
 			$post_date = get_the_time('U', $postid);
134
-			$time = (time()+$tz_offset);
134
+			$time = (time() + $tz_offset);
135 135
             $delta = $time - $post_date;
136 136
             
137 137
 			$strings = array(
138
-				'save' 				=> __('Save','lasso'),
139
-				'selectText'	  	=> __('Please Select Text First.','lasso'),
140
-				'cancel' 			=> __('Cancel','lasso'),
141
-				'exiteditor' 		=> __('Exit Editor','lasso'),
142
-				'saving' 			=> __('Saving...','lasso'),
143
-				'saved'				=> __('Saved!','lasso'),
144
-				'adding' 			=> __('Adding...','lasso'),
145
-				'added'				=> __('Added!','lasso'),
146
-				'loading' 			=> __('Loading...','lasso'),
147
-				'loadMore'			=> __('Load More','lasso'),
148
-				'close'			=> __('Close','lasso'),
149
-				'noPostsFound'		=> __('No more posts found','lasso'),
150
-				'fetchFail'	    	=> __('Fetching failed.','lasso'),
151
-				'galleryCreated' 	=> __('Gallery Created!','lasso'),
152
-				'galleryUpdated' 	=> __('Gallery Updated!','lasso'),
153
-				'justWrite'			=> __('Just write...','lasso'),
154
-				'chooseImage'		=> __('Choose an image','lasso'),
155
-				'updateImage'		=> __('Update Image','lasso'),
156
-				'insertImage'		=> __('Insert Image','lasso'),
157
-				'selectImage'		=> __('Select Image','lasso'),
158
-				'removeFeatImg'     => __('Remove featured image?','lasso'),
159
-				'updateSelectedImg' => __('Update Selected Image','lasso'),
160
-				'chooseImages'		=> __('Choose images','lasso'),
161
-				'editImage'			=> __('Edit Image','lasso'),
162
-				'addImages'			=> __('Add Images','lasso'),
163
-				'addNewGallery'		=> __('Add New Gallery','lasso'),
164
-				'selectGallery'		=> __('Select Editus Gallery Image','lasso'),
165
-				'useSelectedImages' => __('Use Selected Images','lasso'),
166
-				'publishPost'		=> __('Publish Post?','lasso'),
167
-				'publishYes'		=> __('Yes, publish it!','lasso'),
168
-				'deletePost'		=> __('Trash Post?','lasso'),
169
-				'deleteYes'			=> __('Yes, trash it!','lasso'),
170
-				'warning'			=> __('Oh snap!','laso'),
171
-				'cancelText'		=> __('O.K. got it!','lasso'),
172
-				'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'),
138
+				'save' 				=> __('Save', 'lasso'),
139
+				'selectText'	  	=> __('Please Select Text First.', 'lasso'),
140
+				'cancel' 			=> __('Cancel', 'lasso'),
141
+				'exiteditor' 		=> __('Exit Editor', 'lasso'),
142
+				'saving' 			=> __('Saving...', 'lasso'),
143
+				'saved'				=> __('Saved!', 'lasso'),
144
+				'adding' 			=> __('Adding...', 'lasso'),
145
+				'added'				=> __('Added!', 'lasso'),
146
+				'loading' 			=> __('Loading...', 'lasso'),
147
+				'loadMore'			=> __('Load More', 'lasso'),
148
+				'close'			=> __('Close', 'lasso'),
149
+				'noPostsFound'		=> __('No more posts found', 'lasso'),
150
+				'fetchFail'	    	=> __('Fetching failed.', 'lasso'),
151
+				'galleryCreated' 	=> __('Gallery Created!', 'lasso'),
152
+				'galleryUpdated' 	=> __('Gallery Updated!', 'lasso'),
153
+				'justWrite'			=> __('Just write...', 'lasso'),
154
+				'chooseImage'		=> __('Choose an image', 'lasso'),
155
+				'updateImage'		=> __('Update Image', 'lasso'),
156
+				'insertImage'		=> __('Insert Image', 'lasso'),
157
+				'selectImage'		=> __('Select Image', 'lasso'),
158
+				'removeFeatImg'     => __('Remove featured image?', 'lasso'),
159
+				'updateSelectedImg' => __('Update Selected Image', 'lasso'),
160
+				'chooseImages'		=> __('Choose images', 'lasso'),
161
+				'editImage'			=> __('Edit Image', 'lasso'),
162
+				'addImages'			=> __('Add Images', 'lasso'),
163
+				'addNewGallery'		=> __('Add New Gallery', 'lasso'),
164
+				'selectGallery'		=> __('Select Editus Gallery Image', 'lasso'),
165
+				'useSelectedImages' => __('Use Selected Images', 'lasso'),
166
+				'publishPost'		=> __('Publish Post?', 'lasso'),
167
+				'publishYes'		=> __('Yes, publish it!', 'lasso'),
168
+				'deletePost'		=> __('Trash Post?', 'lasso'),
169
+				'deleteYes'			=> __('Yes, trash it!', 'lasso'),
170
+				'warning'			=> __('Oh snap!', 'laso'),
171
+				'cancelText'		=> __('O.K. got it!', 'lasso'),
172
+				'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'),
173 173
 				'missingConfirm'	=> __('Update Settings', 'lasso'),
174
-				'helperText'		=> __('one more letter','lasso'),
174
+				'helperText'		=> __('one more letter', 'lasso'),
175 175
 				'editingBackup'  	=> __('You are currently editing a backup copy of this post.'),
176 176
 				
177 177
 				'catsPlaceholder'     => __('add categories...'),
@@ -180,11 +180,11 @@  discard block
 block discarded – undo
180 180
 				
181 181
 			);
182 182
 
183
-			$api_url = trailingslashit( home_url() ) . 'lasso-internal-api';
183
+			$api_url = trailingslashit(home_url()).'lasso-internal-api';
184 184
 
185 185
 			$gallery_class = new gallery();
186 186
 			$gallery_nonce_action = $gallery_class->nonce_action;
187
-			$gallery_nonce = wp_create_nonce( $gallery_nonce_action );
187
+			$gallery_nonce = wp_create_nonce($gallery_nonce_action);
188 188
 			
189 189
 			
190 190
             if ($allow_change_date) {
@@ -199,13 +199,13 @@  discard block
 block discarded – undo
199 199
 			  
200 200
 			if (function_exists('rest_url')) {
201 201
 				//$rest_root = esc_url_raw( rest_url());
202
-				$rest_nonce = wp_create_nonce( 'wp_rest' );
203
-				$settings = array( 'root' => $rest_root, 'nonce' => $rest_nonce );
204
-				wp_enqueue_script( 'wp-api', '', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
205
-				wp_localize_script( 'wp-api', 'wpApiSettings', $settings );
206
-				wp_localize_script( 'wp-api', 'WP_API_Settings', $settings );
202
+				$rest_nonce = wp_create_nonce('wp_rest');
203
+				$settings = array('root' => $rest_root, 'nonce' => $rest_nonce);
204
+				wp_enqueue_script('wp-api', '', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true);
205
+				wp_localize_script('wp-api', 'wpApiSettings', $settings);
206
+				wp_localize_script('wp-api', 'WP_API_Settings', $settings);
207 207
 				
208
-				if ( class_exists( 'WP_REST_Controller' )) {
208
+				if (class_exists('WP_REST_Controller')) {
209 209
 					// we are using REST API V2
210 210
 					$using_restapiv2 = true;
211 211
 				}
@@ -225,8 +225,8 @@  discard block
 block discarded – undo
225 225
 
226 226
 			// localized objects
227 227
 			$objects = array(
228
-				'ajaxurl' 			=> esc_url( $api_url ),
229
-				'ajaxurl2' 			=> esc_url( admin_url( 'admin-ajax.php' )),
228
+				'ajaxurl' 			=> esc_url($api_url),
229
+				'ajaxurl2' 			=> esc_url(admin_url('admin-ajax.php')),
230 230
 				'siteUrl'           => site_url(),
231 231
 				'rest_root'         => $rest_root,
232 232
 				'rest_nonce'        => $rest_nonce,
@@ -235,13 +235,13 @@  discard block
 block discarded – undo
235 235
 				'featImgClass'		=> $featImgClass,
236 236
 				'titleClass'		=> $titleClass,
237 237
 				'strings'			=> $strings,
238
-				'settingsLink'		=> function_exists('is_multisite') && is_multisite() ? network_admin_url( 'settings.php?page=lasso-editor' ) : admin_url( 'admin.php?page=lasso-editor-settings' ),
239
-				'post_status'		=> get_post_status( $postid ),
238
+				'settingsLink'		=> function_exists('is_multisite') && is_multisite() ? network_admin_url('settings.php?page=lasso-editor') : admin_url('admin.php?page=lasso-editor-settings'),
239
+				'post_status'		=> get_post_status($postid),
240 240
 				'postid'			=> $postid,
241 241
 				'permalink'			=> $permalink,
242 242
 				'edit_others_pages'	=> current_user_can('edit_others_pages') ? true : false,
243 243
 				'edit_others_posts'	=> current_user_can('edit_others_posts') ? true : false,
244
-				'userCanEdit'		=> current_user_can('edit_post', $postid ),
244
+				'userCanEdit'		=> current_user_can('edit_post', $postid),
245 245
 				'can_publish'		=> is_page() ? current_user_can('publish_pages') : current_user_can('publish_posts'),
246 246
 				//'can_publish_posts'	=> current_user_can('publish_posts'),
247 247
 				//'can_publish_pages'	=> current_user_can('publish_pages'),
@@ -278,38 +278,38 @@  discard block
 block discarded – undo
278 278
 				'postTags'    		=> lasso_get_objects('tag'),
279 279
 				'noResultsDiv'		=> lasso_editor_empty_results(),
280 280
 				'noRevisionsDiv'	=> lasso_editor_empty_results('revision'),
281
-				'mapTileProvider'   => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider( $postid ) : false,
282
-				'mapLocations'		=> get_post_meta( $postid, 'ase_map_component_locations' ),
283
-				'mapStart'			=> get_post_meta( $postid, 'ase_map_component_start_point', true ),
284
-				'mapZoom'			=> get_post_meta( $postid, 'ase_map_component_zoom', true ),
281
+				'mapTileProvider'   => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider($postid) : false,
282
+				'mapLocations'		=> get_post_meta($postid, 'ase_map_component_locations'),
283
+				'mapStart'			=> get_post_meta($postid, 'ase_map_component_start_point', true),
284
+				'mapZoom'			=> get_post_meta($postid, 'ase_map_component_zoom', true),
285 285
 				'revisionModal' 	=> lasso_editor_revision_modal(),
286 286
 				'isMobile'          => wp_is_mobile(),
287
-				'enableAutoSave'    => lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ),
287
+				'enableAutoSave'    => lasso_editor_get_option('enable_autosave', 'lasso_editor'),
288 288
 				'showColor'         => $show_color,
289 289
 				'showAlignment'     => $show_align,
290 290
 				'showIgnoredItems'  => lasso_editor_get_option('show_ignored_items', 'lasso_editor'),
291 291
 				'restapi2'          => $using_restapiv2,
292 292
 				'saveusingrest'     => $using_restapiv2 && !$disableRESTSave,
293
-				'newObjectContent'  => '<p>'.apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso') ).'</p>',
293
+				'newObjectContent'  => '<p>'.apply_filters('lasso_new_object_content', __('Once upon a time...', 'lasso')).'</p>',
294 294
 				'disableSavePost'   => $save_to_post_disabled,
295 295
 				'disableEditPost'   => $edit_post_disabled,
296 296
 				'boldTag'           => $bold_tag,
297 297
 				'iTag'           	=> $i_tag,
298 298
 				'customFields'      => $custom_fields,
299
-				'clickToInsert'     => ($insert_comp_ui =='click'),
300
-				'buttonOnEmptyP'     => ($insert_comp_ui =='mediumcom'),      // auto show a button to insert components on an empty paragraph      
299
+				'clickToInsert'     => ($insert_comp_ui == 'click'),
300
+				'buttonOnEmptyP'     => ($insert_comp_ui == 'mediumcom'), // auto show a button to insert components on an empty paragraph      
301 301
                 'rtl'               => is_rtl(),				
302
-				'skipToEdit'        =>( $delta < 10 && $delta >=0 ), // if it's a new post, skip to edit mode
302
+				'skipToEdit'        =>($delta < 10 && $delta >= 0), // if it's a new post, skip to edit mode
303 303
 				'linksEditable'    => $links_editable,
304 304
 				'supportPendingStatus' => !$no_pending_status,
305
-				'tableCode' => apply_filters( 'lasso_table_html_code','<table><tr><th>Cell 1</th><th>Cell 2</th></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table><p></p>'),
306
-                'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) || self::gutenberg_active(),//,
305
+				'tableCode' => apply_filters('lasso_table_html_code', '<table><tr><th>Cell 1</th><th>Cell 2</th></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table><p></p>'),
306
+                'hasGutenberg' => (function_exists('has_blocks') && has_blocks($post->post_content)) || self::gutenberg_active(), //,
307 307
                 'multipages'=> $multipage,
308 308
                 'post_content'=>$post_content,
309 309
                 'post_excerpt'=>$post_excerpt,
310
-                'oldWPimg'=> $use_old_wpimg =='on',
310
+                'oldWPimg'=> $use_old_wpimg == 'on',
311 311
                 'useWPImgBlk'=> $use_wpimgblock,
312
-                'prefixHTTP'=> $link_prefix_http =='on'
312
+                'prefixHTTP'=> $link_prefix_http == 'on'
313 313
 			);
314 314
 
315 315
 
@@ -318,9 +318,9 @@  discard block
 block discarded – undo
318 318
 			
319 319
 			if (!$using_restapiv2) {
320 320
                // enqueue REST API V1
321
-			   wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
322
-			   $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) );
323
-			   wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings );
321
+			   wp_enqueue_script('wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true);
322
+			   $settings = array('root' => home_url($home_url), 'nonce' => wp_create_nonce('wp_json'));
323
+			   wp_localize_script('wp-api-js', 'WP_API_Settings', $settings);
324 324
 			}
325 325
 			
326 326
 			if ($allow_change_date) {
@@ -329,13 +329,13 @@  discard block
 block discarded – undo
329 329
 				wp_enqueue_style('jquery-ui');
330 330
 			}
331 331
 
332
-			$postfix = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? '' : '.min';
332
+			$postfix = (defined('SCRIPT_DEBUG') && true === SCRIPT_DEBUG) ? '' : '.min';
333 333
 			if ($show_color) {
334
-				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true);
334
+				wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api', 'iris'), LASSO_VERSION, true);
335 335
 			} else {
336
-			    wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
336
+			    wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
337 337
 			}
338
-			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) );
338
+			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects));
339 339
 
340 340
 
341 341
 		}
@@ -345,20 +345,20 @@  discard block
 block discarded – undo
345 345
     function gutenberg_active() {
346 346
         
347 347
         // Gutenberg plugin is installed and activated.
348
-        $gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) );
348
+        $gutenberg = !(false === has_filter('replace_editor', 'gutenberg_init'));
349 349
 
350 350
         // Block editor since 5.0.
351
-        $block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' );
351
+        $block_editor = version_compare($GLOBALS['wp_version'], '5.0-beta', '>');
352 352
 
353
-        if ( ! $gutenberg && ! $block_editor ) {
353
+        if (!$gutenberg && !$block_editor) {
354 354
             return false;
355 355
         }
356 356
 
357
-        if ( self::is_classic_editor_plugin_active() ) {
358
-            $editor_option       = get_option( 'classic-editor-replace' );
359
-            $block_editor_active = array( 'no-replace', 'block' );
357
+        if (self::is_classic_editor_plugin_active()) {
358
+            $editor_option       = get_option('classic-editor-replace');
359
+            $block_editor_active = array('no-replace', 'block');
360 360
 
361
-            return in_array( $editor_option, $block_editor_active, true );
361
+            return in_array($editor_option, $block_editor_active, true);
362 362
         }
363 363
 
364 364
         return true;
@@ -370,11 +370,11 @@  discard block
 block discarded – undo
370 370
      * @return bool
371 371
      */
372 372
     function is_classic_editor_plugin_active() {
373
-        if ( ! function_exists( 'is_plugin_active' ) ) {
374
-            include_once ABSPATH . 'wp-admin/includes/plugin.php';
373
+        if (!function_exists('is_plugin_active')) {
374
+            include_once ABSPATH.'wp-admin/includes/plugin.php';
375 375
         }
376 376
 
377
-        if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) {
377
+        if (is_plugin_active('classic-editor/classic-editor.php')) {
378 378
             return true;
379 379
         }
380 380
 
Please login to merge, or discard this patch.
public/includes/components.php 3 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -236,16 +236,16 @@  discard block
 block discarded – undo
236 236
 if ( !function_exists('lasso_wp_image') ):
237 237
 
238 238
 	function lasso_wp_image(){
239
-        $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
240
-        $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
241
-        if ($use_wp_block_image == 'on') {
242
-        	return '<figure class="wp-block-image size-large" data-component-type="wpimg-block"><img  src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>';
243
-        }
244
-        else if ($use_old_wpimg != 'on') {
245
-        	return '<figure data-component-type="wpimg" class="lasso--wpimg__wrap lasso-component"><img  src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>';
246
-        } else {
247
-            return '<figure data-component-type="wpimg" data-linkoption="img" class="lasso--wpimg__wrap lasso-component"><img  src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>';
248
-        }
239
+		$use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
240
+		$use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
241
+		if ($use_wp_block_image == 'on') {
242
+			return '<figure class="wp-block-image size-large" data-component-type="wpimg-block"><img  src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>';
243
+		}
244
+		else if ($use_old_wpimg != 'on') {
245
+			return '<figure data-component-type="wpimg" class="lasso--wpimg__wrap lasso-component"><img  src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>';
246
+		} else {
247
+			return '<figure data-component-type="wpimg" data-linkoption="img" class="lasso--wpimg__wrap lasso-component"><img  src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>';
248
+		}
249 249
 	}
250 250
 
251 251
 endif;
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 
288 288
 if ( !function_exists('lasso_wp_image_block') ):
289 289
 	function lasso_wp_image_block(){
290
-        return '<figure class="wp-block-image size-large" data-component-type="wpimg-block"><img  src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>';
290
+		return '<figure class="wp-block-image size-large" data-component-type="wpimg-block"><img  src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>';
291 291
 	}
292 292
 
293 293
 endif;
Please login to merge, or discard this patch.
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -16,84 +16,84 @@  discard block
 block discarded – undo
16 16
 
17 17
 	$array = array(
18 18
 		'quote' => array(
19
-			'name'    => __('Quote','lasso'),
19
+			'name'    => __('Quote', 'lasso'),
20 20
 			'content' => lasso_quote_component(),
21 21
 		),
22 22
 		'image' => array(
23
-			'name'    => __('Image','lasso'),
23
+			'name'    => __('Image', 'lasso'),
24 24
 			'content' => lasso_image_component(),
25 25
 		),
26 26
 		'parallax' => array(
27
-			'name'    => __('Parallax','lasso'),
27
+			'name'    => __('Parallax', 'lasso'),
28 28
 			'content' => lasso_parallax_component(),
29 29
 		),
30 30
 		'audio' => array(
31
-			'name'    => __('Audio','lasso'),
31
+			'name'    => __('Audio', 'lasso'),
32 32
 			'content' => lasso_audio_component(),
33 33
 		),
34 34
 		'content' => array(
35
-			'name'    => __('Content','lasso'),
35
+			'name'    => __('Content', 'lasso'),
36 36
 			'content' => lasso_content_component(),
37 37
 		),
38 38
 		'character' => array(
39
-			'name'    => __('Character','lasso'),
39
+			'name'    => __('Character', 'lasso'),
40 40
 			'content' => lasso_character_component(),
41 41
 		),
42 42
 		'collection' => array(
43
-			'name'    => __('Collection','lasso'),
43
+			'name'    => __('Collection', 'lasso'),
44 44
 			'content' => lasso_collections_component(),
45 45
 		),
46 46
 		'document' => array(
47
-			'name'    => __('Document','lasso'),
47
+			'name'    => __('Document', 'lasso'),
48 48
 			'content' => lasso_document_component(),
49 49
 		),
50 50
 		'gallery' => array(
51
-			'name'    => __('Gallery','lasso'),
51
+			'name'    => __('Gallery', 'lasso'),
52 52
 			'content' => lasso_gallery_component(),
53 53
 		),
54 54
 		'chapter' => array(
55
-			'name'    => __('Chapter','lasso'),
55
+			'name'    => __('Chapter', 'lasso'),
56 56
 			'content' => lasso_heading_component(),
57 57
 		),
58 58
 		'map' => array(
59
-			'name'    => __('Map','lasso'),
59
+			'name'    => __('Map', 'lasso'),
60 60
 			'content' => lasso_map_component(),
61 61
 		),
62 62
 		'timeline_stop' => array(
63
-			'name'    => __('Timeline','lasso'),
63
+			'name'    => __('Timeline', 'lasso'),
64 64
 			'content' => lasso_timeline_component(),
65 65
 		),
66 66
 		'video' => array(
67
-			'name'    => __('Video','lasso'),
67
+			'name'    => __('Video', 'lasso'),
68 68
 			'content' => lasso_video_component(),
69 69
 		),
70 70
 		'wpimg' => array(
71
-			'name'    => __('WordPress Image','lasso'),
71
+			'name'    => __('WordPress Image', 'lasso'),
72 72
 			'content' => lasso_wp_image(),
73 73
 		),
74 74
 		'wpimg-block' => array(
75
-			'name'    => __('WordPress Image Block','lasso'),
75
+			'name'    => __('WordPress Image Block', 'lasso'),
76 76
 			'content' => lasso_wp_image_block(),
77 77
 		),
78 78
 		'wpquote' => array(
79
-			'name'    => __('WordPress Quote','lasso'),
79
+			'name'    => __('WordPress Quote', 'lasso'),
80 80
 			'content' => lasso_wp_quote(),
81 81
 		),
82 82
 		'gallery_pop' => array(
83
-			'name'    => __('Gallery Pop','lasso'),
83
+			'name'    => __('Gallery Pop', 'lasso'),
84 84
 			'content' => lasso_gallery_pop_component(),
85 85
 		),
86 86
 		'events' => array(
87
-			'name'    => __('Events','lasso'),
87
+			'name'    => __('Events', 'lasso'),
88 88
 			'content' => lasso_event_component(),
89 89
 		),
90 90
 		'wpvideo' => array(
91
-			'name'    => __('WordPress Image','lasso'),
91
+			'name'    => __('WordPress Image', 'lasso'),
92 92
 			'content' => lasso_wp_video(),
93 93
 		),
94 94
 	);
95 95
 
96
-	return apply_filters( 'lasso_components', $array );
96
+	return apply_filters('lasso_components', $array);
97 97
 }
98 98
 
99 99
 /**
@@ -119,125 +119,125 @@  discard block
 block discarded – undo
119 119
  */
120 120
 
121 121
 // 1
122
-if ( !function_exists( 'lasso_quote_component' ) ):
122
+if (!function_exists('lasso_quote_component')):
123 123
 	function lasso_quote_component() {
124 124
 
125
-		return do_shortcode( '[aesop_quote quote="The Universe is made of stories, not of atoms."]' );
125
+		return do_shortcode('[aesop_quote quote="The Universe is made of stories, not of atoms."]');
126 126
 	}
127 127
 endif;
128 128
 
129 129
 // 2
130
-if ( !function_exists( 'lasso_image_component' ) ):
130
+if (!function_exists('lasso_image_component')):
131 131
 	function lasso_image_component() {
132 132
 
133
-		return do_shortcode( '[aesop_image img="'.LASSO_URL.'/public/assets/img/empty-img.png" align="center" imgwidth="100%"]' );
133
+		return do_shortcode('[aesop_image img="'.LASSO_URL.'/public/assets/img/empty-img.png" align="center" imgwidth="100%"]');
134 134
 	}
135 135
 endif;
136 136
 
137 137
 // 3
138
-if ( !function_exists( 'lasso_parallax_component' ) ):
138
+if (!function_exists('lasso_parallax_component')):
139 139
 	function lasso_parallax_component() {
140 140
 
141
-		return do_shortcode( '[aesop_parallax img="'.LASSO_URL.'/public/assets/img/empty-img.png"]' );
141
+		return do_shortcode('[aesop_parallax img="'.LASSO_URL.'/public/assets/img/empty-img.png"]');
142 142
 	}
143 143
 endif;
144 144
 
145 145
 // 4
146
-if ( !function_exists( 'lasso_audio_component' ) ):
146
+if (!function_exists('lasso_audio_component')):
147 147
 	function lasso_audio_component() {
148 148
 
149
-		return do_shortcode( '[aesop_audio src="http://users.skynet.be/fa046054/home/P22/track06.mp3"]' );
149
+		return do_shortcode('[aesop_audio src="http://users.skynet.be/fa046054/home/P22/track06.mp3"]');
150 150
 
151 151
 	}
152 152
 endif;
153 153
 
154 154
 // 5
155
-if ( !function_exists( 'lasso_content_component' ) ):
155
+if (!function_exists('lasso_content_component')):
156 156
 	function lasso_content_component() {
157 157
 
158
-		return do_shortcode( '[aesop_content]Start typing here...[/aesop_content]' );
158
+		return do_shortcode('[aesop_content]Start typing here...[/aesop_content]');
159 159
 	}
160 160
 endif;
161 161
 
162 162
 // 6
163
-if ( !function_exists( 'lasso_character_component' ) ):
163
+if (!function_exists('lasso_character_component')):
164 164
 	function lasso_character_component() {
165 165
 
166
-		return do_shortcode( '[aesop_character img="'.LASSO_URL.'/public/assets/img/empty-img.png" name="Joes Apartment" width="150px"]' );
166
+		return do_shortcode('[aesop_character img="'.LASSO_URL.'/public/assets/img/empty-img.png" name="Joes Apartment" width="150px"]');
167 167
 
168 168
 	}
169 169
 endif;
170 170
 
171 171
 // 7
172
-if ( !function_exists( 'lasso_collections_component' ) ):
172
+if (!function_exists('lasso_collections_component')):
173 173
 	function lasso_collections_component() {
174 174
 
175
-		return do_shortcode( '[aesop_collection]' );
175
+		return do_shortcode('[aesop_collection]');
176 176
 	}
177 177
 endif;
178 178
 
179 179
 // 8
180
-if ( !function_exists( 'lasso_document_component' ) ):
180
+if (!function_exists('lasso_document_component')):
181 181
 	function lasso_document_component() {
182 182
 
183
-		return do_shortcode( '[aesop_document src="'.LASSO_URL.'/public/assets/img/empty-img.png" ]' );
183
+		return do_shortcode('[aesop_document src="'.LASSO_URL.'/public/assets/img/empty-img.png" ]');
184 184
 
185 185
 	}
186 186
 endif;
187 187
 
188 188
 // 9
189
-if ( !function_exists( 'lasso_gallery_component' ) ):
189
+if (!function_exists('lasso_gallery_component')):
190 190
 	function lasso_gallery_component() {
191 191
 
192
-		return do_shortcode( '[aesop_gallery]' );
192
+		return do_shortcode('[aesop_gallery]');
193 193
 
194 194
 	}
195 195
 endif;
196 196
 
197 197
 // 10
198
-if ( !function_exists( 'lasso_heading_component' ) ):
198
+if (!function_exists('lasso_heading_component')):
199 199
 	function lasso_heading_component() {
200 200
 
201
-		return do_shortcode( '[aesop_chapter title="Chapter One" img="'.LASSO_URL.'/public/assets/img/empty-img.png" full="on"]' );
201
+		return do_shortcode('[aesop_chapter title="Chapter One" img="'.LASSO_URL.'/public/assets/img/empty-img.png" full="on"]');
202 202
 	}
203 203
 endif;
204 204
 
205 205
 // 11
206
-if ( !function_exists( 'lasso_map_component' ) ):
206
+if (!function_exists('lasso_map_component')):
207 207
 	function lasso_map_component() {
208 208
 
209 209
 		return '<form id="lasso--map-form" class="aesop-component aesop-map-component lasso--map-drag-holder" enctype="multipart/form-data">
210 210
 				'.lasso_map_form_footer().'
211
-				'.do_shortcode( '[aesop_map sticky="off"]' ).'
211
+				'.do_shortcode('[aesop_map sticky="off"]').'
212 212
 			</form>';
213 213
 
214 214
 	}
215 215
 endif;
216 216
 
217 217
 // 12
218
-if ( !function_exists( 'lasso_timeline_component' ) ):
218
+if (!function_exists('lasso_timeline_component')):
219 219
 	function lasso_timeline_component() {
220 220
 
221
-		return do_shortcode( '[aesop_timeline_stop num="Title" title="2014"]' );
221
+		return do_shortcode('[aesop_timeline_stop num="Title" title="2014"]');
222 222
 
223 223
 	}
224 224
 endif;
225 225
 
226 226
 // 13
227
-if ( !function_exists( 'lasso_video_component' ) ):
227
+if (!function_exists('lasso_video_component')):
228 228
 	function lasso_video_component() {
229 229
 
230
-		return do_shortcode( '[aesop_video src="vimeo" id="59940289" width="100%" align="center"]' );
230
+		return do_shortcode('[aesop_video src="vimeo" id="59940289" width="100%" align="center"]');
231 231
 
232 232
 	}
233 233
 endif;
234 234
 
235 235
 // 14 - since 0.9.1
236
-if ( !function_exists('lasso_wp_image') ):
236
+if (!function_exists('lasso_wp_image')):
237 237
 
238
-	function lasso_wp_image(){
239
-        $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
240
-        $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
238
+	function lasso_wp_image() {
239
+        $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor', 'off');
240
+        $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor', 'off');
241 241
         if ($use_wp_block_image == 'on') {
242 242
         	return '<figure class="wp-block-image size-large" data-component-type="wpimg-block"><img  src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>';
243 243
         }
@@ -251,9 +251,9 @@  discard block
 block discarded – undo
251 251
 endif;
252 252
 
253 253
 // 15 - since 0.9.2
254
-if ( !function_exists('lasso_wp_quote') ):
254
+if (!function_exists('lasso_wp_quote')):
255 255
 
256
-	function lasso_wp_quote(){
256
+	function lasso_wp_quote() {
257 257
 		return '<blockquote data-component-type="wpquote" class="lasso--wpquote lasso-component"><p>The universe is made of stories.</p></blockquote><p><br></p>';
258 258
 	}
259 259
 
@@ -261,15 +261,15 @@  discard block
 block discarded – undo
261 261
 
262 262
 // 16 gallery pop added but not fully supported as of 0.9.9.11 
263 263
 
264
-if ( !function_exists( 'lasso_gallery_pop_component' ) ):
264
+if (!function_exists('lasso_gallery_pop_component')):
265 265
 	function lasso_gallery_pop_component() {
266
-		return do_shortcode( '[aesop_gallery_pop]' );
266
+		return do_shortcode('[aesop_gallery_pop]');
267 267
 	}
268 268
 endif;
269 269
 
270 270
 // 17 - work in progress
271 271
 
272
-if ( !function_exists( 'lasso_event_component' ) ):
272
+if (!function_exists('lasso_event_component')):
273 273
 	function lasso_event_component() {
274 274
 		$id = editus_get_one_id('aesop_events');
275 275
 		return '<div data-component-type="events" class="aesop-component lasso-component"><p>Aesop Event: After setting the event, save and reload the page.</p></div>';
@@ -277,16 +277,16 @@  discard block
 block discarded – undo
277 277
 endif;
278 278
 
279 279
 // 18 - work in progress
280
-if ( !function_exists('lasso_wp_video') ):
280
+if (!function_exists('lasso_wp_video')):
281 281
 
282
-	function lasso_wp_video(){
282
+	function lasso_wp_video() {
283 283
 		return '<div data-component-type="wpvideo" class="lasso--wpvideo__wrap lasso-component"><video class="wp-video-0"></video>';
284 284
 	}
285 285
 
286 286
 endif;
287 287
 
288
-if ( !function_exists('lasso_wp_image_block') ):
289
-	function lasso_wp_image_block(){
288
+if (!function_exists('lasso_wp_image_block')):
289
+	function lasso_wp_image_block() {
290 290
         return '<figure class="wp-block-image size-large" data-component-type="wpimg-block"><img  src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>';
291 291
 	}
292 292
 
@@ -295,10 +295,10 @@  discard block
 block discarded – undo
295 295
 // helper function to retrieve one id for default option
296 296
 function editus_get_one_id($type)
297 297
 {
298
-	$args = array( 'posts_per_page' => 1, 'post_type' => $type );
299
-	$posts = get_posts( $args );
300
-	if ( $posts ) {
301
-		foreach ( $posts as $post ) {
298
+	$args = array('posts_per_page' => 1, 'post_type' => $type);
299
+	$posts = get_posts($args);
300
+	if ($posts) {
301
+		foreach ($posts as $post) {
302 302
 			return $post->ID;
303 303
 		}
304 304
 	}
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -240,8 +240,7 @@
 block discarded – undo
240 240
         $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
241 241
         if ($use_wp_block_image == 'on') {
242 242
         	return '<figure class="wp-block-image size-large" data-component-type="wpimg-block"><img  src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>';
243
-        }
244
-        else if ($use_old_wpimg != 'on') {
243
+        } else if ($use_old_wpimg != 'on') {
245 244
         	return '<figure data-component-type="wpimg" class="lasso--wpimg__wrap lasso-component"><img  src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>';
246 245
         } else {
247 246
             return '<figure data-component-type="wpimg" data-linkoption="img" class="lasso--wpimg__wrap lasso-component"><img  src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>';
Please login to merge, or discard this patch.