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