Completed
Push — master ( be99ef...8dfca6 )
by
unknown
02:05
created
admin/includes/menus/settings.php 1 patch
Spacing   +121 added lines, -121 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();
@@ -86,37 +86,37 @@  discard block
 block discarded – undo
86 86
 	 */
87 87
 	function lasso_editor_settings_form() {
88 88
 
89
-		if ( !is_user_logged_in() )
89
+		if (!is_user_logged_in())
90 90
 			return;
91 91
 
92
-		$article_object   = lasso_editor_get_option( 'article_class', 'lasso_editor' );
93
-		$featImgClass    = lasso_editor_get_option( 'featimg_class', 'lasso_editor' );
94
-		$titleClass    = lasso_editor_get_option( 'title_class', 'lasso_editor' );
95
-
96
-		$post_new_disabled   = lasso_editor_get_option( 'post_adding_disabled', 'lasso_editor' );
97
-		$save_to_post_disabled  = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' );
98
-		$post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' );
99
-		$allow_change_date = lasso_editor_get_option( 'allow_change_date', 'lasso_editor' );
100
-		$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
101
-		$shortcodify_disabled  = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' );
102
-		$enable_autosave  = lasso_editor_get_option( 'enable_autosave', 'lasso_editor' );
103
-
104
-		$toolbar_headings      = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' );
105
-		$toolbar_headings_h4      = lasso_editor_get_option( 'toolbar_headings_h4', 'lasso_editor' );
106
-		$toolbar_show_color      = lasso_editor_get_option( 'toolbar_show_color', 'lasso_editor' );
107
-		$toolbar_show_alignment  = lasso_editor_get_option( 'toolbar_show_alignment', 'lasso_editor' );
92
+		$article_object = lasso_editor_get_option('article_class', 'lasso_editor');
93
+		$featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor');
94
+		$titleClass = lasso_editor_get_option('title_class', 'lasso_editor');
95
+
96
+		$post_new_disabled = lasso_editor_get_option('post_adding_disabled', 'lasso_editor');
97
+		$save_to_post_disabled  = lasso_editor_get_option('post_save_disabled', 'lasso_editor');
98
+		$post_settings_disabled = lasso_editor_get_option('post_settings_disabled', 'lasso_editor');
99
+		$allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor');
100
+		$allow_new_category = lasso_editor_get_option('allow_new_category', 'lasso_editor');
101
+		$shortcodify_disabled  = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor');
102
+		$enable_autosave = lasso_editor_get_option('enable_autosave', 'lasso_editor');
103
+
104
+		$toolbar_headings      = lasso_editor_get_option('toolbar_headings', 'lasso_editor');
105
+		$toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
106
+		$toolbar_show_color      = lasso_editor_get_option('toolbar_show_color', 'lasso_editor');
107
+		$toolbar_show_alignment  = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor');
108 108
 		
109
-		$objectsNoSave  	= lasso_editor_get_option('dont_save', 'lasso_editor');
110
-		$objectsNonEditable  	= lasso_editor_get_option('non_editable', 'lasso_editor');
109
+		$objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor');
110
+		$objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor');
111 111
 		$disable_tour = lasso_editor_get_option('disable_tour', 'lasso_editor');
112 112
 		$show_ignored_items = lasso_editor_get_option('show_ignored_items', 'lasso_editor');
113 113
 		$save_using_rest_disabled = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor');
114 114
 		
115
-		$default_post_types = apply_filters( 'lasso_allowed_post_types', array( 'post', 'page'));
116
-		$allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor',  $default_post_types);
115
+		$default_post_types = apply_filters('lasso_allowed_post_types', array('post', 'page'));
116
+		$allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', $default_post_types);
117 117
 		
118
-		$bold_tag = lasso_editor_get_option( 'bold_tag', 'lasso_editor',  "b");
119
-		$i_tag = lasso_editor_get_option( 'i_tag', 'lasso_editor',  "i");
118
+		$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor', "b");
119
+		$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor', "i");
120 120
 		
121 121
 		$insert_comp_ui = lasso_editor_get_option('insert_comp_ui', 'lasso_editor');
122 122
 		if (!$insert_comp_ui) {
@@ -126,31 +126,31 @@  discard block
 block discarded – undo
126 126
 ?>
127 127
 		<div class="wrap">
128 128
 
129
-	    	<h2><?php _e( 'Editus Settings', 'lasso' );?></h2>
129
+	    	<h2><?php _e('Editus Settings', 'lasso'); ?></h2>
130 130
 
131 131
 			<form id="lasso-editor-settings-form" class="lasso--form-settings" method="post" enctype="multipart/form-data">
132 132
 
133
-				<?php do_action('lasso_settings_before');?>
133
+				<?php do_action('lasso_settings_before'); ?>
134 134
 				
135 135
 				
136 136
 				
137
-				<h3><?php _e( 'Enable for:', 'lasso' );?></h3>
137
+				<h3><?php _e('Enable for:', 'lasso'); ?></h3>
138 138
 				<div class="lasso-editor-settings--option-wrap">
139 139
 					<div class="lasso-editor-settings--option-inner">
140 140
 						
141
-						<span class="lasso--setting-description"><?php _e( 'Enable Editus for the following post types.', 'lasso' );?></span>
141
+						<span class="lasso--setting-description"><?php _e('Enable Editus for the following post types.', 'lasso'); ?></span>
142 142
 						<?php
143 143
 						$args = array(
144 144
 							'public'   => true
145 145
 						);
146 146
 						 
147
-						$allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
148
-						$post_types = get_post_types( $args, 'objects' );
147
+						$allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types);
148
+						$post_types = get_post_types($args, 'objects');
149 149
 						 
150
-						foreach ( $post_types  as $post_type ) {
150
+						foreach ($post_types  as $post_type) {
151 151
 						   if ($post_type->name == 'attachment') continue;
152
-						   $checked ="";
153
-						   if (  in_array( $post_type->name, $allowed_post_types )  ) {
152
+						   $checked = "";
153
+						   if (in_array($post_type->name, $allowed_post_types)) {
154 154
 								$checked = 'checked="checked"';
155 155
 						   }
156 156
 						   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>';
@@ -160,76 +160,76 @@  discard block
 block discarded – undo
160 160
 				</div>
161 161
 				
162 162
 
163
-				<h3><?php _e( 'Internal Settings', 'lasso' );?></h3>
163
+				<h3><?php _e('Internal Settings', 'lasso'); ?></h3>
164 164
 				<div class="lasso-editor-settings--option-wrap">
165 165
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
166
-						<label><?php _e( 'Article Class', 'lasso' );?></label>
167
-						<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>
168
-						<input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr( $article_object );?>" placeholder=".entry-content">
166
+						<label><?php _e('Article Class', 'lasso'); ?></label>
167
+						<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>
168
+						<input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr($article_object); ?>" placeholder=".entry-content">
169 169
 					</div>
170 170
 				
171 171
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
172
-						<label><?php _e( 'Featured Image Class', 'lasso' );?></label>
173
-						<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>
174
-						<input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr( $featImgClass );?>" placeholder=".entry-content">
172
+						<label><?php _e('Featured Image Class', 'lasso'); ?></label>
173
+						<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>
174
+						<input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr($featImgClass); ?>" placeholder=".entry-content">
175 175
 					</div>
176 176
 				
177 177
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
178
-						<label><?php _e( 'Article Title Class', 'lasso' );?></label>
179
-						<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>
180
-						<input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr( $titleClass );?>" placeholder=".entry-content">
178
+						<label><?php _e('Article Title Class', 'lasso'); ?></label>
179
+						<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>
180
+						<input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr($titleClass); ?>" placeholder=".entry-content">
181 181
 					</div>
182 182
 				
183 183
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
184
-						<label><?php _e( 'Ignored Items to Save', 'lasso' );?></label>
185
-						<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>
186
-						<textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNoSave );?></textarea>
184
+						<label><?php _e('Ignored Items to Save', 'lasso'); ?></label>
185
+						<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>
186
+						<textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr($objectsNoSave); ?></textarea>
187 187
 					</div>
188 188
 				
189 189
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
190
-						<label><?php _e( 'Read Only Items', 'lasso' );?></label>
191
-						<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>
192
-						<textarea name="lasso_editor[non_editable]" id="lasso_editor[non_editable]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNonEditable );?></textarea>
190
+						<label><?php _e('Read Only Items', 'lasso'); ?></label>
191
+						<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>
192
+						<textarea name="lasso_editor[non_editable]" id="lasso_editor[non_editable]" placeholder=".classname, .another-class"><?php echo esc_attr($objectsNonEditable); ?></textarea>
193 193
 					</div>
194 194
 				
195 195
 					<div class="lasso-editor-settings--option-inner" >
196
-						<input type="checkbox" class="checkbox" name="lasso_editor[show_ignored_items]" id="lasso_editor[show_ignored_items]" <?php echo checked( $show_ignored_items, 'on' );?> >
197
-						<label for="lasso_editor[show_ignored_items]"> <?php _e( 'Show Ignored Items', 'lasso' );?></label>
198
-						<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>
196
+						<input type="checkbox" class="checkbox" name="lasso_editor[show_ignored_items]" id="lasso_editor[show_ignored_items]" <?php echo checked($show_ignored_items, 'on'); ?> >
197
+						<label for="lasso_editor[show_ignored_items]"> <?php _e('Show Ignored Items', 'lasso'); ?></label>
198
+						<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>
199 199
 					</div>
200 200
 				</div>
201 201
 
202
-				<h3><?php _e( 'Editor UI', 'lasso' );?></h3>
202
+				<h3><?php _e('Editor UI', 'lasso'); ?></h3>
203 203
 				<div class="lasso-editor-settings--option-wrap">
204 204
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
205
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked( $toolbar_headings, 'on' );?> >
206
-						<label for="lasso_editor[toolbar_headings]"><?php _e( 'Enable H2 and H3 Buttons', 'lasso' );?></label>
207
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set H2 and H3 settings.', 'lasso' );?></span>
205
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked($toolbar_headings, 'on'); ?> >
206
+						<label for="lasso_editor[toolbar_headings]"><?php _e('Enable H2 and H3 Buttons', 'lasso'); ?></label>
207
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set H2 and H3 settings.', 'lasso'); ?></span>
208 208
 
209 209
 					</div>
210 210
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
211
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings_h4]" id="lasso_editor[toolbar_headings_h4]" <?php echo checked( $toolbar_headings_h4, 'on' );?> >
212
-						<label for="lasso_editor[toolbar_headings_h4]"><?php _e( 'Enable H4/H5/H6 Buttons', 'lasso' );?></label>
213
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set H4/H5/H6 settings.', 'lasso' );?></span>
211
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings_h4]" id="lasso_editor[toolbar_headings_h4]" <?php echo checked($toolbar_headings_h4, 'on'); ?> >
212
+						<label for="lasso_editor[toolbar_headings_h4]"><?php _e('Enable H4/H5/H6 Buttons', 'lasso'); ?></label>
213
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set H4/H5/H6 settings.', 'lasso'); ?></span>
214 214
 
215 215
 					</div>
216 216
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
217
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_color]" id="lasso_editor[toolbar_show_color]" <?php echo checked( $toolbar_show_color, 'on' );?> >
218
-						<label for="lasso_editor[toolbar_show_color]"><?php _e( 'Enable Text Color Buttons', 'lasso' );?></label>
219
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set text colors.', 'lasso' );?></span>
217
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_color]" id="lasso_editor[toolbar_show_color]" <?php echo checked($toolbar_show_color, 'on'); ?> >
218
+						<label for="lasso_editor[toolbar_show_color]"><?php _e('Enable Text Color Buttons', 'lasso'); ?></label>
219
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set text colors.', 'lasso'); ?></span>
220 220
 
221 221
 					</div>
222 222
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
223
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_alignment]" id="lasso_editor[toolbar_show_alignment]" <?php echo checked( $toolbar_show_alignment, 'on' );?> >
224
-						<label for="lasso_editor[toolbar_show_alignment]"><?php _e( 'Enable Text Align Buttons', 'lasso' );?></label>
225
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set text alignment.', 'lasso' );?></span>
223
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_alignment]" id="lasso_editor[toolbar_show_alignment]" <?php echo checked($toolbar_show_alignment, 'on'); ?> >
224
+						<label for="lasso_editor[toolbar_show_alignment]"><?php _e('Enable Text Align Buttons', 'lasso'); ?></label>
225
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set text alignment.', 'lasso'); ?></span>
226 226
 
227 227
 					</div>
228 228
 					<div class="lasso-editor-settings--option-inner">
229
-					    <label for="lasso_editor[insert_comp_ui]"> <?php _e( 'Insert Component UI', 'lasso' );?></label>
230
-						<span class="lasso--setting-description"><?php _e( 'UI mechanism to insert components', 'lasso' );?></span>
231
-					    <input type="radio" name="lasso_editor[insert_comp_ui]" value='drag' <?php echo checked( $insert_comp_ui, 'drag' );?>> <?php _e( 'Drag and Drop', 'lasso' );?>
232
-						<input type="radio" name="lasso_editor[insert_comp_ui]" value="click" <?php echo checked( $insert_comp_ui, 'click' );?>> <?php _e( 'Click', 'lasso' );?>
229
+					    <label for="lasso_editor[insert_comp_ui]"> <?php _e('Insert Component UI', 'lasso'); ?></label>
230
+						<span class="lasso--setting-description"><?php _e('UI mechanism to insert components', 'lasso'); ?></span>
231
+					    <input type="radio" name="lasso_editor[insert_comp_ui]" value='drag' <?php echo checked($insert_comp_ui, 'drag'); ?>> <?php _e('Drag and Drop', 'lasso'); ?>
232
+						<input type="radio" name="lasso_editor[insert_comp_ui]" value="click" <?php echo checked($insert_comp_ui, 'click'); ?>> <?php _e('Click', 'lasso'); ?>
233 233
 					</div>
234 234
 				</div>
235 235
 				
@@ -237,82 +237,82 @@  discard block
 block discarded – undo
237 237
 				
238 238
 				
239 239
 
240
-				<h3><?php _e( 'Post Settings UI', 'lasso' );?></h3>
240
+				<h3><?php _e('Post Settings UI', 'lasso'); ?></h3>
241 241
 				<div class="lasso-editor-settings--option-wrap"  >
242 242
 					<div class="lasso-editor-settings--option-inner" style="border:none">
243
-						<input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked( $post_settings_disabled, 'on' );?> >
244
-						<label for="lasso_editor[post_settings_disabled]"> <?php _e( 'Disable Post Settings', 'lasso' );?></label>
245
-						<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>
243
+						<input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked($post_settings_disabled, 'on'); ?> >
244
+						<label for="lasso_editor[post_settings_disabled]"> <?php _e('Disable Post Settings', 'lasso'); ?></label>
245
+						<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>
246 246
 					</div>
247 247
 					
248 248
 					<div class="lasso-editor-settings--option-inner" style="border:none">
249
-						<input type="checkbox" class="checkbox" name="lasso_editor[allow_change_date]" id="lasso_editor[allow_change_date]" <?php echo checked( $allow_change_date, 'on' );?> >
250
-						<label for="lasso_editor[allow_change_date]"> <?php _e( 'Allow Changing Post Date', 'lasso' );?></label>
251
-						<span class="lasso--setting-description"><?php _e( 'Add the date selector to change the post\'s date to the Post Setting dialog', 'lasso' );?></span>
249
+						<input type="checkbox" class="checkbox" name="lasso_editor[allow_change_date]" id="lasso_editor[allow_change_date]" <?php echo checked($allow_change_date, 'on'); ?> >
250
+						<label for="lasso_editor[allow_change_date]"> <?php _e('Allow Changing Post Date', 'lasso'); ?></label>
251
+						<span class="lasso--setting-description"><?php _e('Add the date selector to change the post\'s date to the Post Setting dialog', 'lasso'); ?></span>
252 252
 					</div>
253 253
 					
254 254
 					<div class="lasso-editor-settings--option-inner" style="border:none">
255
-						<input type="checkbox" class="checkbox" name="lasso_editor[allow_new_category]" id="lasso_editor[allow_new_category]" <?php echo checked( $allow_new_category, 'on' );?> >
256
-						<label for="lasso_editor[allow_new_category]"> <?php _e( 'Allow Adding New Category', 'lasso' );?></label>
257
-						<span class="lasso--setting-description"><?php _e( 'Add the user to create new, previously non-existing categories for posts.', 'lasso' );?></span>
255
+						<input type="checkbox" class="checkbox" name="lasso_editor[allow_new_category]" id="lasso_editor[allow_new_category]" <?php echo checked($allow_new_category, 'on'); ?> >
256
+						<label for="lasso_editor[allow_new_category]"> <?php _e('Allow Adding New Category', 'lasso'); ?></label>
257
+						<span class="lasso--setting-description"><?php _e('Add the user to create new, previously non-existing categories for posts.', 'lasso'); ?></span>
258 258
 					</div>
259 259
 				
260 260
 					<div class="lasso-editor-settings--option-inner" >
261
-						<input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked( $post_new_disabled, 'on' );?> >
262
-						<label for="lasso_editor[post_adding_disabled]"><?php _e( 'Disable Post Adding', 'lasso' );?></label>
263
-						<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>
261
+						<input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked($post_new_disabled, 'on'); ?> >
262
+						<label for="lasso_editor[post_adding_disabled]"><?php _e('Disable Post Adding', 'lasso'); ?></label>
263
+						<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>
264 264
 					</div>
265 265
 					
266 266
 
267 267
 				</div>
268 268
 				
269
-				<h3><?php _e( 'Misc', 'lasso' );?></h3>
269
+				<h3><?php _e('Misc', 'lasso'); ?></h3>
270 270
 				<div class="lasso-editor-settings--option-wrap">
271 271
 					<div class="lasso-editor-settings--option-inner" style="border:none">
272
-						<input type="checkbox" class="checkbox" name="lasso_editor[disable_tour]" id="lasso_editor[disable_tour]" <?php echo checked( $disable_tour, 'on' );?> >
273
-						<label for="lasso_editor[disable_tour]"> <?php _e( 'Do Not Show Tour Dialog', 'lasso' );?></label>
274
-						<span class="lasso--setting-description"><?php _e( 'Check this box to disable the tour dialog box for all users.', 'lasso' );?></span>
272
+						<input type="checkbox" class="checkbox" name="lasso_editor[disable_tour]" id="lasso_editor[disable_tour]" <?php echo checked($disable_tour, 'on'); ?> >
273
+						<label for="lasso_editor[disable_tour]"> <?php _e('Do Not Show Tour Dialog', 'lasso'); ?></label>
274
+						<span class="lasso--setting-description"><?php _e('Check this box to disable the tour dialog box for all users.', 'lasso'); ?></span>
275 275
 					</div>
276 276
 
277 277
 					<div class="lasso-editor-settings--option-inner" style="border:none">
278
-					    <label for="lasso_editor[bold_tag]"> <?php _e( '"Bold" Tag', 'lasso' );?></label>
279
-						<span class="lasso--setting-description"><?php _e( 'Choose the HTML tag used for the "Bold" style.', 'lasso' );?></span>
280
-					    <input type="radio" name="lasso_editor[bold_tag]" value='b' <?php echo checked( $bold_tag, 'b' );?>> b
281
-						<input type="radio" name="lasso_editor[bold_tag]" value="strong" <?php echo checked( $bold_tag, 'strong' );?>> strong
278
+					    <label for="lasso_editor[bold_tag]"> <?php _e('"Bold" Tag', 'lasso'); ?></label>
279
+						<span class="lasso--setting-description"><?php _e('Choose the HTML tag used for the "Bold" style.', 'lasso'); ?></span>
280
+					    <input type="radio" name="lasso_editor[bold_tag]" value='b' <?php echo checked($bold_tag, 'b'); ?>> b
281
+						<input type="radio" name="lasso_editor[bold_tag]" value="strong" <?php echo checked($bold_tag, 'strong'); ?>> strong
282 282
 					</div>
283 283
 					<div class="lasso-editor-settings--option-inner" >
284
-					    <label for="lasso_editor[i_tag]"> <?php _e( '"Italic" Tag', 'lasso' );?></label>
285
-						<span class="lasso--setting-description"><?php _e( 'Choose the HTML tag used for the "Italic" style.', 'lasso' );?></span>
286
-					    <input type="radio" name="lasso_editor[i_tag]" value='i' <?php echo checked( $i_tag, 'i' );?>> i
287
-						<input type="radio" name="lasso_editor[i_tag]" value="em" <?php echo checked( $i_tag, 'em' );?>> em
284
+					    <label for="lasso_editor[i_tag]"> <?php _e('"Italic" Tag', 'lasso'); ?></label>
285
+						<span class="lasso--setting-description"><?php _e('Choose the HTML tag used for the "Italic" style.', 'lasso'); ?></span>
286
+					    <input type="radio" name="lasso_editor[i_tag]" value='i' <?php echo checked($i_tag, 'i'); ?>> i
287
+						<input type="radio" name="lasso_editor[i_tag]" value="em" <?php echo checked($i_tag, 'em'); ?>> em
288 288
 					</div>
289 289
 				</div>
290 290
 
291
-				<h3><?php _e( 'Advanced', 'lasso' );?></h3>
291
+				<h3><?php _e('Advanced', 'lasso'); ?></h3>
292 292
 				<div class="lasso-editor-settings--option-wrap ">
293 293
 					<div class="lasso-editor-settings--option-inner" style="border:none">
294
-						<input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked( $shortcodify_disabled, 'on' );?> >
295
-						<label for="lasso_editor[shortcodify_disabled]"><?php _e( 'Disable Aesop Component Conversion', 'lasso' );?></label>
296
-						<span class="lasso--setting-description"><?php _e( 'Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso' );?></span>
294
+						<input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked($shortcodify_disabled, 'on'); ?> >
295
+						<label for="lasso_editor[shortcodify_disabled]"><?php _e('Disable Aesop Component Conversion', 'lasso'); ?></label>
296
+						<span class="lasso--setting-description"><?php _e('Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso'); ?></span>
297 297
 					</div>
298 298
 				
299 299
 					<div class="lasso-editor-settings--option-inner" style="border:none">
300
-						<input type="checkbox" class="checkbox" name="lasso_editor[enable_autosave]" id="lasso_editor[enable_autosave]" <?php echo checked( $enable_autosave, 'on' );?> >
301
-						<label for="lasso_editor[enable_autosave]"><?php _e( 'Enable Auto Save', 'lasso' );?></label>
302
-						<span class="lasso--setting-description"><?php _e( 'Check this box to enable auto save.', 'lasso' );?></span>
300
+						<input type="checkbox" class="checkbox" name="lasso_editor[enable_autosave]" id="lasso_editor[enable_autosave]" <?php echo checked($enable_autosave, 'on'); ?> >
301
+						<label for="lasso_editor[enable_autosave]"><?php _e('Enable Auto Save', 'lasso'); ?></label>
302
+						<span class="lasso--setting-description"><?php _e('Check this box to enable auto save.', 'lasso'); ?></span>
303 303
 					</div>
304 304
 				
305 305
 					<div class="lasso-editor-settings--option-inner" style="border:none">
306
-						<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' );?> >
307
-						<label for="lasso_editor[post_save_disabled]"><?php _e( 'Disable Post Saving', 'lasso' );?></label>
308
-						<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>
306
+						<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'); ?> >
307
+						<label for="lasso_editor[post_save_disabled]"><?php _e('Disable Post Saving', 'lasso'); ?></label>
308
+						<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>
309 309
 
310 310
 					</div>
311 311
 				
312 312
 					<div class="lasso-editor-settings--option-inner">
313
-						<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' );?> >
314
-						<label for="lasso_editor[save_using_rest_disabled]"><?php _e( "Don't Use REST API to Save", 'lasso' );?></label>
315
-						<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>
313
+						<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'); ?> >
314
+						<label for="lasso_editor[save_using_rest_disabled]"><?php _e("Don't Use REST API to Save", 'lasso'); ?></label>
315
+						<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>
316 316
 
317 317
 					</div>
318 318
 				</div>
@@ -322,11 +322,11 @@  discard block
 block discarded – undo
322 322
 
323 323
 				<div class="lasso-editor-settings--submit">
324 324
 				    <input type="hidden" name="action" value="lasso-editor-settings" />
325
-				    <input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save Settings', 'lasso' );?>" />
326
-					<?php wp_nonce_field( 'nonce', 'lasso_editor_settings' ); ?>
325
+				    <input type="submit" class="button-primary" value="<?php esc_attr_e('Save Settings', 'lasso'); ?>" />
326
+					<?php wp_nonce_field('nonce', 'lasso_editor_settings'); ?>
327 327
 				</div>
328 328
 				
329
-				<?php do_action('lasso_settings_after');?>
329
+				<?php do_action('lasso_settings_after'); ?>
330 330
 			</form>
331 331
 
332 332
 		</div><?php
Please login to merge, or discard this patch.
lasso.php 1 patch
Spacing   +18 added lines, -18 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', '0.9.18.4' );
27
-define( 'LASSO_DIR', plugin_dir_path( __FILE__ ) );
28
-define( 'LASSO_URL', plugins_url( '', __FILE__ ) );
29
-define( 'LASSO_FILE', __FILE__ );
26
+define('LASSO_VERSION', '0.9.18.4');
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>Lasso 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
 
Please login to merge, or discard this patch.
public/includes/assets.php 1 patch
Spacing   +82 added lines, -82 removed lines patch added patch discarded remove patch
@@ -10,21 +10,21 @@  discard block
 block discarded – undo
10 10
 
11 11
 class assets {
12 12
 
13
-	public function __construct(){
13
+	public function __construct() {
14 14
 
15
-		add_action('wp_enqueue_scripts', array($this,'scripts'));
15
+		add_action('wp_enqueue_scripts', array($this, 'scripts'));
16 16
 	}
17 17
 
18
-	public function scripts(){
18
+	public function scripts() {
19 19
 
20 20
 	
21
-		if ( lasso_user_can('edit_posts')) {
21
+		if (lasso_user_can('edit_posts')) {
22 22
 
23 23
 			wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true);
24 24
 
25 25
             //don't load autocomplete if it's a stockholm theme
26
-			$themename  	= wp_get_theme()->get('Name');
27
-			if ($themename !='Stockholm' ) {
26
+			$themename = wp_get_theme()->get('Name');
27
+			if ($themename != 'Stockholm') {
28 28
 				wp_enqueue_script('jquery-ui-autocomplete');
29 29
 			}
30 30
 			wp_enqueue_script('jquery-ui-draggable');
@@ -37,27 +37,27 @@  discard block
 block discarded – undo
37 37
 			// url for json api
38 38
 			$home_url = function_exists('json_get_url_prefix') ? json_get_url_prefix() : false;
39 39
 
40
-			$article_object 	= lasso_editor_get_option('article_class','lasso_editor');
40
+			$article_object 	= lasso_editor_get_option('article_class', 'lasso_editor');
41 41
 
42
-			$article_object 	= empty( $article_object ) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object;
42
+			$article_object 	= empty($article_object) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object;
43 43
 
44
-			$featImgClass 		= lasso_editor_get_option('featimg_class','lasso_editor');
45
-			if (empty( $featImgClass )) {
44
+			$featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor');
45
+			if (empty($featImgClass)) {
46 46
 				$featImgClass = lasso_get_supported_theme_featured_image_class();
47 47
 			}
48
-			$titleClass 		= lasso_editor_get_option('title_class','lasso_editor');
49
-			if (empty( $titleClass )) {
48
+			$titleClass = lasso_editor_get_option('title_class', 'lasso_editor');
49
+			if (empty($titleClass)) {
50 50
 				$titleClass = lasso_get_supported_theme_title_class();
51 51
 			}
52
-			$toolbar_headings  	= lasso_editor_get_option('toolbar_headings', 'lasso_editor');
53
-			$toolbar_headings_h4  	= lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
52
+			$toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor');
53
+			$toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
54 54
 			$objectsNoSave  	= lasso_editor_get_option('dont_save', 'lasso_editor');
55
-			$objectsNonEditable  	= lasso_editor_get_option('non_editable', 'lasso_editor');
55
+			$objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor');
56 56
 			$disableRESTSave = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor');
57
-			$save_to_post_disabled  = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' );
57
+			$save_to_post_disabled = lasso_editor_get_option('post_save_disabled', 'lasso_editor');
58 58
 			
59
-			$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor','b');
60
-			$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor','i');
59
+			$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor', 'b');
60
+			$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor', 'i');
61 61
 
62 62
 			
63 63
 			//text alignement
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
 			
72 72
 			if ($show_color) {
73 73
 				//color picker
74
-				wp_enqueue_style( 'wp-color-picker' );
75
-				wp_enqueue_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 );
74
+				wp_enqueue_style('wp-color-picker');
75
+				wp_enqueue_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), false, 1);
76 76
 			}
77 77
 			
78 78
 			// click to insert components, not drag and drop
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 			
82 82
 			// custom fields
83 83
 			
84
-			$custom_fields = apply_filters( 'editus_custom_fields', null ); //array('testFieldName' => '#field1');
84
+			$custom_fields = apply_filters('editus_custom_fields', null); //array('testFieldName' => '#field1');
85 85
 
86 86
 
87 87
 
@@ -92,48 +92,48 @@  discard block
 block discarded – undo
92 92
             $delta = time() - $post_date;
93 93
 
94 94
 			$strings = array(
95
-				'save' 				=> __('Save','lasso'),
96
-				'saving' 			=> __('Saving...','lasso'),
97
-				'saved'				=> __('Saved!','lasso'),
98
-				'adding' 			=> __('Adding...','lasso'),
99
-				'added'				=> __('Added!','lasso'),
100
-				'loading' 			=> __('Loading...','lasso'),
101
-				'loadMore'			=> __('Load More','lasso'),
102
-				'close'			=> __('Close','lasso'),
103
-				'noPostsFound'		=> __('No more posts found','lasso'),
104
-				'fetchFail'	    	=> __('Fetching failed.','lasso'),
105
-				'galleryCreated' 	=> __('Gallery Created!','lasso'),
106
-				'galleryUpdated' 	=> __('Gallery Updated!','lasso'),
107
-				'justWrite'			=> __('Just write...','lasso'),
108
-				'chooseImage'		=> __('Choose an image','lasso'),
109
-				'updateImage'		=> __('Update Image','lasso'),
110
-				'insertImage'		=> __('Insert Image','lasso'),
111
-				'selectImage'		=> __('Select Image','lasso'),
112
-				'removeFeatImg'     => __('Remove featured image?','lasso'),
113
-				'updateSelectedImg' => __('Update Selected Image','lasso'),
114
-				'chooseImages'		=> __('Choose images','lasso'),
115
-				'editImage'			=> __('Edit Image','lasso'),
116
-				'addImages'			=> __('Add Images','lasso'),
117
-				'addNewGallery'		=> __('Add New Gallery','lasso'),
118
-				'selectGallery'		=> __('Select Lasso Gallery Image','lasso'),
119
-				'useSelectedImages' => __('Use Selected Images','lasso'),
120
-				'publishPost'		=> __('Publish Post?','lasso'),
121
-				'publishYes'		=> __('Yes, publish it!','lasso'),
122
-				'deletePost'		=> __('Trash Post?','lasso'),
123
-				'deleteYes'			=> __('Yes, trash it!','lasso'),
124
-				'warning'			=> __('Oh snap!','laso'),
125
-				'cancelText'		=> __('O.K. got it!','lasso'),
126
-				'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'),
95
+				'save' 				=> __('Save', 'lasso'),
96
+				'saving' 			=> __('Saving...', 'lasso'),
97
+				'saved'				=> __('Saved!', 'lasso'),
98
+				'adding' 			=> __('Adding...', 'lasso'),
99
+				'added'				=> __('Added!', 'lasso'),
100
+				'loading' 			=> __('Loading...', 'lasso'),
101
+				'loadMore'			=> __('Load More', 'lasso'),
102
+				'close'			=> __('Close', 'lasso'),
103
+				'noPostsFound'		=> __('No more posts found', 'lasso'),
104
+				'fetchFail'	    	=> __('Fetching failed.', 'lasso'),
105
+				'galleryCreated' 	=> __('Gallery Created!', 'lasso'),
106
+				'galleryUpdated' 	=> __('Gallery Updated!', 'lasso'),
107
+				'justWrite'			=> __('Just write...', 'lasso'),
108
+				'chooseImage'		=> __('Choose an image', 'lasso'),
109
+				'updateImage'		=> __('Update Image', 'lasso'),
110
+				'insertImage'		=> __('Insert Image', 'lasso'),
111
+				'selectImage'		=> __('Select Image', 'lasso'),
112
+				'removeFeatImg'     => __('Remove featured image?', 'lasso'),
113
+				'updateSelectedImg' => __('Update Selected Image', 'lasso'),
114
+				'chooseImages'		=> __('Choose images', 'lasso'),
115
+				'editImage'			=> __('Edit Image', 'lasso'),
116
+				'addImages'			=> __('Add Images', 'lasso'),
117
+				'addNewGallery'		=> __('Add New Gallery', 'lasso'),
118
+				'selectGallery'		=> __('Select Lasso Gallery Image', 'lasso'),
119
+				'useSelectedImages' => __('Use Selected Images', 'lasso'),
120
+				'publishPost'		=> __('Publish Post?', 'lasso'),
121
+				'publishYes'		=> __('Yes, publish it!', 'lasso'),
122
+				'deletePost'		=> __('Trash Post?', 'lasso'),
123
+				'deleteYes'			=> __('Yes, trash it!', 'lasso'),
124
+				'warning'			=> __('Oh snap!', 'laso'),
125
+				'cancelText'		=> __('O.K. got it!', 'lasso'),
126
+				'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'),
127 127
 				'missingConfirm'	=> __('Update Settings', 'lasso'),
128
-				'helperText'		=> __('one more letter','lasso'),
128
+				'helperText'		=> __('one more letter', 'lasso'),
129 129
 				'editingBackup'  	=> __('You are currently editing a backup copy of this post.'),
130 130
 			);
131 131
 
132
-			$api_url = trailingslashit( home_url() ) . 'lasso-internal-api';
132
+			$api_url = trailingslashit(home_url()).'lasso-internal-api';
133 133
 
134 134
 			$gallery_class = new gallery();
135 135
 			$gallery_nonce_action = $gallery_class->nonce_action;
136
-			$gallery_nonce = wp_create_nonce( $gallery_nonce_action );
136
+			$gallery_nonce = wp_create_nonce($gallery_nonce_action);
137 137
 			
138 138
 			
139 139
             if ($allow_change_date) {
@@ -148,13 +148,13 @@  discard block
 block discarded – undo
148 148
 			  
149 149
 			if (function_exists('rest_url')) {
150 150
 				//$rest_root = esc_url_raw( rest_url());
151
-				$rest_nonce = wp_create_nonce( 'wp_rest' );
152
-				$settings = array( 'root' => $rest_root, 'nonce' => $rest_nonce );
153
-				wp_enqueue_script( 'wp-api', '', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
154
-				wp_localize_script( 'wp-api', 'wpApiSettings', $settings );
155
-				wp_localize_script( 'wp-api', 'WP_API_Settings', $settings );
151
+				$rest_nonce = wp_create_nonce('wp_rest');
152
+				$settings = array('root' => $rest_root, 'nonce' => $rest_nonce);
153
+				wp_enqueue_script('wp-api', '', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true);
154
+				wp_localize_script('wp-api', 'wpApiSettings', $settings);
155
+				wp_localize_script('wp-api', 'WP_API_Settings', $settings);
156 156
 				
157
-				if ( class_exists( 'WP_REST_Controller' )) {
157
+				if (class_exists('WP_REST_Controller')) {
158 158
 					// we are using REST API V2
159 159
 					$using_restapiv2 = true;
160 160
 				}
@@ -162,8 +162,8 @@  discard block
 block discarded – undo
162 162
 
163 163
 			// localized objects
164 164
 			$objects = array(
165
-				'ajaxurl' 			=> esc_url( $api_url ),
166
-				'ajaxurl2' 			=> esc_url( admin_url( 'admin-ajax.php' )),
165
+				'ajaxurl' 			=> esc_url($api_url),
166
+				'ajaxurl2' 			=> esc_url(admin_url('admin-ajax.php')),
167 167
 				'rest_root'         => $rest_root,
168 168
 				'rest_nonce'        => $rest_nonce,
169 169
 				'editor' 			=> 'lasso--content', // ID of editable content (without #) DONT CHANGE
@@ -171,13 +171,13 @@  discard block
 block discarded – undo
171 171
 				'featImgClass'		=> $featImgClass,
172 172
 				'titleClass'		=> $titleClass,
173 173
 				'strings'			=> $strings,
174
-				'settingsLink'		=> function_exists('is_multisite') && is_multisite() ? network_admin_url( 'settings.php?page=lasso-editor' ) : admin_url( 'admin.php?page=lasso-editor-settings' ),
175
-				'post_status'		=> get_post_status( $postid ),
174
+				'settingsLink'		=> function_exists('is_multisite') && is_multisite() ? network_admin_url('settings.php?page=lasso-editor') : admin_url('admin.php?page=lasso-editor-settings'),
175
+				'post_status'		=> get_post_status($postid),
176 176
 				'postid'			=> $postid,
177 177
 				'permalink'			=> $permalink,
178 178
 				'edit_others_pages'	=> current_user_can('edit_others_pages') ? true : false,
179 179
 				'edit_others_posts'	=> current_user_can('edit_others_posts') ? true : false,
180
-				'userCanEdit'		=> current_user_can('edit_post', $postid ),
180
+				'userCanEdit'		=> current_user_can('edit_post', $postid),
181 181
 				'can_publish_posts'	=> current_user_can('publish_posts'),
182 182
 				'can_publish_pages'	=> current_user_can('publish_pages'),
183 183
 				'author'			=> is_user_logged_in() ? get_current_user_ID() : false,
@@ -212,25 +212,25 @@  discard block
 block discarded – undo
212 212
 				'postTags'    		=> lasso_get_objects('tag'),
213 213
 				'noResultsDiv'		=> lasso_editor_empty_results(),
214 214
 				'noRevisionsDiv'	=> lasso_editor_empty_results('revision'),
215
-				'mapTileProvider'   => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider( $postid ) : false,
216
-				'mapLocations'		=> get_post_meta( $postid, 'ase_map_component_locations' ),
217
-				'mapStart'			=> get_post_meta( $postid, 'ase_map_component_start_point', true ),
218
-				'mapZoom'			=> get_post_meta( $postid, 'ase_map_component_zoom', true ),
215
+				'mapTileProvider'   => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider($postid) : false,
216
+				'mapLocations'		=> get_post_meta($postid, 'ase_map_component_locations'),
217
+				'mapStart'			=> get_post_meta($postid, 'ase_map_component_start_point', true),
218
+				'mapZoom'			=> get_post_meta($postid, 'ase_map_component_zoom', true),
219 219
 				'revisionModal' 	=> lasso_editor_revision_modal(),
220 220
 				'isMobile'          => wp_is_mobile(),
221
-				'enableAutoSave'    => lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ),
221
+				'enableAutoSave'    => lasso_editor_get_option('enable_autosave', 'lasso_editor'),
222 222
 				'showColor'         => $show_color,
223 223
 				'showAlignment'     => $show_align,
224 224
 				'showIgnoredItems'  => lasso_editor_get_option('show_ignored_items', 'lasso_editor'),
225 225
 				'restapi2'          => $using_restapiv2,
226 226
 				'saveusingrest'     => $using_restapiv2 && !$disableRESTSave,
227
-				'newObjectContent'  => apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso') ),
227
+				'newObjectContent'  => apply_filters('lasso_new_object_content', __('Once upon a time...', 'lasso')),
228 228
 				'disableSavePost'   => $save_to_post_disabled,
229 229
 				'boldTag'           => $bold_tag,
230 230
 				'iTag'           	=> $i_tag,
231 231
 				'customFields'      => $custom_fields,
232
-				'clickToInsert'     => ($insert_comp_ui =='click'),                
233
-				'skipToEdit'        =>( $delta < 10 ) // if it's a new post, skip to edit mode
232
+				'clickToInsert'     => ($insert_comp_ui == 'click'),                
233
+				'skipToEdit'        =>($delta < 10) // if it's a new post, skip to edit mode
234 234
 			);
235 235
 
236 236
 
@@ -239,9 +239,9 @@  discard block
 block discarded – undo
239 239
 			
240 240
 			if (!$using_restapiv2) {
241 241
                // enqueue REST API V1
242
-			   wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
243
-			   $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) );
244
-			   wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings );
242
+			   wp_enqueue_script('wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true);
243
+			   $settings = array('root' => home_url($home_url), 'nonce' => wp_create_nonce('wp_json'));
244
+			   wp_localize_script('wp-api-js', 'WP_API_Settings', $settings);
245 245
 			}
246 246
 			
247 247
 			if ($allow_change_date) {
@@ -250,13 +250,13 @@  discard block
 block discarded – undo
250 250
 				wp_enqueue_style('jquery-ui');
251 251
 			}
252 252
 
253
-			$postfix = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? '' : '.min';
253
+			$postfix = (defined('SCRIPT_DEBUG') && true === SCRIPT_DEBUG) ? '' : '.min';
254 254
 			if ($show_color) {
255
-				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true);
255
+				wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api', 'iris'), LASSO_VERSION, true);
256 256
 			} else {
257
-			    wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
257
+			    wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
258 258
 			}
259
-			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) );
259
+			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects));
260 260
 
261 261
 
262 262
 		}
Please login to merge, or discard this patch.