Completed
Push — master ( 87ad6f...c07007 )
by
unknown
40s
created
admin/includes/menus/settings.php 1 patch
Spacing   +192 added lines, -192 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,49 +95,49 @@  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' );
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 117
 		
118 118
 		$disable_shortcode_editing = lasso_editor_get_option('disable_shortcode_editing', 'lasso_editor');
119 119
 
120
-		$use_old_ui      = lasso_editor_get_option( 'use_old_ui', 'lasso_editor' );
121
-		$toolbar_headings      = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' );
122
-		$toolbar_headings_h4      = lasso_editor_get_option( 'toolbar_headings_h4', 'lasso_editor' );
123
-		$toolbar_list      = lasso_editor_get_option( 'toolbar_list', 'lasso_editor' );
124
-		$toolbar_show_color      = lasso_editor_get_option( 'toolbar_show_color', 'lasso_editor' );
125
-		$toolbar_show_alignment  = lasso_editor_get_option( 'toolbar_show_alignment', 'lasso_editor' );
120
+		$use_old_ui = lasso_editor_get_option('use_old_ui', 'lasso_editor');
121
+		$toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor');
122
+		$toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
123
+		$toolbar_list = lasso_editor_get_option('toolbar_list', 'lasso_editor');
124
+		$toolbar_show_color      = lasso_editor_get_option('toolbar_show_color', 'lasso_editor');
125
+		$toolbar_show_alignment  = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor');
126 126
         
127 127
         $text_select_popup = lasso_editor_get_option('text_select_popup', 'lasso_editor', false);
128 128
 		
129
-		$objectsNoSave  	= lasso_editor_get_option('dont_save', 'lasso_editor');
130
-		$objectsNonEditable  	= lasso_editor_get_option('non_editable', 'lasso_editor');
129
+		$objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor');
130
+		$objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor');
131 131
 		$disable_tour = lasso_editor_get_option('disable_tour', 'lasso_editor');
132 132
 		$show_ignored_items = lasso_editor_get_option('show_ignored_items', 'lasso_editor');
133 133
 		$save_using_rest_disabled = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor');
134 134
 		
135
-		$default_post_types = apply_filters( 'lasso_allowed_post_types', array( 'post', 'page'));
136
-		$allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor',  $default_post_types);
135
+		$default_post_types = apply_filters('lasso_allowed_post_types', array('post', 'page'));
136
+		$allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', $default_post_types);
137 137
 		
138 138
 		$links_editable = lasso_editor_get_option('links_editable', 'lasso_editor', false);
139
-		$bold_tag = lasso_editor_get_option( 'bold_tag', 'lasso_editor',  "b");
140
-		$i_tag = lasso_editor_get_option( 'i_tag', 'lasso_editor',  "i");
139
+		$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor', "b");
140
+		$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor', "i");
141 141
         
142 142
         $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
143 143
         $add_paragraph = lasso_editor_get_option('add_paragraph', 'lasso_editor', false);
@@ -154,43 +154,43 @@  discard block
 block discarded – undo
154 154
         
155 155
         $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor');
156 156
         
157
-        $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
158
-        $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
157
+        $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor', 'off');
158
+        $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor', 'off');
159 159
 		
160
-		$support_custom_taxonomy   = lasso_editor_get_option( 'support_custom_taxonomy', 'lasso_editor' );
160
+		$support_custom_taxonomy = lasso_editor_get_option('support_custom_taxonomy', 'lasso_editor');
161 161
         
162
-        $new_post_text    = lasso_editor_get_option( 'new_post_text', 'lasso_editor' );
162
+        $new_post_text = lasso_editor_get_option('new_post_text', 'lasso_editor');
163 163
         
164
-        $no_wrap_shortcode    = lasso_editor_get_option( 'no_wrap_shortcode', 'lasso_editor');
164
+        $no_wrap_shortcode = lasso_editor_get_option('no_wrap_shortcode', 'lasso_editor');
165 165
 
166 166
 ?>
167 167
 		<div class="wrap">
168 168
         
169
-	    	<h2><?php _e( 'Editus Settings', 'lasso' );?></h2>
169
+	    	<h2><?php _e('Editus Settings', 'lasso'); ?></h2>
170 170
             
171 171
 			<form id="lasso-editor-settings-form" class="lasso--form-settings" method="post" enctype="multipart/form-data">
172 172
 
173
-				<?php do_action('lasso_settings_before');?>
173
+				<?php do_action('lasso_settings_before'); ?>
174 174
 				
175 175
 				
176 176
 				
177
-				<h3><?php _e( 'Enable for:', 'lasso' );?></h3>
177
+				<h3><?php _e('Enable for:', 'lasso'); ?></h3>
178 178
 				<div class="lasso-editor-settings--option-wrap">
179 179
 					<div class="lasso-editor-settings--option-inner">
180 180
 						
181
-						<span class="lasso--setting-description"><?php _e( 'Enable Editus for the following post types.', 'lasso' );?></span>
181
+						<span class="lasso--setting-description"><?php _e('Enable Editus for the following post types.', 'lasso'); ?></span>
182 182
 						<?php
183 183
 						$args = array(
184 184
 							'public'   => true
185 185
 						);
186 186
 						 
187
-						$allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
188
-						$post_types = get_post_types( $args, 'objects' );
187
+						$allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types);
188
+						$post_types = get_post_types($args, 'objects');
189 189
 						 
190
-						foreach ( $post_types  as $post_type ) {
190
+						foreach ($post_types  as $post_type) {
191 191
 						   if ($post_type->name == 'attachment') continue;
192
-						   $checked ="";
193
-						   if (  in_array( $post_type->name, $allowed_post_types )  ) {
192
+						   $checked = "";
193
+						   if (in_array($post_type->name, $allowed_post_types)) {
194 194
 								$checked = 'checked="checked"';
195 195
 						   }
196 196
 						   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>';
@@ -200,140 +200,140 @@  discard block
 block discarded – undo
200 200
 				</div>
201 201
 				
202 202
 
203
-				<h3><?php _e( 'Internal Settings', 'lasso' );?></h3>
203
+				<h3><?php _e('Internal Settings', 'lasso'); ?></h3>
204 204
 				<div class="lasso-editor-settings--option-wrap">
205 205
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
206
-						<label><?php _e( 'Article Class', 'lasso' );?></label>
207
-						<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>
208
-						<input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr( $article_object );?>" placeholder=".entry-content">
206
+						<label><?php _e('Article Class', 'lasso'); ?></label>
207
+						<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>
208
+						<input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr($article_object); ?>" placeholder=".entry-content">
209 209
 					</div>
210 210
 				
211 211
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
212
-						<label><?php _e( 'Featured Image Class', 'lasso' );?></label>
213
-						<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>
214
-						<input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr( $featImgClass );?>" placeholder=".entry-content">
212
+						<label><?php _e('Featured Image Class', 'lasso'); ?></label>
213
+						<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>
214
+						<input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr($featImgClass); ?>" placeholder=".entry-content">
215 215
 					</div>
216 216
 				
217 217
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
218
-						<label><?php _e( 'Article Title Class', 'lasso' );?></label>
219
-						<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>
220
-						<input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr( $titleClass );?>" placeholder=".entry-content">
218
+						<label><?php _e('Article Title Class', 'lasso'); ?></label>
219
+						<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>
220
+						<input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr($titleClass); ?>" placeholder=".entry-content">
221 221
 					</div>
222 222
 				
223 223
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
224
-						<label><?php _e( 'Ignored Items to Save', 'lasso' );?></label>
225
-						<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>
226
-						<textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNoSave );?></textarea>
224
+						<label><?php _e('Ignored Items to Save', 'lasso'); ?></label>
225
+						<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>
226
+						<textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr($objectsNoSave); ?></textarea>
227 227
 					</div>
228 228
 				
229 229
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
230
-						<label><?php _e( 'Read Only Items', 'lasso' );?></label>
231
-						<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>
232
-						<textarea name="lasso_editor[non_editable]" id="lasso_editor[non_editable]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNonEditable );?></textarea>
230
+						<label><?php _e('Read Only Items', 'lasso'); ?></label>
231
+						<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>
232
+						<textarea name="lasso_editor[non_editable]" id="lasso_editor[non_editable]" placeholder=".classname, .another-class"><?php echo esc_attr($objectsNonEditable); ?></textarea>
233 233
 					</div>
234 234
 				
235 235
 					<div class="lasso-editor-settings--option-inner" >
236
-						<input type="checkbox" class="checkbox" name="lasso_editor[show_ignored_items]" id="lasso_editor[show_ignored_items]" <?php echo checked( $show_ignored_items, 'on' );?> >
237
-						<label for="lasso_editor[show_ignored_items]"> <?php _e( 'Show Ignored Items', 'lasso' );?></label>
238
-						<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>
236
+						<input type="checkbox" class="checkbox" name="lasso_editor[show_ignored_items]" id="lasso_editor[show_ignored_items]" <?php echo checked($show_ignored_items, 'on'); ?> >
237
+						<label for="lasso_editor[show_ignored_items]"> <?php _e('Show Ignored Items', 'lasso'); ?></label>
238
+						<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>
239 239
 					</div>
240 240
 				</div>
241 241
 
242
-				<h3><?php _e( 'Editor UI', 'lasso' );?></h3>
242
+				<h3><?php _e('Editor UI', 'lasso'); ?></h3>
243 243
 				<div class="lasso-editor-settings--option-wrap">
244 244
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
245
-						<input type="checkbox" class="checkbox" name="lasso_editor[use_old_ui]" id="lasso_editor_use_old_ui" <?php echo checked( $use_old_ui, 'on' );?> >
246
-						<label for="lasso_editor[use_old_ui]"><?php _e( 'Use the Old Toolbar', 'lasso' );?></label>
247
-						<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>
245
+						<input type="checkbox" class="checkbox" name="lasso_editor[use_old_ui]" id="lasso_editor_use_old_ui" <?php echo checked($use_old_ui, 'on'); ?> >
246
+						<label for="lasso_editor[use_old_ui]"><?php _e('Use the Old Toolbar', 'lasso'); ?></label>
247
+						<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>
248 248
 					</div>
249 249
 				    <div id="lasso-editor-settings--colors">
250 250
 					<?php
251
-					self::create_section_for_color_picker('button-color1', _e( 'Editor Bar Color Top', 'lasso' ), '#0000ff');
252
-					self::create_section_for_color_picker('button-color2', _e( 'Editor Bar Color Bottom', 'lasso' ), '#000030');
253
-					self::create_section_for_color_picker('dialog-color', _e( 'Dialog Color', 'lasso' ), '#000055');
254
-					self::create_section_for_color_picker('text-color', _e( 'Icon/Text Color', 'lasso' ), '#ffffff');
251
+					self::create_section_for_color_picker('button-color1', _e('Editor Bar Color Top', 'lasso'), '#0000ff');
252
+					self::create_section_for_color_picker('button-color2', _e('Editor Bar Color Bottom', 'lasso'), '#000030');
253
+					self::create_section_for_color_picker('dialog-color', _e('Dialog Color', 'lasso'), '#000055');
254
+					self::create_section_for_color_picker('text-color', _e('Icon/Text Color', 'lasso'), '#ffffff');
255 255
 					?>
256
-					<button type="button" id="lasso-editor-settings--default-colors" ><?php _e( 'Default Colors', 'lasso' );?></button>
256
+					<button type="button" id="lasso-editor-settings--default-colors" ><?php _e('Default Colors', 'lasso'); ?></button>
257 257
 				    <div style="height:50px;"></div>
258 258
 					</div>
259 259
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
260
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked( $toolbar_headings, 'on' );?> >
261
-						<label for="lasso_editor[toolbar_headings]"><?php _e( 'Enable H2 and H3 Buttons', 'lasso' );?></label>
262
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set H2 and H3 settings.', 'lasso' );?></span>
260
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked($toolbar_headings, 'on'); ?> >
261
+						<label for="lasso_editor[toolbar_headings]"><?php _e('Enable H2 and H3 Buttons', 'lasso'); ?></label>
262
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set H2 and H3 settings.', 'lasso'); ?></span>
263 263
 
264 264
 					</div>
265 265
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
266
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings_h4]" id="lasso_editor[toolbar_headings_h4]" <?php echo checked( $toolbar_headings_h4, 'on' );?> >
267
-						<label for="lasso_editor[toolbar_headings_h4]"><?php _e( 'Enable H4/H5/H6 Buttons', 'lasso' );?></label>
268
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set H4/H5/H6 settings.', 'lasso' );?></span>
266
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings_h4]" id="lasso_editor[toolbar_headings_h4]" <?php echo checked($toolbar_headings_h4, 'on'); ?> >
267
+						<label for="lasso_editor[toolbar_headings_h4]"><?php _e('Enable H4/H5/H6 Buttons', 'lasso'); ?></label>
268
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set H4/H5/H6 settings.', 'lasso'); ?></span>
269 269
 
270 270
 					</div>
271 271
 					
272 272
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
273
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_list]" id="lasso_editor[toolbar_list]" <?php echo checked( $toolbar_list, 'on' );?> >
274
-						<label for="lasso_editor[toolbar_list]"><?php _e( 'Enable OL/UL Buttons', 'lasso' );?></label>
275
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to create Ordered and Unordered Lists from text selection.', 'lasso' );?></span>
273
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_list]" id="lasso_editor[toolbar_list]" <?php echo checked($toolbar_list, 'on'); ?> >
274
+						<label for="lasso_editor[toolbar_list]"><?php _e('Enable OL/UL Buttons', 'lasso'); ?></label>
275
+						<span class="lasso--setting-description"><?php _e('Show the buttons to create Ordered and Unordered Lists from text selection.', 'lasso'); ?></span>
276 276
 					</div>
277 277
 					
278 278
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
279
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_color]" id="lasso_editor[toolbar_show_color]" <?php echo checked( $toolbar_show_color, 'on' );?> >
280
-						<label for="lasso_editor[toolbar_show_color]"><?php _e( 'Enable Text Color Buttons', 'lasso' );?></label>
281
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set text colors.', 'lasso' );?></span>
279
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_color]" id="lasso_editor[toolbar_show_color]" <?php echo checked($toolbar_show_color, 'on'); ?> >
280
+						<label for="lasso_editor[toolbar_show_color]"><?php _e('Enable Text Color Buttons', 'lasso'); ?></label>
281
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set text colors.', 'lasso'); ?></span>
282 282
 
283 283
 					</div>
284 284
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
285
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_alignment]" id="lasso_editor[toolbar_show_alignment]" <?php echo checked( $toolbar_show_alignment, 'on' );?> >
286
-						<label for="lasso_editor[toolbar_show_alignment]"><?php _e( 'Enable Text Align Buttons', 'lasso' );?></label>
287
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set text alignment.', 'lasso' );?></span>
285
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_alignment]" id="lasso_editor[toolbar_show_alignment]" <?php echo checked($toolbar_show_alignment, 'on'); ?> >
286
+						<label for="lasso_editor[toolbar_show_alignment]"><?php _e('Enable Text Align Buttons', 'lasso'); ?></label>
287
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set text alignment.', 'lasso'); ?></span>
288 288
 
289 289
 					</div>
290 290
 					
291 291
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
292
-						<input type="checkbox" class="checkbox" name="lasso_editor[links_editable]" id="lasso_editor[links_editable]" <?php echo checked( $links_editable, 'on' );?> >
293
-						<label for="lasso_editor[links_editable]"><?php _e( 'Make links editable under the Editing Mode', 'lasso' );?></label>
294
-						<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>
292
+						<input type="checkbox" class="checkbox" name="lasso_editor[links_editable]" id="lasso_editor[links_editable]" <?php echo checked($links_editable, 'on'); ?> >
293
+						<label for="lasso_editor[links_editable]"><?php _e('Make links editable under the Editing Mode', 'lasso'); ?></label>
294
+						<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>
295 295
 
296 296
 					</div>
297 297
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
298
-					    <label for="lasso_editor[insert_comp_ui]"> <?php _e( 'Insert Component UI', 'lasso' );?></label>
299
-						<span class="lasso--setting-description"><?php _e( 'UI mechanism to insert components', 'lasso' );?></span>
298
+					    <label for="lasso_editor[insert_comp_ui]"> <?php _e('Insert Component UI', 'lasso'); ?></label>
299
+						<span class="lasso--setting-description"><?php _e('UI mechanism to insert components', 'lasso'); ?></span>
300 300
 						<div class="lasso-editor-settings--option-inner" style="border:none;">
301
-					       <input type="radio" name="lasso_editor[insert_comp_ui]" value='drag' <?php echo checked( $insert_comp_ui, 'drag' );?>> <?php _e( 'Drag and Drop', 'lasso' );?>
301
+					       <input type="radio" name="lasso_editor[insert_comp_ui]" value='drag' <?php echo checked($insert_comp_ui, 'drag'); ?>> <?php _e('Drag and Drop', 'lasso'); ?>
302 302
 						</div>
303 303
 						<div class="lasso-editor-settings--option-inner" style="border:none;">
304
-						<input type="radio" name="lasso_editor[insert_comp_ui]" value="click" <?php echo checked( $insert_comp_ui, 'click' );?>> <?php _e( 'Click', 'lasso' );?>
304
+						<input type="radio" name="lasso_editor[insert_comp_ui]" value="click" <?php echo checked($insert_comp_ui, 'click'); ?>> <?php _e('Click', 'lasso'); ?>
305 305
 						</div>
306 306
 						<div class="lasso-editor-settings--option-inner" style="border:none;">
307
-						<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' );?>
307
+						<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'); ?>
308 308
 						</div>
309 309
 					</div>
310 310
                     
311 311
                     <div class="lasso-editor-settings--option-inner" >
312
-						<input type="checkbox" class="checkbox" name="lasso_editor[text_select_popup]" id="lasso_editor[text_select_popup]" <?php echo checked( $text_select_popup, 'on' );?> >
313
-						<label for="lasso_editor[text_select_popup]"><?php _e( 'Popup When Text is Selected', 'lasso' );?></label>
314
-						<span class="lasso--setting-description"><?php _e( 'Instead of using the bottom toolbar to format texts, use a popup box to format texts.', 'lasso' );?></span>
312
+						<input type="checkbox" class="checkbox" name="lasso_editor[text_select_popup]" id="lasso_editor[text_select_popup]" <?php echo checked($text_select_popup, 'on'); ?> >
313
+						<label for="lasso_editor[text_select_popup]"><?php _e('Popup When Text is Selected', 'lasso'); ?></label>
314
+						<span class="lasso--setting-description"><?php _e('Instead of using the bottom toolbar to format texts, use a popup box to format texts.', 'lasso'); ?></span>
315 315
 
316 316
 					</div>
317 317
                     
318 318
 				</div>
319 319
 				
320
-				<h3><?php _e( 'Component', 'lasso' );?></h3>
320
+				<h3><?php _e('Component', 'lasso'); ?></h3>
321 321
                 <div class="lasso-editor-settings--option-wrap" style="border:none;" >
322 322
                     <div class="lasso-editor-settings--option-inner" style="border:none">
323
-						<input type="checkbox" class="checkbox" name="lasso_editor[add_table]" id="lasso_editor[add_table]" <?php echo checked( $add_table, 'on' );?> >
324
-						<label for="lasso_editor[add_table]"><span class="dashicons dashicons-grid-view"> </span> <?php _e( 'Additional Component: Table', 'lasso' );?></label>
325
-						<span class="lasso--setting-description"><?php _e( 'Allow user to add and edit tables.', 'lasso' );?></span>
323
+						<input type="checkbox" class="checkbox" name="lasso_editor[add_table]" id="lasso_editor[add_table]" <?php echo checked($add_table, 'on'); ?> >
324
+						<label for="lasso_editor[add_table]"><span class="dashicons dashicons-grid-view"> </span> <?php _e('Additional Component: Table', 'lasso'); ?></label>
325
+						<span class="lasso--setting-description"><?php _e('Allow user to add and edit tables.', 'lasso'); ?></span>
326 326
 
327 327
 					</div>
328 328
                     
329 329
                      <div class="lasso-editor-settings--option-inner" style="border:none">
330
-						<input type="checkbox" class="checkbox" name="lasso_editor[add_paragraph]" id="lasso_editor[add_paragraph]" <?php echo checked( $add_paragraph, 'on' );?> >
331
-						<label for="lasso_editor[add_paragraph]"><span class="dashicons dashicons-editor-paragraph"></span><?php _e( 'Additional Component: Paragraph', 'lasso' );?></label>
332
-						<span class="lasso--setting-description"><?php _e( 'Plain HTML Paragraph.', 'lasso' );?></span>
330
+						<input type="checkbox" class="checkbox" name="lasso_editor[add_paragraph]" id="lasso_editor[add_paragraph]" <?php echo checked($add_paragraph, 'on'); ?> >
331
+						<label for="lasso_editor[add_paragraph]"><span class="dashicons dashicons-editor-paragraph"></span><?php _e('Additional Component: Paragraph', 'lasso'); ?></label>
332
+						<span class="lasso--setting-description"><?php _e('Plain HTML Paragraph.', 'lasso'); ?></span>
333 333
 
334 334
 					</div>
335 335
                 
336
-                <?php if ( 'ase-active' != $ase_status ) { ?>
336
+                <?php if ('ase-active' != $ase_status) { ?>
337 337
                     <script>
338 338
                     $(document).ready(function(){
339 339
                         $("#lasso_editor\\[use_old_wpimg\\]").on('change', function(){                        
@@ -359,156 +359,156 @@  discard block
 block discarded – undo
359 359
                     </script>
360 360
                 
361 361
                     <div class="lasso-editor-settings--option-inner" style="border:none">
362
-						<input type="checkbox" class="checkbox" name="lasso_editor[use_old_wpimg]" id="lasso_editor[use_old_wpimg]" <?php echo checked( $use_old_wpimg, 'on' );?> >
363
-						<label for="lasso_editor[use_old_wpimg]"><?php _e( 'Use Simple Image', 'lasso' );?></label>
364
-						<span class="lasso--setting-description"><?php _e( 'Use Simple Image Component without Extra Options.', 'lasso' );?></span>
362
+						<input type="checkbox" class="checkbox" name="lasso_editor[use_old_wpimg]" id="lasso_editor[use_old_wpimg]" <?php echo checked($use_old_wpimg, 'on'); ?> >
363
+						<label for="lasso_editor[use_old_wpimg]"><?php _e('Use Simple Image', 'lasso'); ?></label>
364
+						<span class="lasso--setting-description"><?php _e('Use Simple Image Component without Extra Options.', 'lasso'); ?></span>
365 365
 
366 366
 					</div>
367 367
                 
368 368
                 
369 369
                     <div class="lasso-editor-settings--option-inner">
370
-						<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' );?> >
371
-						<label for="lasso_editor[use_wp_block_image]"><?php _e( 'Use WP Image Block', 'lasso' );?></label>
372
-						<span class="lasso--setting-description"><?php _e( 'Use WP Image Block as the image component. Gutenberg Block Editor needs to be enabled.', 'lasso' );?></span>
370
+						<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'); ?> >
371
+						<label for="lasso_editor[use_wp_block_image]"><?php _e('Use WP Image Block', 'lasso'); ?></label>
372
+						<span class="lasso--setting-description"><?php _e('Use WP Image Block as the image component. Gutenberg Block Editor needs to be enabled.', 'lasso'); ?></span>
373 373
 
374 374
 					</div>
375 375
                 <?php }?>
376 376
                 </div>
377 377
 				
378 378
 
379
-				<h3><?php _e( 'Post Settings UI', 'lasso' );?></h3>
379
+				<h3><?php _e('Post Settings UI', 'lasso'); ?></h3>
380 380
 				<div class="lasso-editor-settings--option-wrap"  >
381 381
 					<div class="lasso-editor-settings--option-inner" style="border:none">
382
-						<input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked( $post_settings_disabled, 'on' );?> >
383
-						<label for="lasso_editor[post_settings_disabled]"> <?php _e( 'Disable Post Settings', 'lasso' );?></label>
384
-						<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>
382
+						<input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked($post_settings_disabled, 'on'); ?> >
383
+						<label for="lasso_editor[post_settings_disabled]"> <?php _e('Disable Post Settings', 'lasso'); ?></label>
384
+						<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>
385 385
 					</div>
386 386
 					
387 387
 					<div class="lasso-editor-settings--option-inner" style="border:none">
388
-						<input type="checkbox" class="checkbox" name="lasso_editor[allow_change_date]" id="lasso_editor[allow_change_date]" <?php echo checked( $allow_change_date, 'on' );?> >
389
-						<label for="lasso_editor[allow_change_date]"> <?php _e( 'Allow Changing Post Date', 'lasso' );?></label>
390
-						<span class="lasso--setting-description"><?php _e( 'Add the date selector to change the post\'s date to the Post Setting dialog', 'lasso' );?></span>
388
+						<input type="checkbox" class="checkbox" name="lasso_editor[allow_change_date]" id="lasso_editor[allow_change_date]" <?php echo checked($allow_change_date, 'on'); ?> >
389
+						<label for="lasso_editor[allow_change_date]"> <?php _e('Allow Changing Post Date', 'lasso'); ?></label>
390
+						<span class="lasso--setting-description"><?php _e('Add the date selector to change the post\'s date to the Post Setting dialog', 'lasso'); ?></span>
391 391
 					</div>
392 392
                     
393 393
                     <div class="lasso-editor-settings--option-inner" style="border:none">
394
-						<input type="checkbox" class="checkbox" name="lasso_editor[allow_edit_excerpt]" id="lasso_editor[allow_edit_excerpt]" <?php echo checked( $allow_edit_excerpt, 'on' );?> >
395
-						<label for="lasso_editor[allow_edit_excerpt]"> <?php _e( 'Allow Editing Excerpt', 'lasso' );?></label>
396
-						<span class="lasso--setting-description"><?php _e( 'Allow the post\'s excerpt to be edited in the Post Setting dialog', 'lasso' );?></span>
394
+						<input type="checkbox" class="checkbox" name="lasso_editor[allow_edit_excerpt]" id="lasso_editor[allow_edit_excerpt]" <?php echo checked($allow_edit_excerpt, 'on'); ?> >
395
+						<label for="lasso_editor[allow_edit_excerpt]"> <?php _e('Allow Editing Excerpt', 'lasso'); ?></label>
396
+						<span class="lasso--setting-description"><?php _e('Allow the post\'s excerpt to be edited in the Post Setting dialog', 'lasso'); ?></span>
397 397
 					</div>
398 398
 					
399 399
 					<div class="lasso-editor-settings--option-inner" style="border:none">
400
-						<input type="checkbox" class="checkbox" name="lasso_editor[allow_new_category]" id="lasso_editor[allow_new_category]" <?php echo checked( $allow_new_category, 'on' );?> >
401
-						<label for="lasso_editor[allow_new_category]"> <?php _e( 'Allow Adding New Category', 'lasso' );?></label>
402
-						<span class="lasso--setting-description"><?php _e( 'Add the user to create new, previously non-existing categories for posts.', 'lasso' );?></span>
400
+						<input type="checkbox" class="checkbox" name="lasso_editor[allow_new_category]" id="lasso_editor[allow_new_category]" <?php echo checked($allow_new_category, 'on'); ?> >
401
+						<label for="lasso_editor[allow_new_category]"> <?php _e('Allow Adding New Category', 'lasso'); ?></label>
402
+						<span class="lasso--setting-description"><?php _e('Add the user to create new, previously non-existing categories for posts.', 'lasso'); ?></span>
403 403
 					</div>
404 404
 					
405 405
 					<div class="lasso-editor-settings--option-inner" style="border:none">
406
-						<input type="checkbox" class="checkbox" name="lasso_editor[no_pending_status]" id="lasso_editor[no_pending_status]" <?php echo checked( $no_pending_status, 'on' );?> >
407
-						<label for="lasso_editor[no_pending_status]"> <?php _e( 'Do Not Allow "Pending" Status', 'lasso' );?></label>
408
-						<span class="lasso--setting-description"><?php _e( 'Remove the Option to Set the Status to Pending.', 'lasso' );?></span>
406
+						<input type="checkbox" class="checkbox" name="lasso_editor[no_pending_status]" id="lasso_editor[no_pending_status]" <?php echo checked($no_pending_status, 'on'); ?> >
407
+						<label for="lasso_editor[no_pending_status]"> <?php _e('Do Not Allow "Pending" Status', 'lasso'); ?></label>
408
+						<span class="lasso--setting-description"><?php _e('Remove the Option to Set the Status to Pending.', 'lasso'); ?></span>
409 409
 					</div>
410 410
 					
411 411
 					<div class="lasso-editor-settings--option-inner" style="border:none">
412
-						<input type="checkbox" class="checkbox" name="lasso_editor[no_url_setting]" id="lasso_editor[no_slug_setting]" <?php echo checked( $no_url_setting, 'on' );?> >
413
-						<label for="lasso_editor[no_url_setting]"> <?php _e( 'Remove POST URL Option', 'lasso' );?></label>
414
-						<span class="lasso--setting-description"><?php _e( 'Remove the Option to Set the URL for the Post.', 'lasso' );?></span>
412
+						<input type="checkbox" class="checkbox" name="lasso_editor[no_url_setting]" id="lasso_editor[no_slug_setting]" <?php echo checked($no_url_setting, 'on'); ?> >
413
+						<label for="lasso_editor[no_url_setting]"> <?php _e('Remove POST URL Option', 'lasso'); ?></label>
414
+						<span class="lasso--setting-description"><?php _e('Remove the Option to Set the URL for the Post.', 'lasso'); ?></span>
415 415
 					</div>
416 416
 				
417 417
 					<div class="lasso-editor-settings--option-inner" style="border:none">
418
-						<input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked( $post_new_disabled, 'on' );?> >
419
-						<label for="lasso_editor[post_adding_disabled]"><?php _e( 'Disable Post Adding', 'lasso' );?></label>
420
-						<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>
418
+						<input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked($post_new_disabled, 'on'); ?> >
419
+						<label for="lasso_editor[post_adding_disabled]"><?php _e('Disable Post Adding', 'lasso'); ?></label>
420
+						<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>
421 421
 					</div>
422 422
 					
423 423
 					<div class="lasso-editor-settings--option-inner" >
424
-						<input type="checkbox" class="checkbox" name="lasso_editor[support_custom_taxonomy]" id="lasso_editor[support_custom_taxonomy]" <?php echo checked( $support_custom_taxonomy, 'on' );?> >
425
-						<label for="lasso_editor[support_custom_taxonomy]"><?php _e( 'Support Custom Taxonomy', 'lasso' );?></label>
426
-						<span class="lasso--setting-description"><?php _e( 'Allow editing custom taxonomies.', 'lasso' );?></span>
424
+						<input type="checkbox" class="checkbox" name="lasso_editor[support_custom_taxonomy]" id="lasso_editor[support_custom_taxonomy]" <?php echo checked($support_custom_taxonomy, 'on'); ?> >
425
+						<label for="lasso_editor[support_custom_taxonomy]"><?php _e('Support Custom Taxonomy', 'lasso'); ?></label>
426
+						<span class="lasso--setting-description"><?php _e('Allow editing custom taxonomies.', 'lasso'); ?></span>
427 427
 					</div>
428 428
 					
429 429
 
430 430
 				</div>
431 431
 				
432
-				<h3><?php _e( 'Misc', 'lasso' );?></h3>
432
+				<h3><?php _e('Misc', 'lasso'); ?></h3>
433 433
 				<div class="lasso-editor-settings--option-wrap">
434 434
 					<div class="lasso-editor-settings--option-inner" style="border:none">
435
-						<input type="checkbox" class="checkbox" name="lasso_editor[disable_tour]" id="lasso_editor[disable_tour]" <?php echo checked( $disable_tour, 'on' );?> >
436
-						<label for="lasso_editor[disable_tour]"> <?php _e( 'Do Not Show Tour Dialog', 'lasso' );?></label>
437
-						<span class="lasso--setting-description"><?php _e( 'Check this box to disable the tour dialog box for all users.', 'lasso' );?></span>
435
+						<input type="checkbox" class="checkbox" name="lasso_editor[disable_tour]" id="lasso_editor[disable_tour]" <?php echo checked($disable_tour, 'on'); ?> >
436
+						<label for="lasso_editor[disable_tour]"> <?php _e('Do Not Show Tour Dialog', 'lasso'); ?></label>
437
+						<span class="lasso--setting-description"><?php _e('Check this box to disable the tour dialog box for all users.', 'lasso'); ?></span>
438 438
 					</div>
439 439
                     
440 440
                     <div class="lasso-editor-settings--option-inner" style="border:none;">
441
-						<label><?php _e( 'Placeholder Text for New Post', 'lasso' );?></label>
442
-						<span class="lasso--setting-description"><?php _e( 'Placeholder text to be displayed when a new post is created.', 'lasso' );?></span>
443
-						<input type="text" name="lasso_editor[new_post_text]" id="lasso_editor[new_post_text]" value="<?php echo esc_attr( $new_post_text );?>" placeholder="<?php $def = wp_strip_all_tags(apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso')));echo $def;?>", true)>
441
+						<label><?php _e('Placeholder Text for New Post', 'lasso'); ?></label>
442
+						<span class="lasso--setting-description"><?php _e('Placeholder text to be displayed when a new post is created.', 'lasso'); ?></span>
443
+						<input type="text" name="lasso_editor[new_post_text]" id="lasso_editor[new_post_text]" value="<?php echo esc_attr($new_post_text); ?>" placeholder="<?php $def = wp_strip_all_tags(apply_filters('lasso_new_object_content', __('Once upon a time...', 'lasso'))); echo $def; ?>", true)>
444 444
 					</div>
445 445
 					
446 446
 					<div class="lasso-editor-settings--option-inner" style="border:none">
447
-						<input type="checkbox" class="checkbox" name="lasso_editor[disable_shortcode_editing]" id="lasso_editor[disable_shortcode_editing]" <?php echo checked( $disable_shortcode_editing, 'on' );?> >
448
-						<label for="lasso_editor[disable_shortcode_editing]"> <?php _e( 'Do Not Allow Shortcode Editing', 'lasso' );?></label>
449
-						<span class="lasso--setting-description"><?php _e( 'Check this box to disable frontend editing of shortcodes.', 'lasso' );?></span>
447
+						<input type="checkbox" class="checkbox" name="lasso_editor[disable_shortcode_editing]" id="lasso_editor[disable_shortcode_editing]" <?php echo checked($disable_shortcode_editing, 'on'); ?> >
448
+						<label for="lasso_editor[disable_shortcode_editing]"> <?php _e('Do Not Allow Shortcode Editing', 'lasso'); ?></label>
449
+						<span class="lasso--setting-description"><?php _e('Check this box to disable frontend editing of shortcodes.', 'lasso'); ?></span>
450 450
 					</div>
451 451
 
452 452
 					<div class="lasso-editor-settings--option-inner" style="border:none">
453
-					    <label for="lasso_editor[bold_tag]"> <?php _e( '"Bold" Tag', 'lasso' );?></label>
454
-						<span class="lasso--setting-description"><?php _e( 'Choose the HTML tag used for the "Bold" style.', 'lasso' );?></span>
455
-					    <input type="radio" name="lasso_editor[bold_tag]" value='b' <?php echo checked( $bold_tag, 'b' );?>> b
456
-						<input type="radio" name="lasso_editor[bold_tag]" value="strong" <?php echo checked( $bold_tag, 'strong' );?>> strong
453
+					    <label for="lasso_editor[bold_tag]"> <?php _e('"Bold" Tag', 'lasso'); ?></label>
454
+						<span class="lasso--setting-description"><?php _e('Choose the HTML tag used for the "Bold" style.', 'lasso'); ?></span>
455
+					    <input type="radio" name="lasso_editor[bold_tag]" value='b' <?php echo checked($bold_tag, 'b'); ?>> b
456
+						<input type="radio" name="lasso_editor[bold_tag]" value="strong" <?php echo checked($bold_tag, 'strong'); ?>> strong
457 457
 					</div>
458 458
 					<div class="lasso-editor-settings--option-inner" style="border:none">
459
-					    <label for="lasso_editor[i_tag]"> <?php _e( '"Italic" Tag', 'lasso' );?></label>
460
-						<span class="lasso--setting-description"><?php _e( 'Choose the HTML tag used for the "Italic" style.', 'lasso' );?></span>
461
-					    <input type="radio" name="lasso_editor[i_tag]" value='i' <?php echo checked( $i_tag, 'i' );?>> i
462
-						<input type="radio" name="lasso_editor[i_tag]" value="em" <?php echo checked( $i_tag, 'em' );?>> em
459
+					    <label for="lasso_editor[i_tag]"> <?php _e('"Italic" Tag', 'lasso'); ?></label>
460
+						<span class="lasso--setting-description"><?php _e('Choose the HTML tag used for the "Italic" style.', 'lasso'); ?></span>
461
+					    <input type="radio" name="lasso_editor[i_tag]" value='i' <?php echo checked($i_tag, 'i'); ?>> i
462
+						<input type="radio" name="lasso_editor[i_tag]" value="em" <?php echo checked($i_tag, 'em'); ?>> em
463 463
 					</div>
464 464
                     <div class="lasso-editor-settings--option-inner" >
465
-						<input type="checkbox" class="checkbox" name="lasso_editor[link_prefix_http]" id="lasso_editor[link_prefix_http]" <?php echo checked( $link_prefix_http, 'on' );?> >
466
-						<label for="lasso_editor[link_prefix_http]"><?php _e( 'Auto Prefix HTTP to links', 'lasso' );?></label>
467
-						<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>
465
+						<input type="checkbox" class="checkbox" name="lasso_editor[link_prefix_http]" id="lasso_editor[link_prefix_http]" <?php echo checked($link_prefix_http, 'on'); ?> >
466
+						<label for="lasso_editor[link_prefix_http]"><?php _e('Auto Prefix HTTP to links', 'lasso'); ?></label>
467
+						<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>
468 468
 					</div>
469 469
 				</div>
470 470
 
471
-				<h3><?php _e( 'Advanced Options', 'lasso' );?></h3>
472
-                <span class="lasso--setting-description"><?php _e( 'Suggested not to turn these options on without consulting the developer.', 'lasso' );?></span>
471
+				<h3><?php _e('Advanced Options', 'lasso'); ?></h3>
472
+                <span class="lasso--setting-description"><?php _e('Suggested not to turn these options on without consulting the developer.', 'lasso'); ?></span>
473 473
                 <span class="lasso--setting-description"> </span>
474 474
 				<div class="lasso-editor-settings--option-wrap ">
475 475
 					<div class="lasso-editor-settings--option-inner" style="border:none">
476
-						<input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked( $shortcodify_disabled, 'on' );?> >
477
-						<label for="lasso_editor[shortcodify_disabled]"><?php _e( 'Disable Aesop Component Conversion', 'lasso' );?></label>
478
-						<span class="lasso--setting-description"><?php _e( 'Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso' );?></span>
476
+						<input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked($shortcodify_disabled, 'on'); ?> >
477
+						<label for="lasso_editor[shortcodify_disabled]"><?php _e('Disable Aesop Component Conversion', 'lasso'); ?></label>
478
+						<span class="lasso--setting-description"><?php _e('Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso'); ?></span>
479 479
 					</div>
480 480
 				
481 481
 					<div class="lasso-editor-settings--option-inner" style="border:none">
482
-						<input type="checkbox" class="checkbox" name="lasso_editor[enable_autosave]" id="lasso_editor[enable_autosave]" <?php echo checked( $enable_autosave, 'on' );?> >
483
-						<label for="lasso_editor[enable_autosave]"><?php _e( 'Enable Auto Save', 'lasso' );?></label>
484
-						<span class="lasso--setting-description"><?php _e( 'Check this box to enable auto save.', 'lasso' );?></span>
482
+						<input type="checkbox" class="checkbox" name="lasso_editor[enable_autosave]" id="lasso_editor[enable_autosave]" <?php echo checked($enable_autosave, 'on'); ?> >
483
+						<label for="lasso_editor[enable_autosave]"><?php _e('Enable Auto Save', 'lasso'); ?></label>
484
+						<span class="lasso--setting-description"><?php _e('Check this box to enable auto save.', 'lasso'); ?></span>
485 485
 					</div>
486 486
 				
487 487
 					<div class="lasso-editor-settings--option-inner" style="border:none">
488
-						<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' );?> >
489
-						<label for="lasso_editor[post_save_disabled]"><?php _e( 'Disable Post Saving', 'lasso' );?></label>
490
-						<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>
488
+						<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'); ?> >
489
+						<label for="lasso_editor[post_save_disabled]"><?php _e('Disable Post Saving', 'lasso'); ?></label>
490
+						<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>
491 491
 
492 492
 					</div>
493 493
 					
494 494
 					<div class="lasso-editor-settings--option-inner" style="border:none">
495
-						<input type="checkbox" class="checkbox" name="lasso_editor[post_edit_disabled]" id="lasso_editor[post_edit_disabled]" <?php echo checked( $edit_post_disabled, 'on' );?> >
496
-						<label for="lasso_editor[post_edit_disabled]"><?php _e( 'Disable Post Editing', 'lasso' );?></label>
497
-						<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>
495
+						<input type="checkbox" class="checkbox" name="lasso_editor[post_edit_disabled]" id="lasso_editor[post_edit_disabled]" <?php echo checked($edit_post_disabled, 'on'); ?> >
496
+						<label for="lasso_editor[post_edit_disabled]"><?php _e('Disable Post Editing', 'lasso'); ?></label>
497
+						<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>
498 498
 
499 499
 					</div>
500 500
 				
501 501
 					<div class="lasso-editor-settings--option-inner" style="border:none">
502
-						<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' );?> >
503
-						<label for="lasso_editor[save_using_rest_disabled]"><?php _e( "Don't Use REST API to Save", 'lasso' );?></label>
504
-						<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>
502
+						<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'); ?> >
503
+						<label for="lasso_editor[save_using_rest_disabled]"><?php _e("Don't Use REST API to Save", 'lasso'); ?></label>
504
+						<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>
505 505
 
506 506
 					</div>
507 507
                     
508 508
                     <div class="lasso-editor-settings--option-inner">
509
-						<input type="checkbox" class="checkbox" name="lasso_editor[no_wrap_shortcode]" id="lasso_editor[no_wrap_shortcode]" <?php echo checked( $no_wrap_shortcode, 'on' );?> >
510
-						<label for="lasso_editor[no_wrap_shortcode]"><?php _e( "Don't Wrap Shortcodes", 'lasso' );?></label>
511
-						<span class="lasso--setting-description"><?php _e( 'By default Editus wraps shortcodes so they can be preserved. Disable this behavior.', 'lasso' );?></span>
509
+						<input type="checkbox" class="checkbox" name="lasso_editor[no_wrap_shortcode]" id="lasso_editor[no_wrap_shortcode]" <?php echo checked($no_wrap_shortcode, 'on'); ?> >
510
+						<label for="lasso_editor[no_wrap_shortcode]"><?php _e("Don't Wrap Shortcodes", 'lasso'); ?></label>
511
+						<span class="lasso--setting-description"><?php _e('By default Editus wraps shortcodes so they can be preserved. Disable this behavior.', 'lasso'); ?></span>
512 512
 
513 513
 					</div>
514 514
 				</div>
@@ -518,11 +518,11 @@  discard block
 block discarded – undo
518 518
 
519 519
 				<div class="lasso-editor-settings--submit">
520 520
 				    <input type="hidden" name="action" value="lasso-editor-settings" />
521
-				    <input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save Settings', 'lasso' );?>" />
522
-					<?php wp_nonce_field( 'nonce', 'lasso_editor_settings' ); ?>
521
+				    <input type="submit" class="button-primary" value="<?php esc_attr_e('Save Settings', 'lasso'); ?>" />
522
+					<?php wp_nonce_field('nonce', 'lasso_editor_settings'); ?>
523 523
 				</div>
524 524
 				
525
-				<?php do_action('lasso_settings_after');?>
525
+				<?php do_action('lasso_settings_after'); ?>
526 526
 			</form>
527 527
 
528 528
 		</div><?php
Please login to merge, or discard this patch.
lasso.php 1 patch
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -18,27 +18,27 @@  discard block
 block discarded – undo
18 18
  */
19 19
 
20 20
 // If this file is called directly, abort.
21
-if ( ! defined( 'WPINC' ) ) {
21
+if (!defined('WPINC')) {
22 22
 	die;
23 23
 }
24 24
 
25 25
 // Set some constants
26
-define( 'LASSO_VERSION', '1.6.0' );
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.6.0');
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,31 +169,31 @@  discard block
 block discarded – undo
169 169
 //table codes to be added
170 170
 class editus_paragraph {
171 171
     
172
-    public function __construct(){
172
+    public function __construct() {
173 173
         $add_paragraph = lasso_editor_get_option('add_paragraph', 'lasso_editor', false);
174 174
         if ($add_paragraph) {
175
-            add_action('wp_enqueue_scripts', array($this,'scripts'));
175
+            add_action('wp_enqueue_scripts', array($this, 'scripts'));
176 176
             
177 177
         }
178 178
 	}
179 179
     
180 180
     function scripts()
181 181
     {
182
-            add_action('lasso_editor_controls_after_outside', array($this,'editus_paragraph_style'));
183
-            add_filter('lasso_components',array($this,'editus_components_add_paragraph'),10,1);
184
-            add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_paragraph'), 10 );
182
+            add_action('lasso_editor_controls_after_outside', array($this, 'editus_paragraph_style'));
183
+            add_filter('lasso_components', array($this, 'editus_components_add_paragraph'), 10, 1);
184
+            add_action('lasso_toolbar_components', array($this, 'editus_toolbar_components_add_paragraph'), 10);
185 185
             //wp_enqueue_style( 'editus-table-style', LASSO_URL.  '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true );
186 186
             //wp_enqueue_script( 'editus_table',  LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true );
187 187
     }
188 188
    
189
-    function editus_components_add_paragraph( $array ){
189
+    function editus_components_add_paragraph($array) {
190 190
         $custom = array(
191 191
                'htmlparagraph' => array(
192
-                         'name'    => __('HTML Paragraph','lasso'),
192
+                         'name'    => __('HTML Paragraph', 'lasso'),
193 193
                           'content' => self::editus_html_paragraph(),
194 194
                 )
195 195
         );
196
-        return array_merge( $array, $custom );
196
+        return array_merge($array, $custom);
197 197
     }
198 198
     
199 199
     
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 
218 218
     function editus_toolbar_components_add_paragraph( ) {
219 219
           ?>
220
-          <li data-type="htmlparagraph" title="<?php esc_attr_e( 'HTML Paragraph', 'lasso' );?>" class="quote lasso-toolbar--component__htmlparagraph dashicons dashicons-editor-paragraph"></li>
220
+          <li data-type="htmlparagraph" title="<?php esc_attr_e('HTML Paragraph', 'lasso'); ?>" class="quote lasso-toolbar--component__htmlparagraph dashicons dashicons-editor-paragraph"></li>
221 221
           <?php
222 222
     }
223 223
 }
Please login to merge, or discard this patch.
public/includes/assets.php 2 patches
Indentation   +88 added lines, -88 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,13 +90,13 @@  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
-            $text_select_popup = lasso_editor_get_option('text_select_popup', 'lasso_editor', false);
97
+			$text_select_popup = lasso_editor_get_option('text_select_popup', 'lasso_editor', false);
98 98
             
99
-            $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor', 'off');
99
+			$link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor', 'off');
100 100
 
101 101
 			
102 102
 			//text alignement
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 			//disable shortcode editing
115 115
 			$disable_shortcode_editing = lasso_editor_get_option('disable_shortcode_editing', 'lasso_editor');
116 116
             
117
-            // support custom taxonomy
117
+			// support custom taxonomy
118 118
 			$support_custom_taxonomy = lasso_editor_get_option('support_custom_taxonomy', 'lasso_editor');
119 119
 			
120 120
 			if ($show_color) {
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 			$tz_offset = get_UTC_offset();
141 141
 			$post_date = get_the_time('U', $postid);
142 142
 			$time = (time()+$tz_offset);
143
-            $delta = $time - $post_date;
143
+			$delta = $time - $post_date;
144 144
             
145 145
 			$strings = array(
146 146
 				'save' 				=> __('Save','lasso'),
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 				
185 185
 				'catsPlaceholder'     => __('add categories...'),
186 186
 				'tagsPlaceholder'     => __('add tags...'),
187
-                'taxoPlaceholder'     => __('add taxonomy terms...'),
187
+				'taxoPlaceholder'     => __('add taxonomy terms...'),
188 188
 				'editShortcode'     => __('Edit Shortcode'),
189 189
 				
190 190
 				
@@ -197,11 +197,11 @@  discard block
 block discarded – undo
197 197
 			$gallery_nonce = wp_create_nonce( $gallery_nonce_action );
198 198
 			
199 199
 			
200
-            if ($allow_change_date) {
201
-			    $permalink = get_site_url().'/?p='.$postid;
202
-            } else {
203
-                $permalink = get_permalink($postid);
204
-            }
200
+			if ($allow_change_date) {
201
+				$permalink = get_site_url().'/?p='.$postid;
202
+			} else {
203
+				$permalink = get_permalink($postid);
204
+			}
205 205
 			
206 206
 			// rest api
207 207
 			$rest_nonce = '';
@@ -221,17 +221,17 @@  discard block
 block discarded – undo
221 221
 				}
222 222
 			}
223 223
             
224
-            //excerpt
225
-            $post_excerpt = "";
226
-            $post_excerpt = wp_strip_all_tags($post->post_excerpt,true);
224
+			//excerpt
225
+			$post_excerpt = "";
226
+			$post_excerpt = wp_strip_all_tags($post->post_excerpt,true);
227 227
             
228
-            //find if this is multi page. -1 if not
229
-            $multipage = self::is_multipage();
230
-            $post_content = "";
231
-            //pass post_content if we need to process multipage. In future we may need to pass this for other purposes
232
-            //if ($multipage != -1) {
233
-               $post_content = $post->post_content;
234
-            //}
228
+			//find if this is multi page. -1 if not
229
+			$multipage = self::is_multipage();
230
+			$post_content = "";
231
+			//pass post_content if we need to process multipage. In future we may need to pass this for other purposes
232
+			//if ($multipage != -1) {
233
+			   $post_content = $post->post_content;
234
+			//}
235 235
 			
236 236
 			//get custom taxonomy
237 237
 			$custom_taxonomies         = array_diff(get_object_taxonomies( get_post_type( $postid ), 'names' ), ['category','post_tag','post_format']);
@@ -244,8 +244,8 @@  discard block
 block discarded – undo
244 244
 				$existing_taxo_arr[$taxonomy] = lasso_get_objects( $taxonomy );
245 245
 			}
246 246
             
247
-            $new_post_text    = lasso_editor_get_option( 'new_post_text', 'lasso_editor' );        
248
-            $new_post_text  = !empty($new_post_text) ? $new_post_text : wp_strip_all_tags(apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso')));
247
+			$new_post_text    = lasso_editor_get_option( 'new_post_text', 'lasso_editor' );        
248
+			$new_post_text  = !empty($new_post_text) ? $new_post_text : wp_strip_all_tags(apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso')));
249 249
 
250 250
 
251 251
 			// localized objects
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 				'nonce'				=> wp_create_nonce('lasso_editor'),
275 275
 				'handle'			=> lasso_editor_settings_toolbar(),
276 276
 				'toolbar'			=> lasso_editor_text_toolbar(),
277
-                'toolbarPopup'		=> $text_select_popup ? lasso_editor_selected_text_toolbar(): false,
277
+				'toolbarPopup'		=> $text_select_popup ? lasso_editor_selected_text_toolbar(): false,
278 278
 				'toolbarHeadings'   => $toolbar_headings,
279 279
 				'toolbarHeadingsH4'   => $toolbar_headings_h4,
280 280
 				'component_modal'	=> lasso_editor_component_modal(),
@@ -327,19 +327,19 @@  discard block
 block discarded – undo
327 327
 				'customFields'      => $custom_fields,
328 328
 				'clickToInsert'     => ($insert_comp_ui =='click'),
329 329
 				'buttonOnEmptyP'     => ($insert_comp_ui =='mediumcom'),      // auto show a button to insert components on an empty paragraph      
330
-                'rtl'               => is_rtl(),				
330
+				'rtl'               => is_rtl(),				
331 331
 				'skipToEdit'        =>( $delta < 10 && $delta >=0 ), // if it's a new post, skip to edit mode
332 332
 				'linksEditable'    => $links_editable,
333 333
 				'supportPendingStatus' => !$no_pending_status,
334 334
 				'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>'),
335
-                'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) || self::gutenberg_active(),//,
336
-                'multipages'=> $multipage,
337
-                'post_content'=>$post_content,
338
-                'post_excerpt'=>$post_excerpt,
339
-                'supCustTaxo' => $support_custom_taxonomy == 'on',
340
-                'oldWPimg'=> $use_old_wpimg =='on',
341
-                'useWPImgBlk'=> $use_wpimgblock,
342
-                'prefixHTTP'=> $link_prefix_http =='on'
335
+				'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) || self::gutenberg_active(),//,
336
+				'multipages'=> $multipage,
337
+				'post_content'=>$post_content,
338
+				'post_excerpt'=>$post_excerpt,
339
+				'supCustTaxo' => $support_custom_taxonomy == 'on',
340
+				'oldWPimg'=> $use_old_wpimg =='on',
341
+				'useWPImgBlk'=> $use_wpimgblock,
342
+				'prefixHTTP'=> $link_prefix_http =='on'
343 343
 			);
344 344
 
345 345
 
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 			
348 348
 			
349 349
 			if (!$using_restapiv2) {
350
-               // enqueue REST API V1
350
+			   // enqueue REST API V1
351 351
 			   wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
352 352
 			   $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) );
353 353
 			   wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings );
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 			if ($show_color) {
364 364
 				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true);
365 365
 			} else {
366
-			    wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
366
+				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
367 367
 			}
368 368
 			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) );
369 369
 
@@ -372,44 +372,44 @@  discard block
 block discarded – undo
372 372
 
373 373
 	}
374 374
     
375
-    function gutenberg_active() {
375
+	function gutenberg_active() {
376 376
         
377
-        // Gutenberg plugin is installed and activated.
378
-        $gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) );
379
-
380
-        // Block editor since 5.0.
381
-        $block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' );
382
-
383
-        if ( ! $gutenberg && ! $block_editor ) {
384
-            return false;
385
-        }
386
-
387
-        if ( self::is_classic_editor_plugin_active() ) {
388
-            $editor_option       = get_option( 'classic-editor-replace' );
389
-            $block_editor_active = array( 'no-replace', 'block' );
390
-
391
-            return in_array( $editor_option, $block_editor_active, true );
392
-        }
393
-
394
-        return true;
395
-    }
396
-
397
-    /**
398
-     * Check if Classic Editor plugin is active.
399
-     *
400
-     * @return bool
401
-     */
402
-    function is_classic_editor_plugin_active() {
403
-        if ( ! function_exists( 'is_plugin_active' ) ) {
404
-            include_once ABSPATH . 'wp-admin/includes/plugin.php';
405
-        }
406
-
407
-        if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) {
408
-            return true;
409
-        }
410
-
411
-        return false;
412
-    }
377
+		// Gutenberg plugin is installed and activated.
378
+		$gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) );
379
+
380
+		// Block editor since 5.0.
381
+		$block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' );
382
+
383
+		if ( ! $gutenberg && ! $block_editor ) {
384
+			return false;
385
+		}
386
+
387
+		if ( self::is_classic_editor_plugin_active() ) {
388
+			$editor_option       = get_option( 'classic-editor-replace' );
389
+			$block_editor_active = array( 'no-replace', 'block' );
390
+
391
+			return in_array( $editor_option, $block_editor_active, true );
392
+		}
393
+
394
+		return true;
395
+	}
396
+
397
+	/**
398
+	 * Check if Classic Editor plugin is active.
399
+	 *
400
+	 * @return bool
401
+	 */
402
+	function is_classic_editor_plugin_active() {
403
+		if ( ! function_exists( 'is_plugin_active' ) ) {
404
+			include_once ABSPATH . 'wp-admin/includes/plugin.php';
405
+		}
406
+
407
+		if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) {
408
+			return true;
409
+		}
410
+
411
+		return false;
412
+	}
413 413
 
414 414
 }
415 415
 
Please login to merge, or discard this patch.
Spacing   +117 added lines, -117 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
             
@@ -119,8 +119,8 @@  discard block
 block discarded – undo
119 119
 			
120 120
 			if ($show_color) {
121 121
 				//color picker
122
-				wp_enqueue_style( 'wp-color-picker' );
123
-				wp_enqueue_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 );
122
+				wp_enqueue_style('wp-color-picker');
123
+				wp_enqueue_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), false, 1);
124 124
 			}
125 125
 			
126 126
 			// click to insert components, not drag and drop
@@ -132,54 +132,54 @@  discard block
 block discarded – undo
132 132
 			
133 133
 			// custom fields
134 134
 			
135
-			$custom_fields = apply_filters( 'editus_custom_fields', null ); 
135
+			$custom_fields = apply_filters('editus_custom_fields', null); 
136 136
 
137 137
 
138 138
 			// post id reference
139 139
 			$postid 			= get_the_ID();
140 140
 			$tz_offset = get_UTC_offset();
141 141
 			$post_date = get_the_time('U', $postid);
142
-			$time = (time()+$tz_offset);
142
+			$time = (time() + $tz_offset);
143 143
             $delta = $time - $post_date;
144 144
             
145 145
 			$strings = array(
146
-				'save' 				=> __('Save','lasso'),
147
-				'selectText'	  	=> __('Please Select Text First.','lasso'),
148
-				'cancel' 			=> __('Cancel','lasso'),
149
-				'exiteditor' 		=> __('Exit Editor','lasso'),
150
-				'saving' 			=> __('Saving...','lasso'),
151
-				'saved'				=> __('Saved!','lasso'),
152
-				'adding' 			=> __('Adding...','lasso'),
153
-				'added'				=> __('Added!','lasso'),
154
-				'loading' 			=> __('Loading...','lasso'),
155
-				'loadMore'			=> __('Load More','lasso'),
156
-				'close'			=> __('Close','lasso'),
157
-				'noPostsFound'		=> __('No more posts found','lasso'),
158
-				'fetchFail'	    	=> __('Fetching failed.','lasso'),
159
-				'galleryCreated' 	=> __('Gallery Created!','lasso'),
160
-				'galleryUpdated' 	=> __('Gallery Updated!','lasso'),
161
-				'justWrite'			=> __('Just write...','lasso'),
162
-				'chooseImage'		=> __('Choose an image','lasso'),
163
-				'updateImage'		=> __('Update Image','lasso'),
164
-				'insertImage'		=> __('Insert Image','lasso'),
165
-				'selectImage'		=> __('Select Image','lasso'),
166
-				'removeFeatImg'     => __('Remove featured image?','lasso'),
167
-				'updateSelectedImg' => __('Update Selected Image','lasso'),
168
-				'chooseImages'		=> __('Choose images','lasso'),
169
-				'editImage'			=> __('Edit Image','lasso'),
170
-				'addImages'			=> __('Add Images','lasso'),
171
-				'addNewGallery'		=> __('Add New Gallery','lasso'),
172
-				'selectGallery'		=> __('Select Editus Gallery Image','lasso'),
173
-				'useSelectedImages' => __('Use Selected Images','lasso'),
174
-				'publishPost'		=> __('Publish Post?','lasso'),
175
-				'publishYes'		=> __('Yes, publish it!','lasso'),
176
-				'deletePost'		=> __('Trash Post?','lasso'),
177
-				'deleteYes'			=> __('Yes, trash it!','lasso'),
178
-				'warning'			=> __('Oh snap!','laso'),
179
-				'cancelText'		=> __('O.K. got it!','lasso'),
180
-				'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'),
146
+				'save' 				=> __('Save', 'lasso'),
147
+				'selectText'	  	=> __('Please Select Text First.', 'lasso'),
148
+				'cancel' 			=> __('Cancel', 'lasso'),
149
+				'exiteditor' 		=> __('Exit Editor', 'lasso'),
150
+				'saving' 			=> __('Saving...', 'lasso'),
151
+				'saved'				=> __('Saved!', 'lasso'),
152
+				'adding' 			=> __('Adding...', 'lasso'),
153
+				'added'				=> __('Added!', 'lasso'),
154
+				'loading' 			=> __('Loading...', 'lasso'),
155
+				'loadMore'			=> __('Load More', 'lasso'),
156
+				'close'			=> __('Close', 'lasso'),
157
+				'noPostsFound'		=> __('No more posts found', 'lasso'),
158
+				'fetchFail'	    	=> __('Fetching failed.', 'lasso'),
159
+				'galleryCreated' 	=> __('Gallery Created!', 'lasso'),
160
+				'galleryUpdated' 	=> __('Gallery Updated!', 'lasso'),
161
+				'justWrite'			=> __('Just write...', 'lasso'),
162
+				'chooseImage'		=> __('Choose an image', 'lasso'),
163
+				'updateImage'		=> __('Update Image', 'lasso'),
164
+				'insertImage'		=> __('Insert Image', 'lasso'),
165
+				'selectImage'		=> __('Select Image', 'lasso'),
166
+				'removeFeatImg'     => __('Remove featured image?', 'lasso'),
167
+				'updateSelectedImg' => __('Update Selected Image', 'lasso'),
168
+				'chooseImages'		=> __('Choose images', 'lasso'),
169
+				'editImage'			=> __('Edit Image', 'lasso'),
170
+				'addImages'			=> __('Add Images', 'lasso'),
171
+				'addNewGallery'		=> __('Add New Gallery', 'lasso'),
172
+				'selectGallery'		=> __('Select Editus Gallery Image', 'lasso'),
173
+				'useSelectedImages' => __('Use Selected Images', 'lasso'),
174
+				'publishPost'		=> __('Publish Post?', 'lasso'),
175
+				'publishYes'		=> __('Yes, publish it!', 'lasso'),
176
+				'deletePost'		=> __('Trash Post?', 'lasso'),
177
+				'deleteYes'			=> __('Yes, trash it!', 'lasso'),
178
+				'warning'			=> __('Oh snap!', 'laso'),
179
+				'cancelText'		=> __('O.K. got it!', 'lasso'),
180
+				'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'),
181 181
 				'missingConfirm'	=> __('Update Settings', 'lasso'),
182
-				'helperText'		=> __('one more letter','lasso'),
182
+				'helperText'		=> __('one more letter', 'lasso'),
183 183
 				'editingBackup'  	=> __('You are currently editing a backup copy of this post.'),
184 184
 				
185 185
 				'catsPlaceholder'     => __('add categories...'),
@@ -190,11 +190,11 @@  discard block
 block discarded – undo
190 190
 				
191 191
 			);
192 192
 
193
-			$api_url = trailingslashit( home_url() ) . 'lasso-internal-api';
193
+			$api_url = trailingslashit(home_url()).'lasso-internal-api';
194 194
 
195 195
 			$gallery_class = new gallery();
196 196
 			$gallery_nonce_action = $gallery_class->nonce_action;
197
-			$gallery_nonce = wp_create_nonce( $gallery_nonce_action );
197
+			$gallery_nonce = wp_create_nonce($gallery_nonce_action);
198 198
 			
199 199
 			
200 200
             if ($allow_change_date) {
@@ -209,13 +209,13 @@  discard block
 block discarded – undo
209 209
 			  
210 210
 			if (function_exists('rest_url')) {
211 211
 				//$rest_root = esc_url_raw( rest_url());
212
-				$rest_nonce = wp_create_nonce( 'wp_rest' );
213
-				$settings = array( 'root' => $rest_root, 'nonce' => $rest_nonce );
214
-				wp_enqueue_script( 'wp-api', '', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
215
-				wp_localize_script( 'wp-api', 'wpApiSettings', $settings );
216
-				wp_localize_script( 'wp-api', 'WP_API_Settings', $settings );
212
+				$rest_nonce = wp_create_nonce('wp_rest');
213
+				$settings = array('root' => $rest_root, 'nonce' => $rest_nonce);
214
+				wp_enqueue_script('wp-api', '', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true);
215
+				wp_localize_script('wp-api', 'wpApiSettings', $settings);
216
+				wp_localize_script('wp-api', 'WP_API_Settings', $settings);
217 217
 				
218
-				if ( class_exists( 'WP_REST_Controller' )) {
218
+				if (class_exists('WP_REST_Controller')) {
219 219
 					// we are using REST API V2
220 220
 					$using_restapiv2 = true;
221 221
 				}
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
             
224 224
             //excerpt
225 225
             $post_excerpt = "";
226
-            $post_excerpt = wp_strip_all_tags($post->post_excerpt,true);
226
+            $post_excerpt = wp_strip_all_tags($post->post_excerpt, true);
227 227
             
228 228
             //find if this is multi page. -1 if not
229 229
             $multipage = self::is_multipage();
@@ -234,24 +234,24 @@  discard block
 block discarded – undo
234 234
             //}
235 235
 			
236 236
 			//get custom taxonomy
237
-			$custom_taxonomies         = array_diff(get_object_taxonomies( get_post_type( $postid ), 'names' ), ['category','post_tag','post_format']);
238
-			$post_taxo_arr    = array();
237
+			$custom_taxonomies         = array_diff(get_object_taxonomies(get_post_type($postid), 'names'), ['category', 'post_tag', 'post_format']);
238
+			$post_taxo_arr = array();
239 239
 			foreach ($custom_taxonomies as $taxonomy) {
240
-				$post_taxo_arr[$taxonomy] = lasso_get_post_objects( $postid, $taxonomy );
240
+				$post_taxo_arr[$taxonomy] = lasso_get_post_objects($postid, $taxonomy);
241 241
 			}
242
-			$existing_taxo_arr    = array();
242
+			$existing_taxo_arr = array();
243 243
 			foreach ($custom_taxonomies as $taxonomy) {
244
-				$existing_taxo_arr[$taxonomy] = lasso_get_objects( $taxonomy );
244
+				$existing_taxo_arr[$taxonomy] = lasso_get_objects($taxonomy);
245 245
 			}
246 246
             
247
-            $new_post_text    = lasso_editor_get_option( 'new_post_text', 'lasso_editor' );        
248
-            $new_post_text  = !empty($new_post_text) ? $new_post_text : wp_strip_all_tags(apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso')));
247
+            $new_post_text = lasso_editor_get_option('new_post_text', 'lasso_editor');        
248
+            $new_post_text = !empty($new_post_text) ? $new_post_text : wp_strip_all_tags(apply_filters('lasso_new_object_content', __('Once upon a time...', 'lasso')));
249 249
 
250 250
 
251 251
 			// localized objects
252 252
 			$objects = array(
253
-				'ajaxurl' 			=> esc_url( $api_url ),
254
-				'ajaxurl2' 			=> esc_url( admin_url( 'admin-ajax.php' )),
253
+				'ajaxurl' 			=> esc_url($api_url),
254
+				'ajaxurl2' 			=> esc_url(admin_url('admin-ajax.php')),
255 255
 				'siteUrl'           => site_url(),
256 256
 				'rest_root'         => $rest_root,
257 257
 				'rest_nonce'        => $rest_nonce,
@@ -260,13 +260,13 @@  discard block
 block discarded – undo
260 260
 				'featImgClass'		=> $featImgClass,
261 261
 				'titleClass'		=> $titleClass,
262 262
 				'strings'			=> $strings,
263
-				'settingsLink'		=> function_exists('is_multisite') && is_multisite() ? network_admin_url( 'settings.php?page=lasso-editor' ) : admin_url( 'admin.php?page=lasso-editor-settings' ),
264
-				'post_status'		=> get_post_status( $postid ),
263
+				'settingsLink'		=> function_exists('is_multisite') && is_multisite() ? network_admin_url('settings.php?page=lasso-editor') : admin_url('admin.php?page=lasso-editor-settings'),
264
+				'post_status'		=> get_post_status($postid),
265 265
 				'postid'			=> $postid,
266 266
 				'permalink'			=> $permalink,
267 267
 				'edit_others_pages'	=> current_user_can('edit_others_pages') ? true : false,
268 268
 				'edit_others_posts'	=> current_user_can('edit_others_posts') ? true : false,
269
-				'userCanEdit'		=> current_user_can('edit_post', $postid ),
269
+				'userCanEdit'		=> current_user_can('edit_post', $postid),
270 270
 				'can_publish'		=> is_page() ? current_user_can('publish_pages') : current_user_can('publish_posts'),
271 271
 				//'can_publish_posts'	=> current_user_can('publish_posts'),
272 272
 				//'can_publish_pages'	=> current_user_can('publish_pages'),
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 				'nonce'				=> wp_create_nonce('lasso_editor'),
275 275
 				'handle'			=> lasso_editor_settings_toolbar(),
276 276
 				'toolbar'			=> lasso_editor_text_toolbar(),
277
-                'toolbarPopup'		=> $text_select_popup ? lasso_editor_selected_text_toolbar(): false,
277
+                'toolbarPopup'		=> $text_select_popup ? lasso_editor_selected_text_toolbar() : false,
278 278
 				'toolbarHeadings'   => $toolbar_headings,
279 279
 				'toolbarHeadingsH4'   => $toolbar_headings_h4,
280 280
 				'component_modal'	=> lasso_editor_component_modal(),
@@ -306,40 +306,40 @@  discard block
 block discarded – undo
306 306
 				'extCusTaxonomies' => $existing_taxo_arr,
307 307
 				'noResultsDiv'		=> lasso_editor_empty_results(),
308 308
 				'noRevisionsDiv'	=> lasso_editor_empty_results('revision'),
309
-				'mapTileProvider'   => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider( $postid ) : false,
310
-				'mapLocations'		=> get_post_meta( $postid, 'ase_map_component_locations' ),
311
-				'mapStart'			=> get_post_meta( $postid, 'ase_map_component_start_point', true ),
312
-				'mapZoom'			=> get_post_meta( $postid, 'ase_map_component_zoom', true ),
309
+				'mapTileProvider'   => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider($postid) : false,
310
+				'mapLocations'		=> get_post_meta($postid, 'ase_map_component_locations'),
311
+				'mapStart'			=> get_post_meta($postid, 'ase_map_component_start_point', true),
312
+				'mapZoom'			=> get_post_meta($postid, 'ase_map_component_zoom', true),
313 313
 				'revisionModal' 	=> lasso_editor_revision_modal(),
314 314
 				'isMobile'          => wp_is_mobile(),
315
-				'enableAutoSave'    => lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ),
315
+				'enableAutoSave'    => lasso_editor_get_option('enable_autosave', 'lasso_editor'),
316 316
 				'showColor'         => $show_color,
317 317
 				'showAlignment'     => $show_align,
318 318
 				'showIgnoredItems'  => lasso_editor_get_option('show_ignored_items', 'lasso_editor'),
319 319
 				'restapi2'          => $using_restapiv2,
320 320
 				'saveusingrest'     => $using_restapiv2 && !$disableRESTSave,
321
-				'newObjectContent'  => '<p class="editus-firstp" placeholder="'. $new_post_text . '"></p>',
321
+				'newObjectContent'  => '<p class="editus-firstp" placeholder="'.$new_post_text.'"></p>',
322 322
 				'disableSavePost'   => $save_to_post_disabled,
323 323
 				'disableEditPost'   => $edit_post_disabled,
324 324
 				'disableEditSC'     => $disable_shortcode_editing,
325 325
 				'boldTag'           => $bold_tag,
326 326
 				'iTag'           	=> $i_tag, 
327 327
 				'customFields'      => $custom_fields,
328
-				'clickToInsert'     => ($insert_comp_ui =='click'),
329
-				'buttonOnEmptyP'     => ($insert_comp_ui =='mediumcom'),      // auto show a button to insert components on an empty paragraph      
328
+				'clickToInsert'     => ($insert_comp_ui == 'click'),
329
+				'buttonOnEmptyP'     => ($insert_comp_ui == 'mediumcom'), // auto show a button to insert components on an empty paragraph      
330 330
                 'rtl'               => is_rtl(),				
331
-				'skipToEdit'        =>( $delta < 10 && $delta >=0 ), // if it's a new post, skip to edit mode
331
+				'skipToEdit'        =>($delta < 10 && $delta >= 0), // if it's a new post, skip to edit mode
332 332
 				'linksEditable'    => $links_editable,
333 333
 				'supportPendingStatus' => !$no_pending_status,
334
-				'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>'),
335
-                'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) || self::gutenberg_active(),//,
334
+				'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>'),
335
+                'hasGutenberg' => (function_exists('has_blocks') && has_blocks($post->post_content)) || self::gutenberg_active(), //,
336 336
                 'multipages'=> $multipage,
337 337
                 'post_content'=>$post_content,
338 338
                 'post_excerpt'=>$post_excerpt,
339 339
                 'supCustTaxo' => $support_custom_taxonomy == 'on',
340
-                'oldWPimg'=> $use_old_wpimg =='on',
340
+                'oldWPimg'=> $use_old_wpimg == 'on',
341 341
                 'useWPImgBlk'=> $use_wpimgblock,
342
-                'prefixHTTP'=> $link_prefix_http =='on'
342
+                'prefixHTTP'=> $link_prefix_http == 'on'
343 343
 			);
344 344
 
345 345
 
@@ -348,9 +348,9 @@  discard block
 block discarded – undo
348 348
 			
349 349
 			if (!$using_restapiv2) {
350 350
                // enqueue REST API V1
351
-			   wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
352
-			   $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) );
353
-			   wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings );
351
+			   wp_enqueue_script('wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true);
352
+			   $settings = array('root' => home_url($home_url), 'nonce' => wp_create_nonce('wp_json'));
353
+			   wp_localize_script('wp-api-js', 'WP_API_Settings', $settings);
354 354
 			}
355 355
 			
356 356
 			if ($allow_change_date) {
@@ -359,13 +359,13 @@  discard block
 block discarded – undo
359 359
 				wp_enqueue_style('jquery-ui');
360 360
 			}
361 361
 
362
-			$postfix = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? '' : '.min';
362
+			$postfix = (defined('SCRIPT_DEBUG') && true === SCRIPT_DEBUG) ? '' : '.min';
363 363
 			if ($show_color) {
364
-				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true);
364
+				wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api', 'iris'), LASSO_VERSION, true);
365 365
 			} else {
366
-			    wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
366
+			    wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
367 367
 			}
368
-			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) );
368
+			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects));
369 369
 
370 370
 
371 371
 		}
@@ -375,20 +375,20 @@  discard block
 block discarded – undo
375 375
     function gutenberg_active() {
376 376
         
377 377
         // Gutenberg plugin is installed and activated.
378
-        $gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) );
378
+        $gutenberg = !(false === has_filter('replace_editor', 'gutenberg_init'));
379 379
 
380 380
         // Block editor since 5.0.
381
-        $block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' );
381
+        $block_editor = version_compare($GLOBALS['wp_version'], '5.0-beta', '>');
382 382
 
383
-        if ( ! $gutenberg && ! $block_editor ) {
383
+        if (!$gutenberg && !$block_editor) {
384 384
             return false;
385 385
         }
386 386
 
387
-        if ( self::is_classic_editor_plugin_active() ) {
388
-            $editor_option       = get_option( 'classic-editor-replace' );
389
-            $block_editor_active = array( 'no-replace', 'block' );
387
+        if (self::is_classic_editor_plugin_active()) {
388
+            $editor_option       = get_option('classic-editor-replace');
389
+            $block_editor_active = array('no-replace', 'block');
390 390
 
391
-            return in_array( $editor_option, $block_editor_active, true );
391
+            return in_array($editor_option, $block_editor_active, true);
392 392
         }
393 393
 
394 394
         return true;
@@ -400,11 +400,11 @@  discard block
 block discarded – undo
400 400
      * @return bool
401 401
      */
402 402
     function is_classic_editor_plugin_active() {
403
-        if ( ! function_exists( 'is_plugin_active' ) ) {
404
-            include_once ABSPATH . 'wp-admin/includes/plugin.php';
403
+        if (!function_exists('is_plugin_active')) {
404
+            include_once ABSPATH.'wp-admin/includes/plugin.php';
405 405
         }
406 406
 
407
-        if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) {
407
+        if (is_plugin_active('classic-editor/classic-editor.php')) {
408 408
             return true;
409 409
         }
410 410
 
Please login to merge, or discard this patch.