Completed
Push — master ( eca6c0...ce8812 )
by
unknown
02:10
created
public/includes/lasso.php 2 patches
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -261,14 +261,14 @@  discard block
 block discarded – undo
261 261
 		$out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' );
262 262
 	}
263 263
 	
264
-    // new ajax function to lock post for editing
264
+	// new ajax function to lock post for editing
265 265
 	public function editus_lock_post()
266 266
 	{
267 267
 		$post_id= $_POST["postid"];
268 268
 		$locked = wp_check_post_lock($post_id);
269 269
 		
270 270
 		if (!$locked) {
271
-		    wp_set_post_lock($post_id);
271
+			wp_set_post_lock($post_id);
272 272
 			echo "true";
273 273
 		} else {
274 274
 			$user_info = get_userdata($locked);
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 		$cats  = isset( $data['story_cats'] ) ? $data['story_cats'] : false;
318 318
 		
319 319
 		//debug line
320
-        file_put_contents(WP_PLUGIN_DIR."/file1.txt", $cats);
320
+		file_put_contents(WP_PLUGIN_DIR."/file1.txt", $cats);
321 321
 		self::set_post_terms( $postid, $cats, 'category' );
322 322
 		
323 323
 		// update tags
@@ -368,59 +368,59 @@  discard block
 block discarded – undo
368 368
 		 );
369 369
 		foreach ($_POST as $key => $value) {
370 370
 			if ($key !="code" && $key !="action") {
371
-			    //$shortcode = $shortcode.$key.'="'.$value.'" ';
371
+				//$shortcode = $shortcode.$key.'="'.$value.'" ';
372 372
 				$atts[$key] = $value;
373 373
 			}
374 374
 		}
375 375
 		if ($code == "aesop_video") {
376
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
377
-		    echo aesop_video_shortcode($atts);
376
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
377
+			echo aesop_video_shortcode($atts);
378 378
 		}
379 379
 		else if ($code == "aesop_image") {
380
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
381
-		    echo aesop_image_shortcode($atts);
380
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
381
+			echo aesop_image_shortcode($atts);
382 382
 		}
383 383
 		else if ($code == "aesop_quote") {
384
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
385
-		    echo aesop_quote_shortcode($atts);
384
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
385
+			echo aesop_quote_shortcode($atts);
386 386
 		}
387 387
 		else if ($code == "aesop_parallax") {
388
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
389
-		    echo aesop_parallax_shortcode($atts);
388
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
389
+			echo aesop_parallax_shortcode($atts);
390 390
 		}
391 391
 		else if ($code == "aesop_character") {
392
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
393
-		    echo aesop_character_shortcode($atts);
392
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
393
+			echo aesop_character_shortcode($atts);
394 394
 		}
395 395
 		else if ($code == "aesop_collection") {
396
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
397
-		    echo aesop_collection_shortcode($atts);
396
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
397
+			echo aesop_collection_shortcode($atts);
398 398
 		}
399 399
 		else if ($code == "aesop_chapter") {
400
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
401
-		    echo aesop_chapter_shortcode($atts);
400
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
401
+			echo aesop_chapter_shortcode($atts);
402 402
 		}
403 403
 		else if ($code == "aesop_content") {
404
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
405
-		    echo aesop_content_shortcode($atts, $atts['content_data']);
404
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
405
+			echo aesop_content_shortcode($atts, $atts['content_data']);
406 406
 		}
407 407
 		else if ($code == "aesop_gallery") {
408
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
409
-		    echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
408
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
409
+			echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
410 410
 		}
411 411
 		else if ($code == "aesop_audio") {
412
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
413
-		    echo aesop_audio_shortcode($atts);
412
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
413
+			echo aesop_audio_shortcode($atts);
414 414
 		}
415 415
 		else {
416 416
 			$code = '['.$code.' ';
417 417
 			foreach ($atts as $key => $value) {
418
-			    $code = ''.$key.'="'.$value.'" ';
418
+				$code = ''.$key.'="'.$value.'" ';
419 419
 			}
420 420
 			$code = $code.']';
421 421
 			echo do_shortcode($code);
422
-		    //require_once( ABSPATH . '/wp-content/plugins/aesop-events/public/includes/shortcode.php');
423
-		    //echo aesop_audio_shortcode($atts);
422
+			//require_once( ABSPATH . '/wp-content/plugins/aesop-events/public/includes/shortcode.php');
423
+			//echo aesop_audio_shortcode($atts);
424 424
 		}
425 425
 		
426 426
 		exit; 
@@ -431,14 +431,14 @@  discard block
 block discarded – undo
431 431
 			$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
432 432
 			
433 433
 			if ($taxonomy =='category') {
434
-                // convert from names to category ids
434
+				// convert from names to category ids
435 435
 				$cats = array();
436 436
 				foreach ($value as $cat) {
437 437
 					$cat_id = get_cat_ID($cat);
438 438
 					if ($cat_id !=0) {
439 439
 						$cats [] = $cat_id;
440 440
 					} else if ($allow_new_category) {
441
-					    $cats [] = wp_create_category($cat);
441
+						$cats [] = wp_create_category($cat);
442 442
 					}
443 443
 				}
444 444
 				$value = $cats;
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 	
461 461
 	public function set_date( $postid, $value) {
462 462
 		if( $value ) {
463
-            wp_update_post(
463
+			wp_update_post(
464 464
 				array (
465 465
 					'ID'            => $postid, // ID of the post to update
466 466
 					'post_date'     => date( 'Y-m-d H:i:s',  strtotime($value) ),
Please login to merge, or discard this patch.
Spacing   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -52,16 +52,16 @@  discard block
 block discarded – undo
52 52
 		require_once LASSO_DIR.'/public/includes/wrap-shortcodes.php';
53 53
 
54 54
 		// Activate plugin when new blog is added
55
-		add_action( 'wpmu_new_blog', array( $this, 'activate_new_site' ) );
55
+		add_action('wpmu_new_blog', array($this, 'activate_new_site'));
56 56
 
57 57
 		// Load plugin text domain
58
-		add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
58
+		add_action('init', array($this, 'load_plugin_textdomain'));
59 59
 		
60
-		add_action( 'wp_ajax_get_aesop_component',     array( $this, 'get_aesop_component' ) );
61
-		add_action( 'wp_ajax_editus_do_shortcode',     array( $this, 'editus_do_shortcode' ) );
62
-		add_action( 'wp_ajax_editus_lock_post',     array( $this, 'editus_lock_post' ) );
63
-		add_action( 'wp_ajax_editus_hide_tour',     array( $this, 'editus_hide_tour' ) );
64
-		add_action( 'wp_ajax_editus_set_post_setting',     array( $this, 'editus_set_post_setting' ) );
60
+		add_action('wp_ajax_get_aesop_component', array($this, 'get_aesop_component'));
61
+		add_action('wp_ajax_editus_do_shortcode', array($this, 'editus_do_shortcode'));
62
+		add_action('wp_ajax_editus_lock_post', array($this, 'editus_lock_post'));
63
+		add_action('wp_ajax_editus_hide_tour', array($this, 'editus_hide_tour'));
64
+		add_action('wp_ajax_editus_set_post_setting', array($this, 'editus_set_post_setting'));
65 65
 
66 66
 		// enable saving custom fields through REST API
67 67
 		self::enable_metasave('post');
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 	public static function get_instance() {
93 93
 
94 94
 		// If the single instance hasn't been set, set it now.
95
-		if ( null == self::$instance ) {
95
+		if (null == self::$instance) {
96 96
 			self::$instance = new self;
97 97
 		}
98 98
 
@@ -109,18 +109,18 @@  discard block
 block discarded – undo
109 109
 	 *                                       WPMU is disabled or plugin is
110 110
 	 *                                       activated on an individual blog.
111 111
 	 */
112
-	public static function activate( $network_wide ) {
112
+	public static function activate($network_wide) {
113 113
 
114
-		if ( function_exists( 'is_multisite' ) && is_multisite() ) {
114
+		if (function_exists('is_multisite') && is_multisite()) {
115 115
 
116
-			if ( $network_wide  ) {
116
+			if ($network_wide) {
117 117
 
118 118
 				// Get all blog ids
119 119
 				$blog_ids = self::get_blog_ids();
120 120
 
121
-				foreach ( $blog_ids as $blog_id ) {
121
+				foreach ($blog_ids as $blog_id) {
122 122
 
123
-					switch_to_blog( $blog_id );
123
+					switch_to_blog($blog_id);
124 124
 					self::single_activate();
125 125
 				}
126 126
 
@@ -146,18 +146,18 @@  discard block
 block discarded – undo
146 146
 	 *                                       WPMU is disabled or plugin is
147 147
 	 *                                       deactivated on an individual blog.
148 148
 	 */
149
-	public static function deactivate( $network_wide ) {
149
+	public static function deactivate($network_wide) {
150 150
 
151
-		if ( function_exists( 'is_multisite' ) && is_multisite() ) {
151
+		if (function_exists('is_multisite') && is_multisite()) {
152 152
 
153
-			if ( $network_wide ) {
153
+			if ($network_wide) {
154 154
 
155 155
 				// Get all blog ids
156 156
 				$blog_ids = self::get_blog_ids();
157 157
 
158
-				foreach ( $blog_ids as $blog_id ) {
158
+				foreach ($blog_ids as $blog_id) {
159 159
 
160
-					switch_to_blog( $blog_id );
160
+					switch_to_blog($blog_id);
161 161
 					self::single_deactivate();
162 162
 
163 163
 				}
@@ -181,13 +181,13 @@  discard block
 block discarded – undo
181 181
 	 *
182 182
 	 * @param int     $blog_id ID of the new blog.
183 183
 	 */
184
-	public function activate_new_site( $blog_id ) {
184
+	public function activate_new_site($blog_id) {
185 185
 
186
-		if ( 1 !== did_action( 'wpmu_new_blog' ) ) {
186
+		if (1 !== did_action('wpmu_new_blog')) {
187 187
 			return;
188 188
 		}
189 189
 
190
-		switch_to_blog( $blog_id );
190
+		switch_to_blog($blog_id);
191 191
 		self::single_activate();
192 192
 		restore_current_blog();
193 193
 
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 			WHERE archived = '0' AND spam = '0'
213 213
 			AND deleted = '0'";
214 214
 
215
-		return $wpdb->get_col( $sql );
215
+		return $wpdb->get_col($sql);
216 216
 
217 217
 	}
218 218
 
@@ -223,18 +223,18 @@  discard block
 block discarded – undo
223 223
 	 */
224 224
 	private static function single_activate() {
225 225
 
226
-		$curr_version = get_option( 'lasso_version' );
226
+		$curr_version = get_option('lasso_version');
227 227
 
228 228
 		// update upgraded from
229
-		if ( $curr_version ) {
230
-			update_option( 'lasso_updated_from', $curr_version );
229
+		if ($curr_version) {
230
+			update_option('lasso_updated_from', $curr_version);
231 231
 		}
232 232
 
233 233
 		// update lasso version option
234
-		update_option( 'lasso_version', LASSO_VERSION );
234
+		update_option('lasso_version', LASSO_VERSION);
235 235
 
236 236
 		// set transietn for activation welcome
237
-		set_transient( '_lasso_welcome_redirect', true, 30 );
237
+		set_transient('_lasso_welcome_redirect', true, 30);
238 238
 
239 239
 
240 240
 	}
@@ -256,15 +256,15 @@  discard block
 block discarded – undo
256 256
 	public function load_plugin_textdomain() {
257 257
 
258 258
 		$domain = $this->plugin_slug;
259
-		$locale = apply_filters( 'plugin_locale', get_locale(), $domain );
259
+		$locale = apply_filters('plugin_locale', get_locale(), $domain);
260 260
 
261
-		$out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' );
261
+		$out = load_textdomain($domain, trailingslashit(LASSO_DIR).'languages/'.$domain.'-'.$locale.'.mo');
262 262
 	}
263 263
 	
264 264
     // new ajax function to lock post for editing
265 265
 	public function editus_lock_post()
266 266
 	{
267
-		$post_id= $_POST["postid"];
267
+		$post_id = $_POST["postid"];
268 268
 		$locked = wp_check_post_lock($post_id);
269 269
 		
270 270
 		if (!$locked) {
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 			echo "true";
273 273
 		} else {
274 274
 			$user_info = get_userdata($locked);
275
-			echo "Post opened by ".$user_info->first_name .  " " . $user_info->last_name;
275
+			echo "Post opened by ".$user_info->first_name." ".$user_info->last_name;
276 276
 		}
277 277
 		exit;
278 278
 	}
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 	{
283 283
 		$user_id = get_current_user_ID();
284 284
 				
285
-		update_user_meta( $user_id, 'lasso_hide_tour', true );
285
+		update_user_meta($user_id, 'lasso_hide_tour', true);
286 286
 		exit;
287 287
 	}
288 288
 	
@@ -293,14 +293,14 @@  discard block
 block discarded – undo
293 293
 		$data = array();
294 294
 		parse_str($_POST['data'], $data);
295 295
 		
296
-		if (!wp_verify_nonce( $data[ 'nonce' ], 'lasso-update-post-settings' )) {
296
+		if (!wp_verify_nonce($data['nonce'], 'lasso-update-post-settings')) {
297 297
 			wp_send_json_error();
298 298
 			exit;
299 299
 		}
300 300
 		
301
-		$status = isset( $data['status'] ) ? $data['status'] : false;
302
-		$postid = isset( $data['postid'] ) ? $data['postid'] : false;
303
-		$slug   = isset( $data['story_slug'] ) ? $data['story_slug'] : false;
301
+		$status = isset($data['status']) ? $data['status'] : false;
302
+		$postid = isset($data['postid']) ? $data['postid'] : false;
303
+		$slug   = isset($data['story_slug']) ? $data['story_slug'] : false;
304 304
 	
305 305
 
306 306
 		$args = array(
@@ -311,35 +311,35 @@  discard block
 block discarded – undo
311 311
 		
312 312
 		
313 313
 
314
-		wp_update_post( apply_filters( 'lasso_object_status_update_args', $args ) );
314
+		wp_update_post(apply_filters('lasso_object_status_update_args', $args));
315 315
 		
316 316
 		// update categories
317
-		$cats  = isset( $data['story_cats'] ) ? $data['story_cats'] : false;
317
+		$cats = isset($data['story_cats']) ? $data['story_cats'] : false;
318 318
 		
319 319
 		//debug line
320 320
         file_put_contents(WP_PLUGIN_DIR."/file1.txt", $cats);
321
-		self::set_post_terms( $postid, $cats, 'category' );
321
+		self::set_post_terms($postid, $cats, 'category');
322 322
 		
323 323
 		// update tags
324
-		$tags = isset( $data['story_tags'] ) ? $data['story_tags'] : false;
325
-		self::set_post_terms( $postid, $tags, 'post_tag' );
324
+		$tags = isset($data['story_tags']) ? $data['story_tags'] : false;
325
+		self::set_post_terms($postid, $tags, 'post_tag');
326 326
 		
327 327
 		//update date
328
-		$date  = isset( $data['post_date'] ) ? $data['post_date'] : false;
329
-		self::set_date( $postid, $date );
328
+		$date = isset($data['post_date']) ? $data['post_date'] : false;
329
+		self::set_date($postid, $date);
330 330
 		
331
-		do_action( 'lasso_post_updated', $postid, $slug, $status, get_current_user_ID() );
331
+		do_action('lasso_post_updated', $postid, $slug, $status, get_current_user_ID());
332 332
 		wp_send_json_success();
333 333
 		exit;
334 334
 	}
335 335
 	
336 336
 	public static function enable_metasave($type)
337 337
 	{
338
-		register_rest_field( $type, 'metadata', array(
339
-			'get_callback' => function ( $data ) {
340
-				return get_post_meta( $data['id']);//, '', '' );
338
+		register_rest_field($type, 'metadata', array(
339
+			'get_callback' => function($data) {
340
+				return get_post_meta($data['id']); //, '', '' );
341 341
 			}, 
342
-			'update_callback' => function( $data, $post ) {
342
+			'update_callback' => function($data, $post) {
343 343
 				foreach ($data as $key => $value) {
344 344
 					update_post_meta($post->ID, $key, $value);
345 345
 				}
@@ -351,10 +351,10 @@  discard block
 block discarded – undo
351 351
 	public function editus_do_shortcode()
352 352
 	{
353 353
 		
354
-		$code= $_POST["code"];
354
+		$code = $_POST["code"];
355 355
 		$code = str_replace('\"', '"', $code);
356
-		$out = lasso_wrap_shortcodes( $code);
357
-		$out =  do_shortcode($out);
356
+		$out = lasso_wrap_shortcodes($code);
357
+		$out = do_shortcode($out);
358 358
 		echo $out;
359 359
 		exit;
360 360
 	}
@@ -363,53 +363,53 @@  discard block
 block discarded – undo
363 363
 	{
364 364
 		
365 365
 		
366
-		$code= $_POST["code"];
366
+		$code = $_POST["code"];
367 367
 		$atts = array(
368 368
 		 );
369 369
 		foreach ($_POST as $key => $value) {
370
-			if ($key !="code" && $key !="action") {
370
+			if ($key != "code" && $key != "action") {
371 371
 			    //$shortcode = $shortcode.$key.'="'.$value.'" ';
372 372
 				$atts[$key] = $value;
373 373
 			}
374 374
 		}
375 375
 		if ($code == "aesop_video") {
376
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
376
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
377 377
 		    echo aesop_video_shortcode($atts);
378 378
 		}
379 379
 		else if ($code == "aesop_image") {
380
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
380
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
381 381
 		    echo aesop_image_shortcode($atts);
382 382
 		}
383 383
 		else if ($code == "aesop_quote") {
384
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
384
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
385 385
 		    echo aesop_quote_shortcode($atts);
386 386
 		}
387 387
 		else if ($code == "aesop_parallax") {
388
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
388
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
389 389
 		    echo aesop_parallax_shortcode($atts);
390 390
 		}
391 391
 		else if ($code == "aesop_character") {
392
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
392
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
393 393
 		    echo aesop_character_shortcode($atts);
394 394
 		}
395 395
 		else if ($code == "aesop_collection") {
396
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
396
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
397 397
 		    echo aesop_collection_shortcode($atts);
398 398
 		}
399 399
 		else if ($code == "aesop_chapter") {
400
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
400
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
401 401
 		    echo aesop_chapter_shortcode($atts);
402 402
 		}
403 403
 		else if ($code == "aesop_content") {
404
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
404
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
405 405
 		    echo aesop_content_shortcode($atts, $atts['content_data']);
406 406
 		}
407 407
 		else if ($code == "aesop_gallery") {
408
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
409
-		    echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
408
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
409
+		    echo do_shortcode('[aesop_gallery id="'.$atts["id"].'"]');
410 410
 		}
411 411
 		else if ($code == "aesop_audio") {
412
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
412
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
413 413
 		    echo aesop_audio_shortcode($atts);
414 414
 		}
415 415
 		else {
@@ -425,17 +425,17 @@  discard block
 block discarded – undo
425 425
 		
426 426
 		exit; 
427 427
 	}
428
-	public function set_post_terms( $postid, $value, $taxonomy ) {
429
-		if( $value ) {
430
-			$value = explode( ',', $value );
431
-			$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
428
+	public function set_post_terms($postid, $value, $taxonomy) {
429
+		if ($value) {
430
+			$value = explode(',', $value);
431
+			$allow_new_category = lasso_editor_get_option('allow_new_category', 'lasso_editor');
432 432
 			
433
-			if ($taxonomy =='category') {
433
+			if ($taxonomy == 'category') {
434 434
                 // convert from names to category ids
435 435
 				$cats = array();
436 436
 				foreach ($value as $cat) {
437 437
 					$cat_id = get_cat_ID($cat);
438
-					if ($cat_id !=0) {
438
+					if ($cat_id != 0) {
439 439
 						$cats [] = $cat_id;
440 440
 					} else if ($allow_new_category) {
441 441
 					    $cats [] = wp_create_category($cat);
@@ -444,27 +444,27 @@  discard block
 block discarded – undo
444 444
 				$value = $cats;
445 445
 			}
446 446
 	
447
-			$result = wp_set_object_terms( $postid, $value, $taxonomy );
447
+			$result = wp_set_object_terms($postid, $value, $taxonomy);
448 448
 		}
449
-		else  {
449
+		else {
450 450
 			//remove all terms from post
451
-			$result = wp_set_object_terms( $postid, null, $taxonomy );
451
+			$result = wp_set_object_terms($postid, null, $taxonomy);
452 452
 		}
453 453
 
454
-		if ( ! is_wp_error( $result ) ) {
454
+		if (!is_wp_error($result)) {
455 455
 			return true;
456
-		}else{
456
+		} else {
457 457
 			return false;
458 458
 		}
459 459
 	}
460 460
 	
461
-	public function set_date( $postid, $value) {
462
-		if( $value ) {
461
+	public function set_date($postid, $value) {
462
+		if ($value) {
463 463
             wp_update_post(
464
-				array (
464
+				array(
465 465
 					'ID'            => $postid, // ID of the post to update
466
-					'post_date'     => date( 'Y-m-d H:i:s',  strtotime($value) ),
467
-					'post_date_gmt'     => gmdate( 'Y-m-d H:i:s',  strtotime($value) ),
466
+					'post_date'     => date('Y-m-d H:i:s', strtotime($value)),
467
+					'post_date_gmt'     => gmdate('Y-m-d H:i:s', strtotime($value)),
468 468
 				)
469 469
 			);
470 470
 		}
Please login to merge, or discard this patch.
admin/includes/menus/settings.php 1 patch
Spacing   +117 added lines, -117 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,66 +86,66 @@  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
 ?>
122 122
 		<div class="wrap">
123 123
 
124
-	    	<h2><?php _e( 'Editus Settings', 'lasso' );?></h2>
124
+	    	<h2><?php _e('Editus Settings', 'lasso'); ?></h2>
125 125
 
126 126
 			<form id="lasso-editor-settings-form" class="lasso--form-settings" method="post" enctype="multipart/form-data">
127 127
 
128
-				<?php do_action('lasso_settings_before');?>
128
+				<?php do_action('lasso_settings_before'); ?>
129 129
 				
130 130
 				
131 131
 				
132
-				<h3><?php _e( 'Enable for:', 'lasso' );?></h3>
132
+				<h3><?php _e('Enable for:', 'lasso'); ?></h3>
133 133
 				<div class="lasso-editor-settings--option-wrap">
134 134
 					<div class="lasso-editor-settings--option-inner">
135 135
 						
136
-						<span class="lasso--setting-description"><?php _e( 'Enable Editus for the following post types.', 'lasso' );?></span>
136
+						<span class="lasso--setting-description"><?php _e('Enable Editus for the following post types.', 'lasso'); ?></span>
137 137
 						<?php
138 138
 						$args = array(
139 139
 							'public'   => true
140 140
 						);
141 141
 						 
142
-						$allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
143
-						$post_types = get_post_types( $args, 'objects' );
142
+						$allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types);
143
+						$post_types = get_post_types($args, 'objects');
144 144
 						 
145
-						foreach ( $post_types  as $post_type ) {
145
+						foreach ($post_types  as $post_type) {
146 146
 						   if ($post_type->name == 'attachment') continue;
147
-						   $checked ="";
148
-						   if (  in_array( $post_type->name, $allowed_post_types )  ) {
147
+						   $checked = "";
148
+						   if (in_array($post_type->name, $allowed_post_types)) {
149 149
 								$checked = 'checked="checked"';
150 150
 						   }
151 151
 						   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>';
@@ -155,69 +155,69 @@  discard block
 block discarded – undo
155 155
 				</div>
156 156
 				
157 157
 
158
-				<h3><?php _e( 'Internal Settings', 'lasso' );?></h3>
158
+				<h3><?php _e('Internal Settings', 'lasso'); ?></h3>
159 159
 				<div class="lasso-editor-settings--option-wrap">
160 160
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
161
-						<label><?php _e( 'Article Class', 'lasso' );?></label>
162
-						<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>
163
-						<input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr( $article_object );?>" placeholder=".entry-content">
161
+						<label><?php _e('Article Class', 'lasso'); ?></label>
162
+						<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>
163
+						<input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr($article_object); ?>" placeholder=".entry-content">
164 164
 					</div>
165 165
 				
166 166
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
167
-						<label><?php _e( 'Featured Image Class', 'lasso' );?></label>
168
-						<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>
169
-						<input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr( $featImgClass );?>" placeholder=".entry-content">
167
+						<label><?php _e('Featured Image Class', 'lasso'); ?></label>
168
+						<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>
169
+						<input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr($featImgClass); ?>" placeholder=".entry-content">
170 170
 					</div>
171 171
 				
172 172
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
173
-						<label><?php _e( 'Article Title Class', 'lasso' );?></label>
174
-						<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>
175
-						<input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr( $titleClass );?>" placeholder=".entry-content">
173
+						<label><?php _e('Article Title Class', 'lasso'); ?></label>
174
+						<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>
175
+						<input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr($titleClass); ?>" placeholder=".entry-content">
176 176
 					</div>
177 177
 				
178 178
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
179
-						<label><?php _e( 'Ignored Items to Save', 'lasso' );?></label>
180
-						<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>
181
-						<textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNoSave );?></textarea>
179
+						<label><?php _e('Ignored Items to Save', 'lasso'); ?></label>
180
+						<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>
181
+						<textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr($objectsNoSave); ?></textarea>
182 182
 					</div>
183 183
 				
184 184
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
185
-						<label><?php _e( 'Read Only Items', 'lasso' );?></label>
186
-						<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>
187
-						<textarea name="lasso_editor[non_editable]" id="lasso_editor[non_editable]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNonEditable );?></textarea>
185
+						<label><?php _e('Read Only Items', 'lasso'); ?></label>
186
+						<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>
187
+						<textarea name="lasso_editor[non_editable]" id="lasso_editor[non_editable]" placeholder=".classname, .another-class"><?php echo esc_attr($objectsNonEditable); ?></textarea>
188 188
 					</div>
189 189
 				
190 190
 					<div class="lasso-editor-settings--option-inner" >
191
-						<input type="checkbox" class="checkbox" name="lasso_editor[show_ignored_items]" id="lasso_editor[show_ignored_items]" <?php echo checked( $show_ignored_items, 'on' );?> >
192
-						<label for="lasso_editor[show_ignored_items]"> <?php _e( 'Show Ignored Items', 'lasso' );?></label>
193
-						<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>
191
+						<input type="checkbox" class="checkbox" name="lasso_editor[show_ignored_items]" id="lasso_editor[show_ignored_items]" <?php echo checked($show_ignored_items, 'on'); ?> >
192
+						<label for="lasso_editor[show_ignored_items]"> <?php _e('Show Ignored Items', 'lasso'); ?></label>
193
+						<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>
194 194
 					</div>
195 195
 				</div>
196 196
 
197
-				<h3><?php _e( 'Editor UI', 'lasso' );?></h3>
197
+				<h3><?php _e('Editor UI', 'lasso'); ?></h3>
198 198
 				<div class="lasso-editor-settings--option-wrap">
199 199
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
200
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked( $toolbar_headings, 'on' );?> >
201
-						<label for="lasso_editor[toolbar_headings]"><?php _e( 'Enable H2 and H3 Buttons', 'lasso' );?></label>
202
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set H2 and H3 settings.', 'lasso' );?></span>
200
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked($toolbar_headings, 'on'); ?> >
201
+						<label for="lasso_editor[toolbar_headings]"><?php _e('Enable H2 and H3 Buttons', 'lasso'); ?></label>
202
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set H2 and H3 settings.', 'lasso'); ?></span>
203 203
 
204 204
 					</div>
205 205
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
206
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings_h4]" id="lasso_editor[toolbar_headings_h4]" <?php echo checked( $toolbar_headings_h4, 'on' );?> >
207
-						<label for="lasso_editor[toolbar_headings_h4]"><?php _e( 'Enable H4/H5/H6 Buttons', 'lasso' );?></label>
208
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set H4/H5/H6 settings.', 'lasso' );?></span>
206
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings_h4]" id="lasso_editor[toolbar_headings_h4]" <?php echo checked($toolbar_headings_h4, 'on'); ?> >
207
+						<label for="lasso_editor[toolbar_headings_h4]"><?php _e('Enable H4/H5/H6 Buttons', 'lasso'); ?></label>
208
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set H4/H5/H6 settings.', 'lasso'); ?></span>
209 209
 
210 210
 					</div>
211 211
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
212
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_color]" id="lasso_editor[toolbar_show_color]" <?php echo checked( $toolbar_show_color, 'on' );?> >
213
-						<label for="lasso_editor[toolbar_show_color]"><?php _e( 'Enable Text Color Buttons', 'lasso' );?></label>
214
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set text colors.', 'lasso' );?></span>
212
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_color]" id="lasso_editor[toolbar_show_color]" <?php echo checked($toolbar_show_color, 'on'); ?> >
213
+						<label for="lasso_editor[toolbar_show_color]"><?php _e('Enable Text Color Buttons', 'lasso'); ?></label>
214
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set text colors.', 'lasso'); ?></span>
215 215
 
216 216
 					</div>
217 217
 					<div class="lasso-editor-settings--option-inner">
218
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_alignment]" id="lasso_editor[toolbar_show_alignment]" <?php echo checked( $toolbar_show_alignment, 'on' );?> >
219
-						<label for="lasso_editor[toolbar_show_alignment]"><?php _e( 'Enable Text Align Buttons', 'lasso' );?></label>
220
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set text alignment.', 'lasso' );?></span>
218
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_alignment]" id="lasso_editor[toolbar_show_alignment]" <?php echo checked($toolbar_show_alignment, 'on'); ?> >
219
+						<label for="lasso_editor[toolbar_show_alignment]"><?php _e('Enable Text Align Buttons', 'lasso'); ?></label>
220
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set text alignment.', 'lasso'); ?></span>
221 221
 
222 222
 					</div>
223 223
 				</div>
@@ -226,82 +226,82 @@  discard block
 block discarded – undo
226 226
 				
227 227
 				
228 228
 
229
-				<h3><?php _e( 'Post Settings UI', 'lasso' );?></h3>
229
+				<h3><?php _e('Post Settings UI', 'lasso'); ?></h3>
230 230
 				<div class="lasso-editor-settings--option-wrap"  >
231 231
 					<div class="lasso-editor-settings--option-inner" style="border:none">
232
-						<input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked( $post_settings_disabled, 'on' );?> >
233
-						<label for="lasso_editor[post_settings_disabled]"> <?php _e( 'Disable Post Settings', 'lasso' );?></label>
234
-						<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>
232
+						<input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked($post_settings_disabled, 'on'); ?> >
233
+						<label for="lasso_editor[post_settings_disabled]"> <?php _e('Disable Post Settings', 'lasso'); ?></label>
234
+						<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>
235 235
 					</div>
236 236
 					
237 237
 					<div class="lasso-editor-settings--option-inner" style="border:none">
238
-						<input type="checkbox" class="checkbox" name="lasso_editor[allow_change_date]" id="lasso_editor[allow_change_date]" <?php echo checked( $allow_change_date, 'on' );?> >
239
-						<label for="lasso_editor[allow_change_date]"> <?php _e( 'Allow Changing Post Date', 'lasso' );?></label>
240
-						<span class="lasso--setting-description"><?php _e( 'Add the date selector to change the post\'s date to the Post Setting dialog', 'lasso' );?></span>
238
+						<input type="checkbox" class="checkbox" name="lasso_editor[allow_change_date]" id="lasso_editor[allow_change_date]" <?php echo checked($allow_change_date, 'on'); ?> >
239
+						<label for="lasso_editor[allow_change_date]"> <?php _e('Allow Changing Post Date', 'lasso'); ?></label>
240
+						<span class="lasso--setting-description"><?php _e('Add the date selector to change the post\'s date to the Post Setting dialog', 'lasso'); ?></span>
241 241
 					</div>
242 242
 					
243 243
 					<div class="lasso-editor-settings--option-inner" style="border:none">
244
-						<input type="checkbox" class="checkbox" name="lasso_editor[allow_new_category]" id="lasso_editor[allow_new_category]" <?php echo checked( $allow_new_category, 'on' );?> >
245
-						<label for="lasso_editor[allow_new_category]"> <?php _e( 'Allow Adding New Category', 'lasso' );?></label>
246
-						<span class="lasso--setting-description"><?php _e( 'Add the user to create new, previously non-existing categories for posts.', 'lasso' );?></span>
244
+						<input type="checkbox" class="checkbox" name="lasso_editor[allow_new_category]" id="lasso_editor[allow_new_category]" <?php echo checked($allow_new_category, 'on'); ?> >
245
+						<label for="lasso_editor[allow_new_category]"> <?php _e('Allow Adding New Category', 'lasso'); ?></label>
246
+						<span class="lasso--setting-description"><?php _e('Add the user to create new, previously non-existing categories for posts.', 'lasso'); ?></span>
247 247
 					</div>
248 248
 				
249 249
 					<div class="lasso-editor-settings--option-inner" >
250
-						<input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked( $post_new_disabled, 'on' );?> >
251
-						<label for="lasso_editor[post_adding_disabled]"><?php _e( 'Disable Post Adding', 'lasso' );?></label>
252
-						<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>
250
+						<input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked($post_new_disabled, 'on'); ?> >
251
+						<label for="lasso_editor[post_adding_disabled]"><?php _e('Disable Post Adding', 'lasso'); ?></label>
252
+						<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>
253 253
 					</div>
254 254
 					
255 255
 
256 256
 				</div>
257 257
 				
258
-				<h3><?php _e( 'Misc', 'lasso' );?></h3>
258
+				<h3><?php _e('Misc', 'lasso'); ?></h3>
259 259
 				<div class="lasso-editor-settings--option-wrap">
260 260
 					<div class="lasso-editor-settings--option-inner" style="border:none">
261
-						<input type="checkbox" class="checkbox" name="lasso_editor[disable_tour]" id="lasso_editor[disable_tour]" <?php echo checked( $disable_tour, 'on' );?> >
262
-						<label for="lasso_editor[disable_tour]"> <?php _e( 'Do Not Show Tour Dialog', 'lasso' );?></label>
263
-						<span class="lasso--setting-description"><?php _e( 'Check this box to disable the tour dialog box for all users.', 'lasso' );?></span>
261
+						<input type="checkbox" class="checkbox" name="lasso_editor[disable_tour]" id="lasso_editor[disable_tour]" <?php echo checked($disable_tour, 'on'); ?> >
262
+						<label for="lasso_editor[disable_tour]"> <?php _e('Do Not Show Tour Dialog', 'lasso'); ?></label>
263
+						<span class="lasso--setting-description"><?php _e('Check this box to disable the tour dialog box for all users.', 'lasso'); ?></span>
264 264
 					</div>
265 265
 
266 266
 					<div class="lasso-editor-settings--option-inner" style="border:none">
267
-					    <label for="lasso_editor[bold_tag]"> <?php _e( '"Bold" Tag', 'lasso' );?></label>
268
-						<span class="lasso--setting-description"><?php _e( 'Choose the HTML tag used for the "Bold" style.', 'lasso' );?></span>
269
-					    <input type="radio" name="lasso_editor[bold_tag]" value='b' <?php echo checked( $bold_tag, 'b' );?>> b
270
-						<input type="radio" name="lasso_editor[bold_tag]" value="strong" <?php echo checked( $bold_tag, 'strong' );?>> strong
267
+					    <label for="lasso_editor[bold_tag]"> <?php _e('"Bold" Tag', 'lasso'); ?></label>
268
+						<span class="lasso--setting-description"><?php _e('Choose the HTML tag used for the "Bold" style.', 'lasso'); ?></span>
269
+					    <input type="radio" name="lasso_editor[bold_tag]" value='b' <?php echo checked($bold_tag, 'b'); ?>> b
270
+						<input type="radio" name="lasso_editor[bold_tag]" value="strong" <?php echo checked($bold_tag, 'strong'); ?>> strong
271 271
 					</div>
272 272
 					<div class="lasso-editor-settings--option-inner" >
273
-					    <label for="lasso_editor[i_tag]"> <?php _e( '"Italic" Tag', 'lasso' );?></label>
274
-						<span class="lasso--setting-description"><?php _e( 'Choose the HTML tag used for the "Italic" style.', 'lasso' );?></span>
275
-					    <input type="radio" name="lasso_editor[i_tag]" value='i' <?php echo checked( $i_tag, 'i' );?>> i
276
-						<input type="radio" name="lasso_editor[i_tag]" value="em" <?php echo checked( $i_tag, 'em' );?>> em
273
+					    <label for="lasso_editor[i_tag]"> <?php _e('"Italic" Tag', 'lasso'); ?></label>
274
+						<span class="lasso--setting-description"><?php _e('Choose the HTML tag used for the "Italic" style.', 'lasso'); ?></span>
275
+					    <input type="radio" name="lasso_editor[i_tag]" value='i' <?php echo checked($i_tag, 'i'); ?>> i
276
+						<input type="radio" name="lasso_editor[i_tag]" value="em" <?php echo checked($i_tag, 'em'); ?>> em
277 277
 					</div>
278 278
 				</div>
279 279
 
280
-				<h3><?php _e( 'Advanced', 'lasso' );?></h3>
280
+				<h3><?php _e('Advanced', 'lasso'); ?></h3>
281 281
 				<div class="lasso-editor-settings--option-wrap ">
282 282
 					<div class="lasso-editor-settings--option-inner" style="border:none">
283
-						<input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked( $shortcodify_disabled, 'on' );?> >
284
-						<label for="lasso_editor[shortcodify_disabled]"><?php _e( 'Disable Aesop Component Conversion', 'lasso' );?></label>
285
-						<span class="lasso--setting-description"><?php _e( 'Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso' );?></span>
283
+						<input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked($shortcodify_disabled, 'on'); ?> >
284
+						<label for="lasso_editor[shortcodify_disabled]"><?php _e('Disable Aesop Component Conversion', 'lasso'); ?></label>
285
+						<span class="lasso--setting-description"><?php _e('Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso'); ?></span>
286 286
 					</div>
287 287
 				
288 288
 					<div class="lasso-editor-settings--option-inner" style="border:none">
289
-						<input type="checkbox" class="checkbox" name="lasso_editor[enable_autosave]" id="lasso_editor[enable_autosave]" <?php echo checked( $enable_autosave, 'on' );?> >
290
-						<label for="lasso_editor[enable_autosave]"><?php _e( 'Enable Auto Save', 'lasso' );?></label>
291
-						<span class="lasso--setting-description"><?php _e( 'Check this box to enable auto save.', 'lasso' );?></span>
289
+						<input type="checkbox" class="checkbox" name="lasso_editor[enable_autosave]" id="lasso_editor[enable_autosave]" <?php echo checked($enable_autosave, 'on'); ?> >
290
+						<label for="lasso_editor[enable_autosave]"><?php _e('Enable Auto Save', 'lasso'); ?></label>
291
+						<span class="lasso--setting-description"><?php _e('Check this box to enable auto save.', 'lasso'); ?></span>
292 292
 					</div>
293 293
 				
294 294
 					<div class="lasso-editor-settings--option-inner" style="border:none">
295
-						<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' );?> >
296
-						<label for="lasso_editor[post_save_disabled]"><?php _e( 'Disable Post Saving', 'lasso' );?></label>
297
-						<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>
295
+						<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'); ?> >
296
+						<label for="lasso_editor[post_save_disabled]"><?php _e('Disable Post Saving', 'lasso'); ?></label>
297
+						<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>
298 298
 
299 299
 					</div>
300 300
 				
301 301
 					<div class="lasso-editor-settings--option-inner">
302
-						<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' );?> >
303
-						<label for="lasso_editor[save_using_rest_disabled]"><?php _e( "Don't Use REST API to Save", 'lasso' );?></label>
304
-						<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>
302
+						<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'); ?> >
303
+						<label for="lasso_editor[save_using_rest_disabled]"><?php _e("Don't Use REST API to Save", 'lasso'); ?></label>
304
+						<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>
305 305
 
306 306
 					</div>
307 307
 				</div>
@@ -311,11 +311,11 @@  discard block
 block discarded – undo
311 311
 
312 312
 				<div class="lasso-editor-settings--submit">
313 313
 				    <input type="hidden" name="action" value="lasso-editor-settings" />
314
-				    <input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save Settings', 'lasso' );?>" />
315
-					<?php wp_nonce_field( 'nonce', 'lasso_editor_settings' ); ?>
314
+				    <input type="submit" class="button-primary" value="<?php esc_attr_e('Save Settings', 'lasso'); ?>" />
315
+					<?php wp_nonce_field('nonce', 'lasso_editor_settings'); ?>
316 316
 				</div>
317 317
 				
318
-				<?php do_action('lasso_settings_after');?>
318
+				<?php do_action('lasso_settings_after'); ?>
319 319
 			</form>
320 320
 
321 321
 		</div><?php
Please login to merge, or discard this patch.