Completed
Push — master ( 99c38a...8d9355 )
by
unknown
01:40
created
admin/includes/load_admin.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
99 99
 
100 100
 		foreach ( $pages as $page ) {
101 101
 			wp_enqueue_media();
102
-            wp_enqueue_style( 'wp-color-picker');
103
-            wp_enqueue_script( 'wp-color-picker');
102
+			wp_enqueue_style( 'wp-color-picker');
103
+			wp_enqueue_script( 'wp-color-picker');
104 104
 		
105 105
 			wp_enqueue_script( 'lasso-editor-settings-script', LASSO_URL.'/admin/assets/js/lasso-editor-settings.js', array( 'jquery','wp-color-picker' ), LASSO_VERSION, true );
106 106
 			wp_enqueue_style( 'lasso-editor-settings-style', LASSO_URL.'/admin/assets/css/lasso-editor-settings.css', LASSO_VERSION );
@@ -131,11 +131,11 @@  discard block
 block discarded – undo
131 131
 	}
132 132
 
133 133
 	/**
134
-	*	Adds an admin notice reminding the user if their license key has not been saved
135
-	*
136
-	*	@since 0.9.7
137
-	*	@todo make dismissible
138
-	*/
134
+	 *	Adds an admin notice reminding the user if their license key has not been saved
135
+	 *
136
+	 *	@since 0.9.7
137
+	 *	@todo make dismissible
138
+	 */
139 139
 	public function license_nag(){
140 140
 
141 141
 		$screen 	= get_current_screen();
@@ -156,26 +156,26 @@  discard block
 block discarded – undo
156 156
 
157 157
 			if ( empty( $license ) ) {
158 158
 
159
-        		printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_empty, $license_link, $dismiss_link );
159
+				printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_empty, $license_link, $dismiss_link );
160 160
 
161
-        	} else if ( 'invalid' == $status ){ // license key entered wrong or something
161
+			} else if ( 'invalid' == $status ){ // license key entered wrong or something
162 162
 
163 163
 				printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_invalid, $license_link , $dismiss_link );
164 164
 
165
-        	} else if ( empty( $status ) ){ // license key saved but not activated
165
+			} else if ( empty( $status ) ){ // license key saved but not activated
166 166
 
167 167
 				printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_inactive, $license_link, $dismiss_link );
168 168
 
169
-        	}
169
+			}
170 170
 		}
171 171
 
172 172
 	}
173 173
 
174 174
 	/**
175
-	*  Process hiding the dimiss
176
-	*
177
-	* @since 0.9.7
178
-	*/
175
+	 *  Process hiding the dimiss
176
+	 *
177
+	 * @since 0.9.7
178
+	 */
179 179
 	public function dismiss_nag() {
180 180
 
181 181
 		if ( isset( $_GET['lasso-notice'] ) && 'dismiss' == $_GET['lasso-notice'] && current_user_can('manage_options') ) {
Please login to merge, or discard this patch.
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -43,23 +43,23 @@  discard block
 block discarded – undo
43 43
 		$plugin = lasso::get_instance();
44 44
 		$this->plugin_slug = $plugin->get_plugin_slug();
45 45
 
46
-		add_action( 'admin_head',  			array( $this, 'admin_assets' ) );
47
-		add_action( 'admin_notices', 		array( $this, 'license_nag' ) );
48
-		add_action( 'admin_head', 			array( $this, 'dismiss_nag' ) );
49
-		add_filter( 'plugin_row_meta',    	array( $this, 'plugin_meta' ), 10, 2 );
46
+		add_action('admin_head', array($this, 'admin_assets'));
47
+		add_action('admin_notices', array($this, 'license_nag'));
48
+		add_action('admin_head', array($this, 'dismiss_nag'));
49
+		add_filter('plugin_row_meta', array($this, 'plugin_meta'), 10, 2);
50 50
 
51
-		if ( !class_exists( 'EDD_SL_Plugin_Updater' ) ) {
51
+		if (!class_exists('EDD_SL_Plugin_Updater')) {
52 52
 			include LASSO_DIR.'admin/includes/EDD_SL_Plugin_Updater.php';
53 53
 		}
54 54
 
55
-		if ( !class_exists( 'TGM_Plugin_Activation' ) ) {
55
+		if (!class_exists('TGM_Plugin_Activation')) {
56 56
 			include LASSO_DIR.'admin/includes/class-tgm-plugin-activation.php';
57 57
 		}
58 58
 
59 59
 		new menus\welcome();
60 60
 		new menus\settings();
61 61
 
62
-		if ( !defined( 'LASSO_AGENCY_MODE' ) ) {
62
+		if (!defined('LASSO_AGENCY_MODE')) {
63 63
 			new menus\license();
64 64
 		}
65 65
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	public static function get_instance() {
76 76
 
77 77
 		// If the single instance hasn't been set, set it now.
78
-		if ( null == self::$instance ) {
78
+		if (null == self::$instance) {
79 79
 			self::$instance = new self;
80 80
 		}
81 81
 
@@ -97,13 +97,13 @@  discard block
 block discarded – undo
97 97
 			'dashboard_page_lasso-welcome-screen'
98 98
 		);
99 99
 
100
-		foreach ( $pages as $page ) {
100
+		foreach ($pages as $page) {
101 101
 			wp_enqueue_media();
102
-            wp_enqueue_style( 'wp-color-picker');
103
-            wp_enqueue_script( 'wp-color-picker');
102
+            wp_enqueue_style('wp-color-picker');
103
+            wp_enqueue_script('wp-color-picker');
104 104
 		
105
-			wp_enqueue_script( 'lasso-editor-settings-script', LASSO_URL.'/admin/assets/js/lasso-editor-settings.js', array( 'jquery','wp-color-picker' ), LASSO_VERSION, true );
106
-			wp_enqueue_style( 'lasso-editor-settings-style', LASSO_URL.'/admin/assets/css/lasso-editor-settings.css', LASSO_VERSION );
105
+			wp_enqueue_script('lasso-editor-settings-script', LASSO_URL.'/admin/assets/js/lasso-editor-settings.js', array('jquery', 'wp-color-picker'), LASSO_VERSION, true);
106
+			wp_enqueue_style('lasso-editor-settings-style', LASSO_URL.'/admin/assets/css/lasso-editor-settings.css', LASSO_VERSION);
107 107
 		}
108 108
 	}
109 109
 
@@ -116,15 +116,15 @@  discard block
 block discarded – undo
116 116
 	 *
117 117
 	 * @return array new array of links for our plugin listing on plugins.php
118 118
 	 */
119
-	public function plugin_meta( $links, $file ) {
119
+	public function plugin_meta($links, $file) {
120 120
 
121
-		if ( strpos( $file, 'lasso.php' ) !== false && !defined( 'LASSO_AGENCY_MODE' ) ) {
121
+		if (strpos($file, 'lasso.php') !== false && !defined('LASSO_AGENCY_MODE')) {
122 122
 
123 123
 			$new_links = array(
124 124
 				'<a href="http://edituswp.com/help" target="_blank">Help</a>'
125 125
 			);
126 126
 
127
-			$links = array_merge( $links, $new_links );
127
+			$links = array_merge($links, $new_links);
128 128
 		}
129 129
 
130 130
 		return $links;
@@ -136,35 +136,35 @@  discard block
 block discarded – undo
136 136
 	*	@since 0.9.7
137 137
 	*	@todo make dismissible
138 138
 	*/
139
-	public function license_nag(){
139
+	public function license_nag() {
140 140
 
141
-		$screen 	= get_current_screen();
142
-		$welcome    = 'toplevel_page_lasso-editor' == $screen->id;
143
-		$license  	= get_option( 'lasso_license_key' );
144
-		$status   	= get_option( 'lasso_license_status' );
141
+		$screen = get_current_screen();
142
+		$welcome = 'toplevel_page_lasso-editor' == $screen->id;
143
+		$license  	= get_option('lasso_license_key');
144
+		$status   	= get_option('lasso_license_status');
145 145
 
146
-		$message_empty    = apply_filters('lasso_empty_license_message','Your license key for support and automatic updates for Editus is missing!');
147
-		$message_invalid  = apply_filters('lasso_invalid_license_message','Oh snap! It looks like your Editus license key is invalid. Might check here to see if its been added correctly.');
148
-		$message_inactive  = apply_filters('lasso_inactive_license_message','It looks like your license key has not yet been activated.');
146
+		$message_empty    = apply_filters('lasso_empty_license_message', 'Your license key for support and automatic updates for Editus is missing!');
147
+		$message_invalid  = apply_filters('lasso_invalid_license_message', 'Oh snap! It looks like your Editus license key is invalid. Might check here to see if its been added correctly.');
148
+		$message_inactive = apply_filters('lasso_inactive_license_message', 'It looks like your license key has not yet been activated.');
149 149
 
150
-		$license_link 	  = sprintf('<a href="%s">Update License</a>', esc_url( add_query_arg( array( 'page' => 'lasso-license' ), admin_url('admin.php') ) ) );
151
-		$dismiss_link     = sprintf('<a style="text-decoration:none;" href="%s" id="lasso-dismiss-notice" class="notice-dismiss"><span class="screen-reader-text">%s</span></a>', esc_url( add_query_arg( 'lasso-notice', 'dismiss' ) ), __('Dismiss this notice.','lasso') );
150
+		$license_link = sprintf('<a href="%s">Update License</a>', esc_url(add_query_arg(array('page' => 'lasso-license'), admin_url('admin.php'))));
151
+		$dismiss_link     = sprintf('<a style="text-decoration:none;" href="%s" id="lasso-dismiss-notice" class="notice-dismiss"><span class="screen-reader-text">%s</span></a>', esc_url(add_query_arg('lasso-notice', 'dismiss')), __('Dismiss this notice.', 'lasso'));
152 152
 
153
-		$not_hidden       = get_user_meta( get_current_user_ID(), 'lasso_license_nag_dismissed', true );
153
+		$not_hidden       = get_user_meta(get_current_user_ID(), 'lasso_license_nag_dismissed', true);
154 154
 
155
-		if ( current_user_can('manage_options') && !$welcome && !defined( 'LASSO_AGENCY_MODE') && !$not_hidden ) {
155
+		if (current_user_can('manage_options') && !$welcome && !defined('LASSO_AGENCY_MODE') && !$not_hidden) {
156 156
 
157
-			if ( empty( $license ) ) {
157
+			if (empty($license)) {
158 158
 
159
-        		printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_empty, $license_link, $dismiss_link );
159
+        		printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_empty, $license_link, $dismiss_link);
160 160
 
161
-        	} else if ( 'invalid' == $status ){ // license key entered wrong or something
161
+        	} else if ('invalid' == $status) { // license key entered wrong or something
162 162
 
163
-				printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_invalid, $license_link , $dismiss_link );
163
+				printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_invalid, $license_link, $dismiss_link);
164 164
 
165
-        	} else if ( empty( $status ) ){ // license key saved but not activated
165
+        	} else if (empty($status)) { // license key saved but not activated
166 166
 
167
-				printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_inactive, $license_link, $dismiss_link );
167
+				printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_inactive, $license_link, $dismiss_link);
168 168
 
169 169
         	}
170 170
 		}
@@ -178,8 +178,8 @@  discard block
 block discarded – undo
178 178
 	*/
179 179
 	public function dismiss_nag() {
180 180
 
181
-		if ( isset( $_GET['lasso-notice'] ) && 'dismiss' == $_GET['lasso-notice'] && current_user_can('manage_options') ) {
182
-			update_user_meta( get_current_user_id(), 'lasso_license_nag_dismissed', 1 );
181
+		if (isset($_GET['lasso-notice']) && 'dismiss' == $_GET['lasso-notice'] && current_user_can('manage_options')) {
182
+			update_user_meta(get_current_user_id(), 'lasso_license_nag_dismissed', 1);
183 183
 		}
184 184
 	}
185 185
 }
Please login to merge, or discard this patch.
public/includes/lasso.php 4 patches
Doc Comments   +7 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 	 *
81 81
 	 * @since    0.0.1
82 82
 	 *
83
-	 * @return    Plugin slug variable.
83
+	 * @return    string slug variable.
84 84
 	 */
85 85
 	public function get_plugin_slug() {
86 86
 		return $this->plugin_slug;
@@ -338,6 +338,9 @@  discard block
 block discarded – undo
338 338
 		exit;
339 339
 	}
340 340
 	
341
+	/**
342
+	 * @param string $type
343
+	 */
341 344
 	public static function enable_metasave($type)
342 345
 	{
343 346
 		register_rest_field( $type, 'metadata', array(
@@ -526,6 +529,9 @@  discard block
 block discarded – undo
526 529
 		return self::$revisions;
527 530
 	}*/
528 531
 	
532
+	/**
533
+	 * @param string $taxonomy
534
+	 */
529 535
 	public function set_post_terms( $postid, $value, $taxonomy ) {
530 536
 		if( $value ) {
531 537
 			$value = explode( ',', $value );
Please login to merge, or discard this patch.
Indentation   +98 added lines, -98 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 		
60 60
 		add_action( 'wp_ajax_get_aesop_component',     array( $this, 'get_aesop_component' ) );
61 61
 		add_action( 'wp_ajax_editus_do_shortcode',     array( $this, 'editus_do_shortcode' ) );
62
-        add_action( 'wp_ajax_editus_do_block',     array( $this, 'editus_do_block' ) );
62
+		add_action( 'wp_ajax_editus_do_block',     array( $this, 'editus_do_block' ) );
63 63
 		add_action( 'wp_ajax_editus_lock_post',     array( $this, 'editus_lock_post' ) );
64 64
 		add_action( 'wp_ajax_editus_unlock_post',     array( $this, 'editus_unlock_post' ) );
65 65
 		add_action( 'wp_ajax_editus_hide_tour',     array( $this, 'editus_hide_tour' ) );
@@ -69,10 +69,10 @@  discard block
 block discarded – undo
69 69
 		add_action( 'wp_ajax_editus_featured_img',     array( $this, 'set_featured_img' ) );
70 70
 		add_action( 'wp_ajax_editus_del_featured_img',     array( $this, 'del_featured_img' ) );
71 71
         
72
-        add_action( 'wp_ajax_editus_publish_post',     array( $this, 'on_publish_post' ) );
72
+		add_action( 'wp_ajax_editus_publish_post',     array( $this, 'on_publish_post' ) );
73 73
         
74
-        add_action( 'wp_ajax_editus_create_gallery',     array( $this, 'create_gallery' ) );
75
-        add_action( 'wp_ajax_editus_update_gallery',     array( $this, 'update_gallery' ) );
74
+		add_action( 'wp_ajax_editus_create_gallery',     array( $this, 'create_gallery' ) );
75
+		add_action( 'wp_ajax_editus_update_gallery',     array( $this, 'update_gallery' ) );
76 76
 
77 77
 		// enable saving custom fields through REST API
78 78
 		self::enable_metasave('post');
@@ -272,14 +272,14 @@  discard block
 block discarded – undo
272 272
 		$out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' );
273 273
 	}
274 274
 	
275
-    // new ajax function to lock post for editing
275
+	// new ajax function to lock post for editing
276 276
 	public function editus_lock_post()
277 277
 	{
278 278
 		$post_id= $_POST["postid"];
279 279
 		$locked = wp_check_post_lock($post_id);
280 280
 		
281 281
 		if (!$locked) {
282
-		    wp_set_post_lock($post_id);
282
+			wp_set_post_lock($post_id);
283 283
 			echo "true";
284 284
 		} else {
285 285
 			$user_info = get_userdata($locked);
@@ -292,9 +292,9 @@  discard block
 block discarded – undo
292 292
 	{
293 293
 		$post_id= $_POST["postid"];
294 294
 		$locked = wp_check_post_lock($post_id);
295
-        if (!$locked) {
296
-            delete_post_meta( $post_id, '_edit_lock');
297
-        }
295
+		if (!$locked) {
296
+			delete_post_meta( $post_id, '_edit_lock');
297
+		}
298 298
 		echo "true";
299 299
 		
300 300
 		exit;
@@ -324,14 +324,14 @@  discard block
 block discarded – undo
324 324
 		$status = isset( $data['status'] ) ? $data['status'] : false;
325 325
 		$postid = isset( $data['postid'] ) ? $data['postid'] : false;
326 326
 		$slug   = isset( $data['story_slug'] ) ? $data['story_slug'] : false;
327
-        $excerpt   = isset( $data['excerpt'] ) ? $data['excerpt'] : false;
327
+		$excerpt   = isset( $data['excerpt'] ) ? $data['excerpt'] : false;
328 328
 	
329 329
 
330 330
 		$args = array(
331 331
 			'ID'   			=> (int) $postid,
332 332
 			'post_name'  	=> $slug,
333 333
 			'post_status' 	=> $status,
334
-            'post_excerpt'  => $excerpt
334
+			'post_excerpt'  => $excerpt
335 335
 		);
336 336
 		
337 337
 		
@@ -399,12 +399,12 @@  discard block
 block discarded – undo
399 399
 		exit;
400 400
 	}
401 401
     
402
-    public function editus_do_block()
402
+	public function editus_do_block()
403 403
 	{
404 404
 		
405 405
 		$code= $_POST["code"];
406 406
 
407
-        $out = do_blocks( $code );
407
+		$out = do_blocks( $code );
408 408
 		
409 409
 		echo $out;
410 410
 		exit;
@@ -423,60 +423,60 @@  discard block
 block discarded – undo
423 423
 			}
424 424
 		}
425 425
 		if ($code == "aesop_video") {
426
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
427
-		    echo aesop_video_shortcode($atts);
426
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
427
+			echo aesop_video_shortcode($atts);
428 428
 		}
429 429
 		else if ($code == "aesop_image") {
430
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
431
-		    echo aesop_image_shortcode($atts);
430
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
431
+			echo aesop_image_shortcode($atts);
432 432
 		}
433 433
 		else if ($code == "aesop_quote") {
434
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
435
-		    echo aesop_quote_shortcode($atts);
434
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
435
+			echo aesop_quote_shortcode($atts);
436 436
 		}
437 437
 		else if ($code == "aesop_parallax") {
438
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
439
-		    echo aesop_parallax_shortcode($atts);
438
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
439
+			echo aesop_parallax_shortcode($atts);
440 440
 		}
441 441
 		else if ($code == "aesop_character") {
442
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
443
-		    echo aesop_character_shortcode($atts);
442
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
443
+			echo aesop_character_shortcode($atts);
444 444
 		}
445 445
 		else if ($code == "aesop_collection") {
446
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
447
-		    echo aesop_collection_shortcode($atts);
446
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
447
+			echo aesop_collection_shortcode($atts);
448 448
 		}
449 449
 		else if ($code == "aesop_chapter") {
450
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
451
-		    echo aesop_chapter_shortcode($atts);
450
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
451
+			echo aesop_chapter_shortcode($atts);
452 452
 		}
453 453
 		else if ($code == "aesop_content") {
454
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
455
-		    echo aesop_content_shortcode($atts, $atts['content_data']);
454
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
455
+			echo aesop_content_shortcode($atts, $atts['content_data']);
456 456
 		}
457 457
 		else if ($code == "aesop_gallery") {
458
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
459
-		    echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
458
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
459
+			echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
460 460
 		}
461 461
 		else if ($code == "aesop_audio") {
462
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
463
-		    echo aesop_audio_shortcode($atts);
462
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
463
+			echo aesop_audio_shortcode($atts);
464 464
 		}
465 465
 		else if ($code == "aesop_document") {
466
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php');
467
-		    echo aesop_document_shortcode($atts);
466
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php');
467
+			echo aesop_document_shortcode($atts);
468 468
 		}
469
-        /*else if ($code == "aesop_content") {
469
+		/*else if ($code == "aesop_content") {
470 470
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-content.php');
471 471
 		    echo aesop_content_shortcode($atts);
472 472
 		}*/
473
-        else if ($code == "aesop_wpimg") {
474
-            self::wpimg($atts);
473
+		else if ($code == "aesop_wpimg") {
474
+			self::wpimg($atts);
475 475
 		}
476 476
 		else {
477 477
 			$code = '['.$code.' ';
478 478
 			foreach ($atts as $key => $value) {
479
-			    $code = ''.$key.'="'.$value.'" ';
479
+				$code = ''.$key.'="'.$value.'" ';
480 480
 			}
481 481
 			$code = $code.']';
482 482
 			echo do_shortcode($code);
@@ -485,63 +485,63 @@  discard block
 block discarded – undo
485 485
 		exit; 
486 486
 	}
487 487
     
488
-    public static function wpimg($atts) {
488
+	public static function wpimg($atts) {
489 489
 
490
-        echo '<figure data-component-type="wpimg"';
490
+		echo '<figure data-component-type="wpimg"';
491 491
         
492
-        $extra = "";
492
+		$extra = "";
493 493
         
494
-        // try to use srcset and sizes on new WP installs
494
+		// try to use srcset and sizes on new WP installs
495 495
 		if ( function_exists('wp_get_attachment_image_srcset') && $attachment_id = attachment_url_to_postid( $atts['img'] ) ) {
496 496
 			$srcset = wp_get_attachment_image_srcset( $attachment_id, 'full' );
497 497
 			$sizes = wp_get_attachment_image_sizes( $attachment_id, 'full' );
498
-            $extra = "srcset='$srcset' sizes='$sizes' ";
499
-        }
500
-        if ($atts['align']=="left") {
501
-            $extra .= 'class="alignleft';
502
-        } else if ($atts['align']=="right") {
503
-            $extra .= 'class="alignright';
504
-        } else {
505
-            $extra .= 'class="aligncenter';
506
-        }
507
-        if ($atts['imgwidth'] || $atts['imgheight']) {
508
-            if ($atts['imgwidth']) {
509
-                $extra .= 'width:'. $atts['imgwidth'].';';
510
-            }
511
-            if ($atts['imgheight']) {
512
-                $extra .= 'height:'. $atts['imgheight'].';';
513
-            }
498
+			$extra = "srcset='$srcset' sizes='$sizes' ";
499
+		}
500
+		if ($atts['align']=="left") {
501
+			$extra .= 'class="alignleft';
502
+		} else if ($atts['align']=="right") {
503
+			$extra .= 'class="alignright';
504
+		} else {
505
+			$extra .= 'class="aligncenter';
506
+		}
507
+		if ($atts['imgwidth'] || $atts['imgheight']) {
508
+			if ($atts['imgwidth']) {
509
+				$extra .= 'width:'. $atts['imgwidth'].';';
510
+			}
511
+			if ($atts['imgheight']) {
512
+				$extra .= 'height:'. $atts['imgheight'].';';
513
+			}
514 514
             
515
-        }
516
-        $extra .= '"';
515
+		}
516
+		$extra .= '"';
517 517
         
518
-        foreach ($atts as $key => $value) {
518
+		foreach ($atts as $key => $value) {
519 519
 			 echo ' data-'.$key.'="'.$value.'"';
520 520
 		}
521
-        //echo ' class="wp-image- lasso--wpimg__wrap lasso-component">';
522
-        echo ' class="wp-caption lasso-component">';
523
-        $hrefset = false;
524
-        if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption']=="url" ))
525
-        {
526
-            echo '<a href="' . $atts['link'] . '">';
527
-            $hrefset = true;
528
-        } else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img' ) {
529
-            echo '<a href="' . $atts['img'] . '">';
530
-            $hrefset = true;
531
-        }
532
-        echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  .  '" '. $extra. '>';
533
-        if ($hrefset)
534
-        {
535
-            echo '</a>';
536
-        }
537
-        if ($atts['caption'])
538
-        {
539
-            echo '<figcaption class="wp-caption-text">'.$atts['caption'].'</figcaption>';
540
-        }
541
-        echo '</figure>';
542
-        echo '<p> </p>';
543
-        return;
544
-    }
521
+		//echo ' class="wp-image- lasso--wpimg__wrap lasso-component">';
522
+		echo ' class="wp-caption lasso-component">';
523
+		$hrefset = false;
524
+		if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption']=="url" ))
525
+		{
526
+			echo '<a href="' . $atts['link'] . '">';
527
+			$hrefset = true;
528
+		} else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img' ) {
529
+			echo '<a href="' . $atts['img'] . '">';
530
+			$hrefset = true;
531
+		}
532
+		echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  .  '" '. $extra. '>';
533
+		if ($hrefset)
534
+		{
535
+			echo '</a>';
536
+		}
537
+		if ($atts['caption'])
538
+		{
539
+			echo '<figcaption class="wp-caption-text">'.$atts['caption'].'</figcaption>';
540
+		}
541
+		echo '</figure>';
542
+		echo '<p> </p>';
543
+		return;
544
+	}
545 545
 	
546 546
 	
547 547
 	public function get_ase_options()
@@ -577,12 +577,12 @@  discard block
 block discarded – undo
577 577
 		exit;
578 578
 	}
579 579
     
580
-    /* This function doesn't actually publish post, but should be called when a post is published */
581
-    public function on_publish_post( ) {
580
+	/* This function doesn't actually publish post, but should be called when a post is published */
581
+	public function on_publish_post( ) {
582 582
 
583 583
 		$post_id = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
584 584
         
585
-        do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) );
585
+		do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) );
586 586
 
587 587
 		exit;
588 588
 	}
@@ -640,14 +640,14 @@  discard block
 block discarded – undo
640 640
 			$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
641 641
 			
642 642
 			if ($taxonomy =='category') {
643
-                // convert from names to category ids
643
+				// convert from names to category ids
644 644
 				$cats = array();
645 645
 				foreach ($value as $cat) {
646 646
 					$cat_id = get_cat_ID($cat);
647 647
 					if ($cat_id !=0) {
648 648
 						$cats [] = $cat_id;
649 649
 					} else if ($allow_new_category) {
650
-					    $cats [] = wp_create_category($cat);
650
+						$cats [] = wp_create_category($cat);
651 651
 					}
652 652
 				}
653 653
 				$value = $cats;
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
 		}
668 668
 	}
669 669
     
670
-    public function create_gallery( ) {
670
+	public function create_gallery( ) {
671 671
 
672 672
 		$postid  	= isset( $_POST['postid'] ) ? $_POST['postid'] : false;
673 673
         
@@ -721,10 +721,10 @@  discard block
 block discarded – undo
721 721
 			'message' => 'gallery-created',
722 722
 			'id' => $postid)
723 723
 		);
724
-        exit;
724
+		exit;
725 725
 	}
726 726
     
727
-    public function update_gallery( ) {
727
+	public function update_gallery( ) {
728 728
         
729 729
 		$options      = isset( $_POST['fields'] ) ? $_POST['fields'] : false;
730 730
         
@@ -740,12 +740,12 @@  discard block
 block discarded – undo
740 740
 
741 741
 		self::save_gallery_options( $postid, $gallery_ids, $options, $type );
742 742
 
743
-        echo json_encode( array('message' => 'gallery-updated') );
743
+		echo json_encode( array('message' => 'gallery-updated') );
744 744
 
745
-        exit;
745
+		exit;
746 746
 	}
747 747
     
748
-    public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) {
748
+	public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) {
749 749
 
750 750
 		// gallery width
751 751
 		$gallery_width = isset( $options['width'] ) ? $options['width'] : false;
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
 	public function set_date( $postid, $value) {
830 830
 		if( $value ) {
831 831
 			$value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time( 'timestamp', 1 ));
832
-            wp_update_post(
832
+			wp_update_post(
833 833
 				array (
834 834
 					'ID'            => $postid, // ID of the post to update
835 835
 					'post_date'     => date( 'Y-m-d H:i:s',  strtotime($value) ),
Please login to merge, or discard this patch.
Spacing   +183 added lines, -183 removed lines patch added patch discarded remove patch
@@ -52,27 +52,27 @@  discard block
 block discarded – undo
52 52
 		require_once LASSO_DIR.'/public/includes/wrap-shortcodes.php';
53 53
 
54 54
 		// Activate plugin when new blog is added
55
-		add_action( 'wpmu_new_blog', array( $this, 'activate_new_site' ) );
55
+		add_action('wpmu_new_blog', array($this, 'activate_new_site'));
56 56
 
57 57
 		// Load plugin text domain
58
-		add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
58
+		add_action('init', array($this, 'load_plugin_textdomain'));
59 59
 		
60
-		add_action( 'wp_ajax_get_aesop_component',     array( $this, 'get_aesop_component' ) );
61
-		add_action( 'wp_ajax_editus_do_shortcode',     array( $this, 'editus_do_shortcode' ) );
62
-        add_action( 'wp_ajax_editus_do_block',     array( $this, 'editus_do_block' ) );
63
-		add_action( 'wp_ajax_editus_lock_post',     array( $this, 'editus_lock_post' ) );
64
-		add_action( 'wp_ajax_editus_unlock_post',     array( $this, 'editus_unlock_post' ) );
65
-		add_action( 'wp_ajax_editus_hide_tour',     array( $this, 'editus_hide_tour' ) );
66
-		add_action( 'wp_ajax_editus_set_post_setting',     array( $this, 'editus_set_post_setting' ) );
67
-		add_action( 'wp_ajax_editus_get_ase_options',     array( $this, 'get_ase_options' ) );
68
-		add_action( 'wp_ajax_editus_delete_post',     array( $this, 'delete_post' ) );
69
-		add_action( 'wp_ajax_editus_featured_img',     array( $this, 'set_featured_img' ) );
70
-		add_action( 'wp_ajax_editus_del_featured_img',     array( $this, 'del_featured_img' ) );
60
+		add_action('wp_ajax_get_aesop_component', array($this, 'get_aesop_component'));
61
+		add_action('wp_ajax_editus_do_shortcode', array($this, 'editus_do_shortcode'));
62
+        add_action('wp_ajax_editus_do_block', array($this, 'editus_do_block'));
63
+		add_action('wp_ajax_editus_lock_post', array($this, 'editus_lock_post'));
64
+		add_action('wp_ajax_editus_unlock_post', array($this, 'editus_unlock_post'));
65
+		add_action('wp_ajax_editus_hide_tour', array($this, 'editus_hide_tour'));
66
+		add_action('wp_ajax_editus_set_post_setting', array($this, 'editus_set_post_setting'));
67
+		add_action('wp_ajax_editus_get_ase_options', array($this, 'get_ase_options'));
68
+		add_action('wp_ajax_editus_delete_post', array($this, 'delete_post'));
69
+		add_action('wp_ajax_editus_featured_img', array($this, 'set_featured_img'));
70
+		add_action('wp_ajax_editus_del_featured_img', array($this, 'del_featured_img'));
71 71
         
72
-        add_action( 'wp_ajax_editus_publish_post',     array( $this, 'on_publish_post' ) );
72
+        add_action('wp_ajax_editus_publish_post', array($this, 'on_publish_post'));
73 73
         
74
-        add_action( 'wp_ajax_editus_create_gallery',     array( $this, 'create_gallery' ) );
75
-        add_action( 'wp_ajax_editus_update_gallery',     array( $this, 'update_gallery' ) );
74
+        add_action('wp_ajax_editus_create_gallery', array($this, 'create_gallery'));
75
+        add_action('wp_ajax_editus_update_gallery', array($this, 'update_gallery'));
76 76
 
77 77
 		// enable saving custom fields through REST API
78 78
 		self::enable_metasave('post');
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	public static function get_instance() {
104 104
 
105 105
 		// If the single instance hasn't been set, set it now.
106
-		if ( null == self::$instance ) {
106
+		if (null == self::$instance) {
107 107
 			self::$instance = new self;
108 108
 		}
109 109
 
@@ -120,18 +120,18 @@  discard block
 block discarded – undo
120 120
 	 *                                       WPMU is disabled or plugin is
121 121
 	 *                                       activated on an individual blog.
122 122
 	 */
123
-	public static function activate( $network_wide ) {
123
+	public static function activate($network_wide) {
124 124
 
125
-		if ( function_exists( 'is_multisite' ) && is_multisite() ) {
125
+		if (function_exists('is_multisite') && is_multisite()) {
126 126
 
127
-			if ( $network_wide  ) {
127
+			if ($network_wide) {
128 128
 
129 129
 				// Get all blog ids
130 130
 				$blog_ids = self::get_blog_ids();
131 131
 
132
-				foreach ( $blog_ids as $blog_id ) {
132
+				foreach ($blog_ids as $blog_id) {
133 133
 
134
-					switch_to_blog( $blog_id );
134
+					switch_to_blog($blog_id);
135 135
 					self::single_activate();
136 136
 				}
137 137
 
@@ -157,18 +157,18 @@  discard block
 block discarded – undo
157 157
 	 *                                       WPMU is disabled or plugin is
158 158
 	 *                                       deactivated on an individual blog.
159 159
 	 */
160
-	public static function deactivate( $network_wide ) {
160
+	public static function deactivate($network_wide) {
161 161
 
162
-		if ( function_exists( 'is_multisite' ) && is_multisite() ) {
162
+		if (function_exists('is_multisite') && is_multisite()) {
163 163
 
164
-			if ( $network_wide ) {
164
+			if ($network_wide) {
165 165
 
166 166
 				// Get all blog ids
167 167
 				$blog_ids = self::get_blog_ids();
168 168
 
169
-				foreach ( $blog_ids as $blog_id ) {
169
+				foreach ($blog_ids as $blog_id) {
170 170
 
171
-					switch_to_blog( $blog_id );
171
+					switch_to_blog($blog_id);
172 172
 					self::single_deactivate();
173 173
 
174 174
 				}
@@ -192,13 +192,13 @@  discard block
 block discarded – undo
192 192
 	 *
193 193
 	 * @param int     $blog_id ID of the new blog.
194 194
 	 */
195
-	public function activate_new_site( $blog_id ) {
195
+	public function activate_new_site($blog_id) {
196 196
 
197
-		if ( 1 !== did_action( 'wpmu_new_blog' ) ) {
197
+		if (1 !== did_action('wpmu_new_blog')) {
198 198
 			return;
199 199
 		}
200 200
 
201
-		switch_to_blog( $blog_id );
201
+		switch_to_blog($blog_id);
202 202
 		self::single_activate();
203 203
 		restore_current_blog();
204 204
 
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 			WHERE archived = '0' AND spam = '0'
224 224
 			AND deleted = '0'";
225 225
 
226
-		return $wpdb->get_col( $sql );
226
+		return $wpdb->get_col($sql);
227 227
 
228 228
 	}
229 229
 
@@ -234,18 +234,18 @@  discard block
 block discarded – undo
234 234
 	 */
235 235
 	private static function single_activate() {
236 236
 
237
-		$curr_version = get_option( 'lasso_version' );
237
+		$curr_version = get_option('lasso_version');
238 238
 
239 239
 		// update upgraded from
240
-		if ( $curr_version ) {
241
-			update_option( 'lasso_updated_from', $curr_version );
240
+		if ($curr_version) {
241
+			update_option('lasso_updated_from', $curr_version);
242 242
 		}
243 243
 
244 244
 		// update lasso version option
245
-		update_option( 'lasso_version', LASSO_VERSION );
245
+		update_option('lasso_version', LASSO_VERSION);
246 246
 
247 247
 		// set transietn for activation welcome
248
-		set_transient( '_lasso_welcome_redirect', true, 30 );
248
+		set_transient('_lasso_welcome_redirect', true, 30);
249 249
 
250 250
 
251 251
 	}
@@ -267,15 +267,15 @@  discard block
 block discarded – undo
267 267
 	public function load_plugin_textdomain() {
268 268
 
269 269
 		$domain = $this->plugin_slug;
270
-		$locale = apply_filters( 'plugin_locale', get_locale(), $domain );
270
+		$locale = apply_filters('plugin_locale', get_locale(), $domain);
271 271
 
272
-		$out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' );
272
+		$out = load_textdomain($domain, trailingslashit(LASSO_DIR).'languages/'.$domain.'-'.$locale.'.mo');
273 273
 	}
274 274
 	
275 275
     // new ajax function to lock post for editing
276 276
 	public function editus_lock_post()
277 277
 	{
278
-		$post_id= $_POST["postid"];
278
+		$post_id = $_POST["postid"];
279 279
 		$locked = wp_check_post_lock($post_id);
280 280
 		
281 281
 		if (!$locked) {
@@ -283,17 +283,17 @@  discard block
 block discarded – undo
283 283
 			echo "true";
284 284
 		} else {
285 285
 			$user_info = get_userdata($locked);
286
-			echo _e( 'Post being edited by ', 'lasso' ).$user_info->first_name .  " " . $user_info->last_name;
286
+			echo _e('Post being edited by ', 'lasso').$user_info->first_name." ".$user_info->last_name;
287 287
 		}
288 288
 		exit;
289 289
 	}
290 290
 	
291 291
 	public function editus_unlock_post()
292 292
 	{
293
-		$post_id= $_POST["postid"];
293
+		$post_id = $_POST["postid"];
294 294
 		$locked = wp_check_post_lock($post_id);
295 295
         if (!$locked) {
296
-            delete_post_meta( $post_id, '_edit_lock');
296
+            delete_post_meta($post_id, '_edit_lock');
297 297
         }
298 298
 		echo "true";
299 299
 		
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 	{
306 306
 		$user_id = get_current_user_ID();
307 307
 				
308
-		update_user_meta( $user_id, 'lasso_hide_tour', true );
308
+		update_user_meta($user_id, 'lasso_hide_tour', true);
309 309
 		exit;
310 310
 	}
311 311
 	
@@ -316,15 +316,15 @@  discard block
 block discarded – undo
316 316
 		$data = array();
317 317
 		parse_str($_POST['data'], $data);
318 318
 		
319
-		if (!wp_verify_nonce( $data[ 'nonce' ], 'lasso-update-post-settings' )) {
319
+		if (!wp_verify_nonce($data['nonce'], 'lasso-update-post-settings')) {
320 320
 			wp_send_json_error();
321 321
 			exit;
322 322
 		}
323 323
 		
324
-		$status = isset( $data['status'] ) ? $data['status'] : false;
325
-		$postid = isset( $data['postid'] ) ? $data['postid'] : false;
326
-		$slug   = isset( $data['story_slug'] ) ? $data['story_slug'] : false;
327
-        $excerpt   = isset( $data['excerpt'] ) ? $data['excerpt'] : false;
324
+		$status = isset($data['status']) ? $data['status'] : false;
325
+		$postid = isset($data['postid']) ? $data['postid'] : false;
326
+		$slug   = isset($data['story_slug']) ? $data['story_slug'] : false;
327
+        $excerpt = isset($data['excerpt']) ? $data['excerpt'] : false;
328 328
 	
329 329
 
330 330
 		$args = array(
@@ -336,24 +336,24 @@  discard block
 block discarded – undo
336 336
 		
337 337
 		
338 338
 
339
-		wp_update_post( apply_filters( 'lasso_object_status_update_args', $args ) );
339
+		wp_update_post(apply_filters('lasso_object_status_update_args', $args));
340 340
 		
341 341
 		// update categories
342
-		$cats  = isset( $data['story_cats'] ) ? $data['story_cats'] : false;
342
+		$cats = isset($data['story_cats']) ? $data['story_cats'] : false;
343 343
 		
344
-		self::set_post_terms( $postid, $cats, 'category' );
344
+		self::set_post_terms($postid, $cats, 'category');
345 345
 		
346 346
 		// update tags
347
-		$tags = isset( $data['story_tags'] ) ? $data['story_tags'] : false;
348
-		self::set_post_terms( $postid, $tags, 'post_tag' );
347
+		$tags = isset($data['story_tags']) ? $data['story_tags'] : false;
348
+		self::set_post_terms($postid, $tags, 'post_tag');
349 349
 		
350 350
 		//update date
351
-		$date  = isset( $data['post_date'] ) ? $data['post_date'] : false;
352
-		self::set_date( $postid, $date );
351
+		$date = isset($data['post_date']) ? $data['post_date'] : false;
352
+		self::set_date($postid, $date);
353 353
 		
354
-		do_action( 'lasso_post_updated', $postid, $slug, $status, get_current_user_ID() );
355
-		$response= array(
356
-			'link'   => get_permalink($postid). (($status=='publish') ? '' : '&preview=true')
354
+		do_action('lasso_post_updated', $postid, $slug, $status, get_current_user_ID());
355
+		$response = array(
356
+			'link'   => get_permalink($postid).(($status == 'publish') ? '' : '&preview=true')
357 357
 		);
358 358
 		wp_send_json_success($response);
359 359
 		exit;
@@ -361,11 +361,11 @@  discard block
 block discarded – undo
361 361
 	
362 362
 	public static function enable_metasave($type)
363 363
 	{
364
-		register_rest_field( $type, 'metadata', array(
365
-			'get_callback' => function ( $data ) {
366
-				return get_post_meta( $data['id']);//, '', '' );
364
+		register_rest_field($type, 'metadata', array(
365
+			'get_callback' => function($data) {
366
+				return get_post_meta($data['id']); //, '', '' );
367 367
 			}, 
368
-			'update_callback' => function( $data, $post ) {
368
+			'update_callback' => function($data, $post) {
369 369
 				foreach ($data as $key => $value) {
370 370
 					update_post_meta($post->ID, $key, $value);
371 371
 				}
@@ -377,13 +377,13 @@  discard block
 block discarded – undo
377 377
 	public function editus_do_shortcode()
378 378
 	{
379 379
 		
380
-		$code= $_POST["code"];
380
+		$code = $_POST["code"];
381 381
 		$code = str_replace('\"', '"', $code);
382 382
 		
383
-		$code_wrapped = lasso_wrap_shortcodes( $code);
384
-		$out =  do_shortcode($code);
383
+		$code_wrapped = lasso_wrap_shortcodes($code);
384
+		$out = do_shortcode($code);
385 385
 		if ($out != '') {
386
-			$out =  do_shortcode($code_wrapped);
386
+			$out = do_shortcode($code_wrapped);
387 387
 			echo $out;
388 388
 			exit;
389 389
 		}
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 		/** @var \WP_Embed $wp_embed */
394 394
 		global $wp_embed;
395 395
 		$wp_embed->post_ID = $_POST["ID"];
396
-		$out =$wp_embed->run_shortcode( $code_wrapped );
396
+		$out = $wp_embed->run_shortcode($code_wrapped);
397 397
 		
398 398
 		echo $out;
399 399
 		exit;
@@ -402,9 +402,9 @@  discard block
 block discarded – undo
402 402
     public function editus_do_block()
403 403
 	{
404 404
 		
405
-		$code= $_POST["code"];
405
+		$code = $_POST["code"];
406 406
 
407
-        $out = do_blocks( $code );
407
+        $out = do_blocks($code);
408 408
 		
409 409
 		echo $out;
410 410
 		exit;
@@ -414,56 +414,56 @@  discard block
 block discarded – undo
414 414
 	{
415 415
 		
416 416
 		
417
-		$code= $_POST["code"];
417
+		$code = $_POST["code"];
418 418
 		$atts = array(
419 419
 		 );
420 420
 		foreach ($_POST as $key => $value) {
421
-			if ($key !="code" && $key !="action") {
421
+			if ($key != "code" && $key != "action") {
422 422
 				$atts[$key] = $value;
423 423
 			}
424 424
 		}
425 425
 		if ($code == "aesop_video") {
426
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
426
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
427 427
 		    echo aesop_video_shortcode($atts);
428 428
 		}
429 429
 		else if ($code == "aesop_image") {
430
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
430
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
431 431
 		    echo aesop_image_shortcode($atts);
432 432
 		}
433 433
 		else if ($code == "aesop_quote") {
434
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
434
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
435 435
 		    echo aesop_quote_shortcode($atts);
436 436
 		}
437 437
 		else if ($code == "aesop_parallax") {
438
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
438
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
439 439
 		    echo aesop_parallax_shortcode($atts);
440 440
 		}
441 441
 		else if ($code == "aesop_character") {
442
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
442
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
443 443
 		    echo aesop_character_shortcode($atts);
444 444
 		}
445 445
 		else if ($code == "aesop_collection") {
446
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
446
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
447 447
 		    echo aesop_collection_shortcode($atts);
448 448
 		}
449 449
 		else if ($code == "aesop_chapter") {
450
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
450
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
451 451
 		    echo aesop_chapter_shortcode($atts);
452 452
 		}
453 453
 		else if ($code == "aesop_content") {
454
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
454
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
455 455
 		    echo aesop_content_shortcode($atts, $atts['content_data']);
456 456
 		}
457 457
 		else if ($code == "aesop_gallery") {
458
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
459
-		    echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
458
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
459
+		    echo do_shortcode('[aesop_gallery id="'.$atts["id"].'"]');
460 460
 		}
461 461
 		else if ($code == "aesop_audio") {
462
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
462
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
463 463
 		    echo aesop_audio_shortcode($atts);
464 464
 		}
465 465
 		else if ($code == "aesop_document") {
466
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php');
466
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php');
467 467
 		    echo aesop_document_shortcode($atts);
468 468
 		}
469 469
         /*else if ($code == "aesop_content") {
@@ -492,24 +492,24 @@  discard block
 block discarded – undo
492 492
         $extra = "";
493 493
         
494 494
         // try to use srcset and sizes on new WP installs
495
-		if ( function_exists('wp_get_attachment_image_srcset') && $attachment_id = attachment_url_to_postid( $atts['img'] ) ) {
496
-			$srcset = wp_get_attachment_image_srcset( $attachment_id, 'full' );
497
-			$sizes = wp_get_attachment_image_sizes( $attachment_id, 'full' );
495
+		if (function_exists('wp_get_attachment_image_srcset') && $attachment_id = attachment_url_to_postid($atts['img'])) {
496
+			$srcset = wp_get_attachment_image_srcset($attachment_id, 'full');
497
+			$sizes = wp_get_attachment_image_sizes($attachment_id, 'full');
498 498
             $extra = "srcset='$srcset' sizes='$sizes' ";
499 499
         }
500
-        if ($atts['align']=="left") {
500
+        if ($atts['align'] == "left") {
501 501
             $extra .= 'class="alignleft';
502
-        } else if ($atts['align']=="right") {
502
+        } else if ($atts['align'] == "right") {
503 503
             $extra .= 'class="alignright';
504 504
         } else {
505 505
             $extra .= 'class="aligncenter';
506 506
         }
507 507
         if ($atts['imgwidth'] || $atts['imgheight']) {
508 508
             if ($atts['imgwidth']) {
509
-                $extra .= 'width:'. $atts['imgwidth'].';';
509
+                $extra .= 'width:'.$atts['imgwidth'].';';
510 510
             }
511 511
             if ($atts['imgheight']) {
512
-                $extra .= 'height:'. $atts['imgheight'].';';
512
+                $extra .= 'height:'.$atts['imgheight'].';';
513 513
             }
514 514
             
515 515
         }
@@ -521,15 +521,15 @@  discard block
 block discarded – undo
521 521
         //echo ' class="wp-image- lasso--wpimg__wrap lasso-component">';
522 522
         echo ' class="wp-caption lasso-component">';
523 523
         $hrefset = false;
524
-        if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption']=="url" ))
524
+        if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption'] == "url"))
525 525
         {
526
-            echo '<a href="' . $atts['link'] . '">';
526
+            echo '<a href="'.$atts['link'].'">';
527 527
             $hrefset = true;
528
-        } else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img' ) {
529
-            echo '<a href="' . $atts['img'] . '">';
528
+        } else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img') {
529
+            echo '<a href="'.$atts['img'].'">';
530 530
             $hrefset = true;
531 531
         }
532
-        echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  .  '" '. $extra. '>';
532
+        echo '<img src="'.$atts['img'].'" alt="'.$atts['alt'].'" '.$extra.'>';
533 533
         if ($hrefset)
534 534
         {
535 535
             echo '</a>';
@@ -547,20 +547,20 @@  discard block
 block discarded – undo
547 547
 	public function get_ase_options()
548 548
 	{
549 549
 		$blob = lasso_editor_options_blob();
550
-		$code= $_POST["component"];
550
+		$code = $_POST["component"];
551 551
 		echo $blob[$code];
552 552
 		exit; 
553 553
 	}
554 554
 	
555 555
 	public function delete_post( ) {
556 556
 
557
-		$postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
557
+		$postid = isset($_POST['postid']) ? $_POST['postid'] : false;
558 558
 
559 559
 		// bail out if the current user can't publish posts
560
-		if ( !lasso_user_can( 'delete_post', $postid ) )
560
+		if (!lasso_user_can('delete_post', $postid))
561 561
 			return;
562 562
 		
563
-		if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_delete_post' )) {
563
+		if (!wp_verify_nonce($_POST['nonce'], 'lasso_delete_post')) {
564 564
 			wp_send_json_error();
565 565
 			exit;
566 566
 		}
@@ -570,9 +570,9 @@  discard block
 block discarded – undo
570 570
 			'post_status' 	=> 'trash'
571 571
 		);
572 572
 
573
-		wp_update_post( apply_filters( 'lasso_object_deleted_args', $args ) );
573
+		wp_update_post(apply_filters('lasso_object_deleted_args', $args));
574 574
 
575
-		do_action( 'lasso_object_deleted', $postid, get_current_user_ID() );
575
+		do_action('lasso_object_deleted', $postid, get_current_user_ID());
576 576
 
577 577
 		exit;
578 578
 	}
@@ -580,40 +580,40 @@  discard block
 block discarded – undo
580 580
     /* This function doesn't actually publish post, but should be called when a post is published */
581 581
     public function on_publish_post( ) {
582 582
 
583
-		$post_id = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
583
+		$post_id = isset($_POST['postid']) ? $_POST['postid'] : false;
584 584
         
585
-        do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) );
585
+        do_action('transition_post_status', 'publish', 'draft', get_post($post_id));
586 586
 
587 587
 		exit;
588 588
 	}
589 589
 	
590 590
 	public function set_featured_img( ) {
591 591
 
592
-		$postid  	= isset( $_POST['postid'] ) ? $_POST['postid'] : false;
593
-		$image_id  	= isset( $_POST['image_id'] ) ? absint( $_POST['image_id'] ) : false;
594
-		if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_gallery' )) {
592
+		$postid = isset($_POST['postid']) ? $_POST['postid'] : false;
593
+		$image_id = isset($_POST['image_id']) ? absint($_POST['image_id']) : false;
594
+		if (!wp_verify_nonce($_POST['nonce'], 'lasso_gallery')) {
595 595
 			wp_send_json_error();
596 596
 			exit;
597 597
 		}	
598 598
 
599
-		set_post_thumbnail( $postid, $image_id );
599
+		set_post_thumbnail($postid, $image_id);
600 600
 
601
-		do_action( 'lasso_featured_image_set', $postid, $image_id, get_current_user_ID() );
601
+		do_action('lasso_featured_image_set', $postid, $image_id, get_current_user_ID());
602 602
 
603 603
 		exit;
604 604
 	}
605 605
 	
606 606
 	public function del_featured_img( ) {
607 607
 
608
-		$postid  = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
609
-		if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_gallery' )) {
608
+		$postid = isset($_POST['postid']) ? $_POST['postid'] : false;
609
+		if (!wp_verify_nonce($_POST['nonce'], 'lasso_gallery')) {
610 610
 			wp_send_json_error();
611 611
 			exit;
612 612
 		}	
613 613
 
614
-		delete_post_thumbnail( $postid );
614
+		delete_post_thumbnail($postid);
615 615
 
616
-		do_action( 'lasso_featured_image_deleted', $postid, get_current_user_ID() );
616
+		do_action('lasso_featured_image_deleted', $postid, get_current_user_ID());
617 617
 
618 618
 		exit;
619 619
 	}
@@ -634,17 +634,17 @@  discard block
 block discarded – undo
634 634
 		return self::$revisions;
635 635
 	}*/
636 636
 	
637
-	public function set_post_terms( $postid, $value, $taxonomy ) {
638
-		if( $value ) {
639
-			$value = explode( ',', $value );
640
-			$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
637
+	public function set_post_terms($postid, $value, $taxonomy) {
638
+		if ($value) {
639
+			$value = explode(',', $value);
640
+			$allow_new_category = lasso_editor_get_option('allow_new_category', 'lasso_editor');
641 641
 			
642
-			if ($taxonomy =='category') {
642
+			if ($taxonomy == 'category') {
643 643
                 // convert from names to category ids
644 644
 				$cats = array();
645 645
 				foreach ($value as $cat) {
646 646
 					$cat_id = get_cat_ID($cat);
647
-					if ($cat_id !=0) {
647
+					if ($cat_id != 0) {
648 648
 						$cats [] = $cat_id;
649 649
 					} else if ($allow_new_category) {
650 650
 					    $cats [] = wp_create_category($cat);
@@ -653,71 +653,71 @@  discard block
 block discarded – undo
653 653
 				$value = $cats;
654 654
 			}
655 655
 	
656
-			$result = wp_set_object_terms( $postid, $value, $taxonomy );
656
+			$result = wp_set_object_terms($postid, $value, $taxonomy);
657 657
 		}
658
-		else  {
658
+		else {
659 659
 			//remove all terms from post
660
-			$result = wp_set_object_terms( $postid, null, $taxonomy );
660
+			$result = wp_set_object_terms($postid, null, $taxonomy);
661 661
 		}
662 662
 
663
-		if ( ! is_wp_error( $result ) ) {
663
+		if (!is_wp_error($result)) {
664 664
 			return true;
665
-		}else{
665
+		} else {
666 666
 			return false;
667 667
 		}
668 668
 	}
669 669
     
670 670
     public function create_gallery( ) {
671 671
 
672
-		$postid  	= isset( $_POST['postid'] ) ? $_POST['postid'] : false;
672
+		$postid = isset($_POST['postid']) ? $_POST['postid'] : false;
673 673
         
674
-		if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_gallery' )) {
674
+		if (!wp_verify_nonce($_POST['nonce'], 'lasso_gallery')) {
675 675
 			wp_send_json_error();
676 676
 			exit;
677 677
 		}	
678 678
 
679
-		if (  ! lasso_user_can( 'publish_posts' ) ) {
679
+		if (!lasso_user_can('publish_posts')) {
680 680
 			return false;
681 681
 
682 682
 		}
683 683
 
684
-		$gallery_ids = isset( $_POST['gallery_ids'] ) ? $_POST['gallery_ids'] : false;
684
+		$gallery_ids = isset($_POST['gallery_ids']) ? $_POST['gallery_ids'] : false;
685 685
 
686 686
 		// bail if no gallery ids
687
-		if ( empty( $gallery_ids ) ) {
687
+		if (empty($gallery_ids)) {
688 688
 			return false;
689 689
 		}
690 690
 
691
-		$type   		 = isset( $_POST['gallery_type'] ) ? $_POST['gallery_type'] : false;
692
-		$edgallerytitle	 = isset( $_POST['edgallerytitle'] ) ? $_POST['edgallerytitle'] : $postid.'-'.rand();
691
+		$type = isset($_POST['gallery_type']) ? $_POST['gallery_type'] : false;
692
+		$edgallerytitle = isset($_POST['edgallerytitle']) ? $_POST['edgallerytitle'] : $postid.'-'.rand();
693 693
 
694 694
 		// insert a new gallery
695 695
 		$args = array(
696
-			'post_title'    => $edgallerytitle ,
696
+			'post_title'    => $edgallerytitle,
697 697
 			'post_status'   => 'publish',
698 698
 			'post_type'     => 'ai_galleries'
699 699
 		);
700 700
 
701
-		$postid = wp_insert_post( apply_filters( 'lasso_insert_gallery_args', $args ) );
701
+		$postid = wp_insert_post(apply_filters('lasso_insert_gallery_args', $args));
702 702
 
703 703
 		// update gallery ids
704
-		if ( $gallery_ids ) {
704
+		if ($gallery_ids) {
705 705
 
706
-			update_post_meta( $postid, '_ase_gallery_images', $gallery_ids );
706
+			update_post_meta($postid, '_ase_gallery_images', $gallery_ids);
707 707
 
708 708
 		}
709 709
 
710 710
 		// update the gallery type
711
-		if ( !empty( $type ) ) {
711
+		if (!empty($type)) {
712 712
 
713
-			update_post_meta( $postid, 'aesop_gallery_type', $type );
713
+			update_post_meta($postid, 'aesop_gallery_type', $type);
714 714
 
715 715
 		}
716 716
 
717
-		do_action( 'lasso_gallery_published', $postid, $gallery_ids, get_current_user_ID() );
717
+		do_action('lasso_gallery_published', $postid, $gallery_ids, get_current_user_ID());
718 718
 
719 719
 
720
-		echo json_encode( array(
720
+		echo json_encode(array(
721 721
 			'message' => 'gallery-created',
722 722
 			'id' => $postid)
723 723
 		);
@@ -726,114 +726,114 @@  discard block
 block discarded – undo
726 726
     
727 727
     public function update_gallery( ) {
728 728
         
729
-		$options      = isset( $_POST['fields'] ) ? $_POST['fields'] : false;
729
+		$options      = isset($_POST['fields']) ? $_POST['fields'] : false;
730 730
         
731
-		$postid   	  = !empty( $options ) ? (int) $options['id'] : false;
732
-		$gallery_ids  = isset( $_POST['gallery_ids'] ) ? $_POST['gallery_ids'] : false;
733
-		if ( $_POST[ 'gallery_type' ] ) {
734
-			$type = $_POST[ 'gallery_type' ];
735
-		}elseif ( ! empty( $options ) && $options[ 'galleryType' ] ) {
736
-			$type = $options[ 'galleryType' ];
737
-		}else{
731
+		$postid = !empty($options) ? (int) $options['id'] : false;
732
+		$gallery_ids  = isset($_POST['gallery_ids']) ? $_POST['gallery_ids'] : false;
733
+		if ($_POST['gallery_type']) {
734
+			$type = $_POST['gallery_type'];
735
+		}elseif (!empty($options) && $options['galleryType']) {
736
+			$type = $options['galleryType'];
737
+		} else {
738 738
 			$type = false;
739 739
 		}
740 740
 
741
-		self::save_gallery_options( $postid, $gallery_ids, $options, $type );
741
+		self::save_gallery_options($postid, $gallery_ids, $options, $type);
742 742
 
743
-        echo json_encode( array('message' => 'gallery-updated') );
743
+        echo json_encode(array('message' => 'gallery-updated'));
744 744
 
745 745
         exit;
746 746
 	}
747 747
     
748
-    public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) {
748
+    public function save_gallery_options($postid, $gallery_ids, $options, $type = false) {
749 749
 
750 750
 		// gallery width
751
-		$gallery_width = isset( $options['width'] ) ? $options['width'] : false;
751
+		$gallery_width = isset($options['width']) ? $options['width'] : false;
752 752
 
753 753
 		// gallery grid item width
754
-		$item_width = isset( $options['itemwidth'] ) ? $options['itemwidth'] : false;
754
+		$item_width = isset($options['itemwidth']) ? $options['itemwidth'] : false;
755 755
 
756 756
 		// caption
757
-		$caption = isset( $options['caption'] ) ? $options['caption'] : false;
757
+		$caption = isset($options['caption']) ? $options['caption'] : false;
758 758
 
759 759
 		// gallery transition
760
-		$transition = isset( $options['transition'] ) ? $options['transition'] : false;
760
+		$transition = isset($options['transition']) ? $options['transition'] : false;
761 761
 
762 762
 		// gallery transition speed
763
-		$transitionSpeed = isset( $options['speed'] ) ? $options['speed'] : false;
763
+		$transitionSpeed = isset($options['speed']) ? $options['speed'] : false;
764 764
 
765 765
 		// gallery hide thumbs
766
-		$hideThumbs = isset( $options['hideThumbs'] ) ? $options['hideThumbs'] : false;
766
+		$hideThumbs = isset($options['hideThumbs']) ? $options['hideThumbs'] : false;
767 767
 
768 768
 		// photoset layout hardwired to on for now
769
-		$psLayout = isset( $options['pslayout'] ) ? $options['pslayout'] : false;
769
+		$psLayout = isset($options['pslayout']) ? $options['pslayout'] : false;
770 770
 
771 771
 		// photoset layout
772
-		$psLightbox = 'on';//isset( $options['pslightbox'] ) ? $options['pslightbox'] : false;
772
+		$psLightbox = 'on'; //isset( $options['pslightbox'] ) ? $options['pslightbox'] : false;
773 773
 		
774 774
 		// hero gallery height
775
-		$gallery_height = isset( $options['height'] ) ? $options['height'] : false;
775
+		$gallery_height = isset($options['height']) ? $options['height'] : false;
776 776
 
777 777
 		// update gallery ids
778
-		if ( !empty( $gallery_ids ) ) {
778
+		if (!empty($gallery_ids)) {
779 779
 
780
-			update_post_meta( $postid, '_ase_gallery_images', $gallery_ids );
780
+			update_post_meta($postid, '_ase_gallery_images', $gallery_ids);
781 781
 
782 782
 		}
783 783
 
784
-		update_post_meta( $postid, 'aesop_gallery_type', sanitize_text_field( trim( $type ) ) );
784
+		update_post_meta($postid, 'aesop_gallery_type', sanitize_text_field(trim($type)));
785 785
 
786
-		update_post_meta( $postid, 'aesop_gallery_width', sanitize_text_field( trim( $gallery_width ) ) );
786
+		update_post_meta($postid, 'aesop_gallery_width', sanitize_text_field(trim($gallery_width)));
787 787
 
788
-		update_post_meta( $postid, 'aesop_grid_gallery_width', sanitize_text_field( trim( $item_width ) ) );
788
+		update_post_meta($postid, 'aesop_grid_gallery_width', sanitize_text_field(trim($item_width)));
789 789
 
790
-		update_post_meta( $postid, 'aesop_gallery_caption', sanitize_text_field( trim( $caption ) ) );
790
+		update_post_meta($postid, 'aesop_gallery_caption', sanitize_text_field(trim($caption)));
791 791
 
792
-		update_post_meta( $postid, 'aesop_thumb_gallery_transition', sanitize_text_field( trim( $transition ) ) );
792
+		update_post_meta($postid, 'aesop_thumb_gallery_transition', sanitize_text_field(trim($transition)));
793 793
 
794
-		update_post_meta( $postid, 'aesop_thumb_gallery_transition_speed', absint( trim( $transitionSpeed ) ) );
794
+		update_post_meta($postid, 'aesop_thumb_gallery_transition_speed', absint(trim($transitionSpeed)));
795 795
 
796
-		update_post_meta( $postid, 'aesop_thumb_gallery_hide_thumbs', sanitize_text_field( trim( $hideThumbs ) ) );
796
+		update_post_meta($postid, 'aesop_thumb_gallery_hide_thumbs', sanitize_text_field(trim($hideThumbs)));
797 797
 
798
-		update_post_meta( $postid, 'aesop_photoset_gallery_layout', sanitize_text_field( trim( $psLayout ) ) );
798
+		update_post_meta($postid, 'aesop_photoset_gallery_layout', sanitize_text_field(trim($psLayout)));
799 799
 
800
-		update_post_meta( $postid, 'aesop_photoset_gallery_lightbox', sanitize_text_field( trim( $psLightbox ) ) );
800
+		update_post_meta($postid, 'aesop_photoset_gallery_lightbox', sanitize_text_field(trim($psLightbox)));
801 801
 		
802
-		update_post_meta( $postid, 'aesop_hero_gallery_height', sanitize_text_field( trim( $gallery_height ) ) );
802
+		update_post_meta($postid, 'aesop_hero_gallery_height', sanitize_text_field(trim($gallery_height)));
803 803
 		
804 804
 		//hardwired for now
805 805
 		
806
-		update_post_meta( $postid, 'aesop_hero_gallery_transition_speed', 300 );
806
+		update_post_meta($postid, 'aesop_hero_gallery_transition_speed', 300);
807 807
 
808 808
 	}
809 809
 	
810
-	function getEnglishMonthName($foreignMonthName){
810
+	function getEnglishMonthName($foreignMonthName) {
811 811
 
812 812
 		  setlocale(LC_ALL, 'en_US');
813 813
 
814
-		  $month_numbers = range(1,12);
814
+		  $month_numbers = range(1, 12);
815 815
 
816
-		  foreach($month_numbers as $month)
817
-			$english_months[] = strftime('%B',mktime(0,0,0,$month,1,2011));
816
+		  foreach ($month_numbers as $month)
817
+			$english_months[] = strftime('%B', mktime(0, 0, 0, $month, 1, 2011));
818 818
 
819 819
 		  setlocale(LC_ALL, get_locale());
820 820
 
821
-		  foreach($month_numbers as $month)
822
-			$foreign_months[] = utf8_encode(strftime('%B',mktime(0,0,0,$month,1,2011)));
821
+		  foreach ($month_numbers as $month)
822
+			$foreign_months[] = utf8_encode(strftime('%B', mktime(0, 0, 0, $month, 1, 2011)));
823 823
 
824 824
 		  return str_replace($foreign_months, $english_months, $foreignMonthName);
825 825
 	}
826 826
 
827 827
 
828 828
 	
829
-	public function set_date( $postid, $value) {
830
-		if( $value ) {
831
-			$value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time( 'timestamp', 1 ));
829
+	public function set_date($postid, $value) {
830
+		if ($value) {
831
+			$value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time('timestamp', 1));
832 832
             wp_update_post(
833
-				array (
833
+				array(
834 834
 					'ID'            => $postid, // ID of the post to update
835
-					'post_date'     => date( 'Y-m-d H:i:s',  strtotime($value) ),
836
-					'post_date_gmt'     => gmdate( 'Y-m-d H:i:s',  strtotime($value) ),
835
+					'post_date'     => date('Y-m-d H:i:s', strtotime($value)),
836
+					'post_date_gmt'     => gmdate('Y-m-d H:i:s', strtotime($value)),
837 837
 				)
838 838
 			);
839 839
 		}
Please login to merge, or discard this patch.
Braces   +24 added lines, -33 removed lines patch added patch discarded remove patch
@@ -425,44 +425,34 @@  discard block
 block discarded – undo
425 425
 		if ($code == "aesop_video") {
426 426
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
427 427
 		    echo aesop_video_shortcode($atts);
428
-		}
429
-		else if ($code == "aesop_image") {
428
+		} else if ($code == "aesop_image") {
430 429
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
431 430
 		    echo aesop_image_shortcode($atts);
432
-		}
433
-		else if ($code == "aesop_quote") {
431
+		} else if ($code == "aesop_quote") {
434 432
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
435 433
 		    echo aesop_quote_shortcode($atts);
436
-		}
437
-		else if ($code == "aesop_parallax") {
434
+		} else if ($code == "aesop_parallax") {
438 435
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
439 436
 		    echo aesop_parallax_shortcode($atts);
440
-		}
441
-		else if ($code == "aesop_character") {
437
+		} else if ($code == "aesop_character") {
442 438
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
443 439
 		    echo aesop_character_shortcode($atts);
444
-		}
445
-		else if ($code == "aesop_collection") {
440
+		} else if ($code == "aesop_collection") {
446 441
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
447 442
 		    echo aesop_collection_shortcode($atts);
448
-		}
449
-		else if ($code == "aesop_chapter") {
443
+		} else if ($code == "aesop_chapter") {
450 444
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
451 445
 		    echo aesop_chapter_shortcode($atts);
452
-		}
453
-		else if ($code == "aesop_content") {
446
+		} else if ($code == "aesop_content") {
454 447
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
455 448
 		    echo aesop_content_shortcode($atts, $atts['content_data']);
456
-		}
457
-		else if ($code == "aesop_gallery") {
449
+		} else if ($code == "aesop_gallery") {
458 450
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
459 451
 		    echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
460
-		}
461
-		else if ($code == "aesop_audio") {
452
+		} else if ($code == "aesop_audio") {
462 453
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
463 454
 		    echo aesop_audio_shortcode($atts);
464
-		}
465
-		else if ($code == "aesop_document") {
455
+		} else if ($code == "aesop_document") {
466 456
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php');
467 457
 		    echo aesop_document_shortcode($atts);
468 458
 		}
@@ -472,8 +462,7 @@  discard block
 block discarded – undo
472 462
 		}*/
473 463
         else if ($code == "aesop_wpimg") {
474 464
             self::wpimg($atts);
475
-		}
476
-		else {
465
+		} else {
477 466
 			$code = '['.$code.' ';
478 467
 			foreach ($atts as $key => $value) {
479 468
 			    $code = ''.$key.'="'.$value.'" ';
@@ -557,8 +546,9 @@  discard block
 block discarded – undo
557 546
 		$postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
558 547
 
559 548
 		// bail out if the current user can't publish posts
560
-		if ( !lasso_user_can( 'delete_post', $postid ) )
561
-			return;
549
+		if ( !lasso_user_can( 'delete_post', $postid ) ) {
550
+					return;
551
+		}
562 552
 		
563 553
 		if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_delete_post' )) {
564 554
 			wp_send_json_error();
@@ -654,15 +644,14 @@  discard block
 block discarded – undo
654 644
 			}
655 645
 	
656 646
 			$result = wp_set_object_terms( $postid, $value, $taxonomy );
657
-		}
658
-		else  {
647
+		} else  {
659 648
 			//remove all terms from post
660 649
 			$result = wp_set_object_terms( $postid, null, $taxonomy );
661 650
 		}
662 651
 
663 652
 		if ( ! is_wp_error( $result ) ) {
664 653
 			return true;
665
-		}else{
654
+		} else{
666 655
 			return false;
667 656
 		}
668 657
 	}
@@ -732,9 +721,9 @@  discard block
 block discarded – undo
732 721
 		$gallery_ids  = isset( $_POST['gallery_ids'] ) ? $_POST['gallery_ids'] : false;
733 722
 		if ( $_POST[ 'gallery_type' ] ) {
734 723
 			$type = $_POST[ 'gallery_type' ];
735
-		}elseif ( ! empty( $options ) && $options[ 'galleryType' ] ) {
724
+		} elseif ( ! empty( $options ) && $options[ 'galleryType' ] ) {
736 725
 			$type = $options[ 'galleryType' ];
737
-		}else{
726
+		} else{
738 727
 			$type = false;
739 728
 		}
740 729
 
@@ -813,13 +802,15 @@  discard block
 block discarded – undo
813 802
 
814 803
 		  $month_numbers = range(1,12);
815 804
 
816
-		  foreach($month_numbers as $month)
817
-			$english_months[] = strftime('%B',mktime(0,0,0,$month,1,2011));
805
+		  foreach($month_numbers as $month) {
806
+		  			$english_months[] = strftime('%B',mktime(0,0,0,$month,1,2011));
807
+		  }
818 808
 
819 809
 		  setlocale(LC_ALL, get_locale());
820 810
 
821
-		  foreach($month_numbers as $month)
822
-			$foreign_months[] = utf8_encode(strftime('%B',mktime(0,0,0,$month,1,2011)));
811
+		  foreach($month_numbers as $month) {
812
+		  			$foreign_months[] = utf8_encode(strftime('%B',mktime(0,0,0,$month,1,2011)));
813
+		  }
823 814
 
824 815
 		  return str_replace($foreign_months, $english_months, $foreignMonthName);
825 816
 	}
Please login to merge, or discard this patch.
public/includes/register_meta_field.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -15,21 +15,21 @@
 block discarded – undo
15 15
 	 *
16 16
 	 * @param array $fields
17 17
 	 */
18
-	public function __construct( $fields ) {
18
+	public function __construct($fields) {
19 19
 		$this->fields = $fields;
20
-		add_filter( 'lasso_api_params', function( $params ) {
21
-			foreach( $this->fields as $field => $cbs ) {
20
+		add_filter('lasso_api_params', function($params) {
21
+			foreach ($this->fields as $field => $cbs) {
22 22
 				//$field = lasso_clean_string( $field );
23
-				$params[ 'process_meta_update' ][ $field ] = $cbs;
23
+				$params['process_meta_update'][$field] = $cbs;
24 24
 			}
25 25
 
26 26
 			return $params;
27 27
 
28 28
 		});
29 29
 
30
-		add_filter( 'lasso_meta_fields', function( $allowed ) {
30
+		add_filter('lasso_meta_fields', function($allowed) {
31 31
 
32
-			foreach( array_keys( $this->fields ) as $field  ) {
32
+			foreach (array_keys($this->fields) as $field) {
33 33
 				//$field = lasso_clean_string( $field );
34 34
 				$allowed[] = $field;
35 35
 
Please login to merge, or discard this patch.
public/includes/option-engine.php 2 patches
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -119,8 +119,9 @@  discard block
 block discarded – undo
119 119
 
120 120
 	ob_start();
121 121
 
122
-	if ( empty( $name ) || empty( $options ) || !is_array( $options ) )
123
-		return;
122
+	if ( empty( $name ) || empty( $options ) || !is_array( $options ) ) {
123
+			return;
124
+	}
124 125
 
125 126
 	$nonce = wp_create_nonce('lasso-process-post-meta');
126 127
 	$key   = sprintf('_lasso_%s_settings', $name );
@@ -198,8 +199,9 @@  discard block
 block discarded – undo
198 199
 	$before = '<div class="lasso--postsettings__option">';
199 200
 	$after 	= '</div>';
200 201
 
201
-	if ( empty( $name ) || empty( $options ) )
202
-		return;
202
+	if ( empty( $name ) || empty( $options ) ) {
203
+			return;
204
+	}
203 205
 
204 206
 	foreach ( (array) $options as $option ) {
205 207
 
@@ -225,8 +227,9 @@  discard block
 block discarded – undo
225 227
 */
226 228
 function lasso_option_engine_option( $name = '', $option = '', $type = '') {
227 229
 
228
-	if ( empty( $type ) || empty( $option ) )
229
-		return;
230
+	if ( empty( $type ) || empty( $option ) ) {
231
+			return;
232
+	}
230 233
 
231 234
 	$id = isset( $option['id'] ) ? $option['id'] : false;
232 235
 	//$id = $id ? lasso_clean_string( $id ) : false;
Please login to merge, or discard this patch.
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 *	Get an array of addon data for the settings modal
44 44
 *	@since 0.9.4
45 45
 */
46
-function lasso_get_modal_tabs(){
46
+function lasso_get_modal_tabs() {
47 47
 
48 48
 	$tabs = array();
49 49
 
@@ -60,34 +60,34 @@  discard block
 block discarded – undo
60 60
 *	@uses lasso_modal_addons_content()
61 61
 *	@since 0.9.4
62 62
 */
63
-function lasso_modal_addons( $type = 'tab' ){
63
+function lasso_modal_addons($type = 'tab') {
64 64
 
65 65
 	$tabs = lasso_get_modal_tabs();
66 66
 	$out = '';
67 67
 
68
-	if ( $tabs ):
68
+	if ($tabs):
69 69
 
70
-		if ( 'tab' == $type ) {
70
+		if ('tab' == $type) {
71 71
 
72 72
 			$out = '<ul class="lasso--modal__tabs">';
73 73
 
74 74
 				$out .= '<li class="active-tab" data-addon-name="core">Editus</li>';
75 75
 
76
-				foreach ( $tabs as $tab ) {
76
+				foreach ($tabs as $tab) {
77 77
 
78
-					if ( isset( $tab ) ) {
78
+					if (isset($tab)) {
79 79
 
80
-						$out .= lasso_modal_addons_content( $tab, $type );
80
+						$out .= lasso_modal_addons_content($tab, $type);
81 81
 					}
82 82
 				}
83 83
 
84 84
 			$out .= '</ul>';
85 85
 
86
-		} elseif ( 'content' == $type ) {
87
-			foreach ( $tabs as $tab ) {
86
+		} elseif ('content' == $type) {
87
+			foreach ($tabs as $tab) {
88 88
 
89
-				if ( isset( $tab ) ) {
90
-					$out .= lasso_modal_addons_content( $tab , $type );
89
+				if (isset($tab)) {
90
+					$out .= lasso_modal_addons_content($tab, $type);
91 91
 				}
92 92
 			}
93 93
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
 	endif;
97 97
 
98
-	return !empty( $out ) ? $out : false;
98
+	return !empty($out) ? $out : false;
99 99
 }
100 100
 
101 101
 /**
@@ -115,26 +115,26 @@  discard block
 block discarded – undo
115 115
 *	@since 0.9.5
116 116
 *	@subpackage lasso_modal_addons_content
117 117
 */
118
-function lasso_option_form( $name = '', $options = array() ){
118
+function lasso_option_form($name = '', $options = array()) {
119 119
 
120 120
 	ob_start();
121 121
 
122
-	if ( empty( $name ) || empty( $options ) || !is_array( $options ) )
122
+	if (empty($name) || empty($options) || !is_array($options))
123 123
 		return;
124 124
 
125 125
 	$nonce = wp_create_nonce('lasso-process-post-meta');
126
-	$key   = sprintf('_lasso_%s_settings', $name );
126
+	$key   = sprintf('_lasso_%s_settings', $name);
127 127
 
128
-	$out = sprintf('<form id="lasso--custom-field-form" class="lasso--post-form">' );
128
+	$out = sprintf('<form id="lasso--custom-field-form" class="lasso--post-form">');
129 129
 
130
-		$out .= lasso_option_fields( $name, $options );
131
-		$out .='<div class="form--bottom">';
132
-			$out .='<input type="submit" value="'.__( 'Save', 'lasso' ).'">';
133
-			$out .='<input type="hidden" name="tab_name" value="'.$key.'">';
134
-			$out .='<input type="hidden" name="post_id" value="'.get_the_ID().'">';
135
-			$out .='<input type="hidden" name="nonce" value="'.$nonce.'">';
136
-			$out .='<input type="hidden" name="action" value="process_meta_update">';
137
-		$out .='</div>';
130
+		$out .= lasso_option_fields($name, $options);
131
+		$out .= '<div class="form--bottom">';
132
+			$out .= '<input type="submit" value="'.__('Save', 'lasso').'">';
133
+			$out .= '<input type="hidden" name="tab_name" value="'.$key.'">';
134
+			$out .= '<input type="hidden" name="post_id" value="'.get_the_ID().'">';
135
+			$out .= '<input type="hidden" name="nonce" value="'.$nonce.'">';
136
+			$out .= '<input type="hidden" name="action" value="process_meta_update">';
137
+		$out .= '</div>';
138 138
 
139 139
 	$out .= '</form>';
140 140
 	
@@ -192,20 +192,20 @@  discard block
 block discarded – undo
192 192
 *	@since 0.9.5
193 193
 *	@subpackage lasso_modal_addons_content
194 194
 */
195
-function lasso_option_fields( $name = '', $options = array() ){
195
+function lasso_option_fields($name = '', $options = array()) {
196 196
 
197
-	$out 	= '';
197
+	$out = '';
198 198
 	$before = '<div class="lasso--postsettings__option">';
199 199
 	$after 	= '</div>';
200 200
 
201
-	if ( empty( $name ) || empty( $options ) )
201
+	if (empty($name) || empty($options))
202 202
 		return;
203 203
 
204
-	foreach ( (array) $options as $option ) {
204
+	foreach ((array) $options as $option) {
205 205
 
206
-		$type = isset( $option['type'] ) ? $option['type'] : 'text';
206
+		$type = isset($option['type']) ? $option['type'] : 'text';
207 207
 		
208
-		$out .= sprintf('%s%s%s', $before, lasso_option_engine_option( $name, $option,$type ), $after );
208
+		$out .= sprintf('%s%s%s', $before, lasso_option_engine_option($name, $option, $type), $after);
209 209
 
210 210
 	}
211 211
 	
@@ -223,44 +223,44 @@  discard block
 block discarded – undo
223 223
 *	@param $type string text, textarea, checkbox, color
224 224
 *	@since 5.0
225 225
 */
226
-function lasso_option_engine_option( $name = '', $option = '', $type = '') {
226
+function lasso_option_engine_option($name = '', $option = '', $type = '') {
227 227
 
228
-	if ( empty( $type ) || empty( $option ) )
228
+	if (empty($type) || empty($option))
229 229
 		return;
230 230
 
231
-	$id = isset( $option['id'] ) ? $option['id'] : false;
231
+	$id = isset($option['id']) ? $option['id'] : false;
232 232
 	//$id = $id ? lasso_clean_string( $id ) : false;
233 233
 
234
-	$desc = isset( $option['desc'] ) ? $option['desc'] : false;
234
+	$desc = isset($option['desc']) ? $option['desc'] : false;
235 235
 
236
-	$value = get_post_meta( get_the_id(), $option[ 'id' ], true );
236
+	$value = get_post_meta(get_the_id(), $option['id'], true);
237 237
 
238
-	switch ( $type ) {
238
+	switch ($type) {
239 239
 		case 'text':
240
-			$out = sprintf('<label for="lasso--post-option-%s">%s</label><input id="lasso--post-option-%s" class="editus-custom-field-text" name="%s" type="text" value="%s">',$id, esc_html( $desc ), $id, $id, $value );
240
+			$out = sprintf('<label for="lasso--post-option-%s">%s</label><input id="lasso--post-option-%s" class="editus-custom-field-text" name="%s" type="text" value="%s">', $id, esc_html($desc), $id, $id, $value);
241 241
 			break;
242 242
 		case 'textarea':
243
-			$out = sprintf('<label for="lasso--post-option-%s">%s</label><textarea id="lasso--post-option-%s" name="%s">%s</textarea>',$id, esc_html( $desc ), $id, $id, $value );
243
+			$out = sprintf('<label for="lasso--post-option-%s">%s</label><textarea id="lasso--post-option-%s" name="%s">%s</textarea>', $id, esc_html($desc), $id, $id, $value);
244 244
 			break;
245 245
 		case 'imgurl':
246
-			$out = sprintf('<label for="lasso--post-option-%s">%s</label><img src="%s" style="height:80px;"><input id="lasso--post-option-%s" class="editus-custom-field-text" name="%s" type="text" value="%s" style="display:none;"><div title="Replace Image"  class="editus-customtab-image-control" style="float:left;"><i class="lasso-icon-image" style="font-size:20px;padding:5px;"></i></div><div title="Remove Image"  class="editus-customtab-image-remove" style="float:left;"><i class="lasso-icon-bin2" style="font-size:20px;padding:5px;"></i></div>',$id, esc_html( $desc ), $value, $id, $id,  $value );
246
+			$out = sprintf('<label for="lasso--post-option-%s">%s</label><img src="%s" style="height:80px;"><input id="lasso--post-option-%s" class="editus-custom-field-text" name="%s" type="text" value="%s" style="display:none;"><div title="Replace Image"  class="editus-customtab-image-control" style="float:left;"><i class="lasso-icon-image" style="font-size:20px;padding:5px;"></i></div><div title="Remove Image"  class="editus-customtab-image-remove" style="float:left;"><i class="lasso-icon-bin2" style="font-size:20px;padding:5px;"></i></div>', $id, esc_html($desc), $value, $id, $id, $value);
247 247
 			break;
248 248
 		case 'checkbox':
249
-			$out = sprintf('<label for="lasso--post-option-%s" class="checkbox-control checkbox"><input id="lasso--post-option-%s" type="checkbox" name="%s" class="checkbox"><span class="control-indicator"></span>%s',$id, $id, $id ,esc_html( $desc ) );
249
+			$out = sprintf('<label for="lasso--post-option-%s" class="checkbox-control checkbox"><input id="lasso--post-option-%s" type="checkbox" name="%s" class="checkbox"><span class="control-indicator"></span>%s', $id, $id, $id, esc_html($desc));
250 250
 			break;
251 251
 		case 'dropdown':
252
-			$out = sprintf('<label for="lasso--post-option-%s">%s</label><select id="lasso--post-option-%s" name="%s">',$id, esc_html( $desc ), $id, $id);
252
+			$out = sprintf('<label for="lasso--post-option-%s">%s</label><select id="lasso--post-option-%s" name="%s">', $id, esc_html($desc), $id, $id);
253 253
 			$options = explode(";", $option['options']);
254 254
 			foreach ($options as &$opt) {
255 255
 				$opts = explode(":", $opt);
256 256
 				if ($opts[0] == $value) {
257
-					$out .= sprintf('<option value = "%s" selected>%s</option>',$opts[0], $opts[1]);
257
+					$out .= sprintf('<option value = "%s" selected>%s</option>', $opts[0], $opts[1]);
258 258
 				} else {
259
-					$out .= sprintf('<option value = "%s">%s</option>',$opts[0], $opts[1]);
259
+					$out .= sprintf('<option value = "%s">%s</option>', $opts[0], $opts[1]);
260 260
 				}
261 261
 			}
262 262
 			
263
-			$out .='</select>';
263
+			$out .= '</select>';
264 264
 			break;
265 265
 	}
266 266
 
Please login to merge, or discard this patch.
includes/process/meta.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 		 */
43 43
 		$allowed_fields = apply_filters( 'lasso_meta_fields', array() );
44 44
         
45
-        file_put_contents(WP_PLUGIN_DIR."/file1.txt", print_r($data,true));
45
+		file_put_contents(WP_PLUGIN_DIR."/file1.txt", print_r($data,true));
46 46
         
47 47
 		if ( ! empty( $allowed_fields ) ) {
48 48
 			foreach( $allowed_fields as $field ) {
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 			}
55 55
 		}
56 56
 
57
-        do_action( 'editus_after_meta_update', $post_id, $data );
57
+		do_action( 'editus_after_meta_update', $post_id, $data );
58 58
 
59 59
 
60 60
 		return true;
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
 	 *
29 29
 	 * @return bool Always returns true.
30 30
 	 */
31
-	public function update( $data ) {
31
+	public function update($data) {
32 32
 
33
-		$post_id = isset( $data['post_id'] ) ? $data['post_id'] : false;
33
+		$post_id = isset($data['post_id']) ? $data['post_id'] : false;
34 34
 
35 35
 			
36 36
 		/**
@@ -40,21 +40,21 @@  discard block
 block discarded – undo
40 40
 		 *
41 41
 		 * @param array $allowed_fields The fields
42 42
 		 */
43
-		$allowed_fields = apply_filters( 'lasso_meta_fields', array() );
43
+		$allowed_fields = apply_filters('lasso_meta_fields', array());
44 44
         
45
-        file_put_contents(WP_PLUGIN_DIR."/file1.txt", print_r($data,true));
45
+        file_put_contents(WP_PLUGIN_DIR."/file1.txt", print_r($data, true));
46 46
         
47
-		if ( ! empty( $allowed_fields ) ) {
48
-			foreach( $allowed_fields as $field ) {
49
-				if ( isset( $data[ $field ] ) ) {
47
+		if (!empty($allowed_fields)) {
48
+			foreach ($allowed_fields as $field) {
49
+				if (isset($data[$field])) {
50 50
 					//this original line changed dash to underscore
51 51
 					//update_post_meta( $post_id, lasso_unclean_string( $field ), $data[ $field ]  );
52
-					update_post_meta( $post_id,  $field, $data[ $field ]  );
52
+					update_post_meta($post_id, $field, $data[$field]);
53 53
 				}
54 54
 			}
55 55
 		}
56 56
 
57
-        do_action( 'editus_after_meta_update', $post_id, $data );
57
+        do_action('editus_after_meta_update', $post_id, $data);
58 58
 
59 59
 
60 60
 		return true;
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
 	 *
69 69
 	 * @return array Array of keys to pull from $data per action and their sanitization callback
70 70
 	 */
71
-	public static function params(){
72
-		$params[ 'process_meta_update' ] = array(
71
+	public static function params() {
72
+		$params['process_meta_update'] = array(
73 73
 			'post_id' 	=> 'absint',
74 74
 			'tab_name'	=> 'trim'
75 75
 		);
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	 * @return array Array of additional functions to use to authorize action.
87 87
 	 */
88 88
 	public static function auth_callbacks() {
89
-		$params[ 'process_meta_update' ] = array(
89
+		$params['process_meta_update'] = array(
90 90
 			'lasso_user_can'
91 91
 		);
92 92
 
Please login to merge, or discard this patch.
includes/process/map.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
 			}
46 46
 
47 47
 			// udpate start point
48
-            $point = json_decode( $start_point, true );
48
+			$point = json_decode( $start_point, true );
49 49
 			update_post_meta( $postid, 'ase_map_component_start_point', $point );
50 50
 
51 51
 			// update zoom
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -28,28 +28,28 @@  discard block
 block discarded – undo
28 28
 	 *
29 29
 	 * @return bool Always returns true.
30 30
 	 */
31
-	public function save( $data ) {
31
+	public function save($data) {
32 32
 
33
-		$postid     	= isset( $data['postid'] ) ? $data['postid'] : false;
34
-		$locations    	= isset( $data['ase-map-component-locations'] ) ? $data['ase-map-component-locations'] : false;
35
-		$start_point    = isset( $data['ase-map-component-start-point'] ) ? $data['ase-map-component-start-point']: false;
36
-		$zoom       	= isset( $data['ase-map-component-zoom'] ) ? $data['ase-map-component-zoom' ] : false;
33
+		$postid     	= isset($data['postid']) ? $data['postid'] : false;
34
+		$locations = isset($data['ase-map-component-locations']) ? $data['ase-map-component-locations'] : false;
35
+		$start_point = isset($data['ase-map-component-start-point']) ? $data['ase-map-component-start-point'] : false;
36
+		$zoom       	= isset($data['ase-map-component-zoom']) ? $data['ase-map-component-zoom'] : false;
37 37
         
38
-		if ( is_array( $locations ) ) {
39
-			delete_post_meta( $postid, 'ase_map_component_locations' );
38
+		if (is_array($locations)) {
39
+			delete_post_meta($postid, 'ase_map_component_locations');
40 40
 
41 41
 			// update locations if set
42
-			foreach ( $locations as $location ) {
43
-				$point = json_decode( urldecode( $location ), true );
44
-				add_post_meta( $postid, 'ase_map_component_locations', $point );
42
+			foreach ($locations as $location) {
43
+				$point = json_decode(urldecode($location), true);
44
+				add_post_meta($postid, 'ase_map_component_locations', $point);
45 45
 			}
46 46
 
47 47
 			// udpate start point
48
-            $point = json_decode( $start_point, true );
49
-			update_post_meta( $postid, 'ase_map_component_start_point', $point );
48
+            $point = json_decode($start_point, true);
49
+			update_post_meta($postid, 'ase_map_component_start_point', $point);
50 50
 
51 51
 			// update zoom
52
-			update_post_meta( $postid, 'ase_map_component_zoom', $zoom );
52
+			update_post_meta($postid, 'ase_map_component_zoom', $zoom);
53 53
 		}
54 54
 
55 55
 		return true;
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
 	 *
64 64
 	 * @return array Array of keys to pull from $_POST per action and their sanitization callback
65 65
 	 */
66
-	public static function params(){
67
-		$params[ 'process_map_save' ] = array(
66
+	public static function params() {
67
+		$params['process_map_save'] = array(
68 68
 			'postid' => 'absint',
69 69
 			'ase-map-component-locations' => 'lasso_sanitize_data',
70 70
 			'ase-map-component-start-point' => array(
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	 * @return array Array of additional functions to use to authorize action.
89 89
 	 */
90 90
 	public static function auth_callbacks() {
91
-		$params[ 'process_map_save' ] = array(
91
+		$params['process_map_save'] = array(
92 92
 			'lasso_user_can'
93 93
 		);
94 94
 
Please login to merge, or discard this patch.
public/includes/assets.php 3 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,9 @@
 block discarded – undo
19 19
     {
20 20
         global $post;
21 21
         $pos = strpos($post->post_content, "<!--nextpage-->");
22
-        if (!$pos) return -1;
22
+        if (!$pos) {
23
+        	return -1;
24
+        }
23 25
         
24 26
         global $wp;
25 27
         $url =  home_url( $wp->request );
Please login to merge, or discard this patch.
Indentation   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -15,29 +15,29 @@  discard block
 block discarded – undo
15 15
 		add_action('wp_enqueue_scripts', array($this,'scripts'));
16 16
 	}
17 17
     
18
-    function is_multipage()
19
-    {
20
-        global $post;
21
-        $pos = strpos($post->post_content, "<!--nextpage-->");
22
-        if (!$pos) return -1;
18
+	function is_multipage()
19
+	{
20
+		global $post;
21
+		$pos = strpos($post->post_content, "<!--nextpage-->");
22
+		if (!$pos) return -1;
23 23
         
24
-        global $wp;
25
-        $url =  home_url( $wp->request );
26
-        $index = intval(basename($url)) == 0 ? 0 : intval(basename($url))-1;
27
-        return $index;        
28
-    }
24
+		global $wp;
25
+		$url =  home_url( $wp->request );
26
+		$index = intval(basename($url)) == 0 ? 0 : intval(basename($url))-1;
27
+		return $index;        
28
+	}
29 29
 
30 30
 	public function scripts(){
31 31
 
32 32
 	
33 33
 		global $post;
34 34
 		if ( lasso_user_can('edit_posts') 
35
-		     /* uncomment this line to disable Editus on Gutenberg posts*/
36
-             /* && !( function_exists( 'has_blocks' ) && has_blocks( $post->post_content)  && !is_home()) */              
37
-             ) {
35
+			 /* uncomment this line to disable Editus on Gutenberg posts*/
36
+			 /* && !( function_exists( 'has_blocks' ) && has_blocks( $post->post_content)  && !is_home()) */              
37
+			 ) {
38 38
 			
39 39
 			/**    Returns the time offset from UTC
40
-			*/
40
+			 */
41 41
 			function get_UTC_offset() {
42 42
 				$timezone_string = get_option( 'timezone_string' );
43 43
 				if (empty( $timezone_string ) ) {
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
 			wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true);
54 54
 
55
-            //don't load autocomplete if it's a stockholm theme
55
+			//don't load autocomplete if it's a stockholm theme
56 56
 			$themename  	= wp_get_theme()->get('Name');
57 57
 			if ($themename !='Stockholm' ) {
58 58
 				wp_enqueue_script('jquery-ui-autocomplete');
@@ -90,9 +90,9 @@  discard block
 block discarded – undo
90 90
 			$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor','b');
91 91
 			$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor','i');
92 92
             
93
-            $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
93
+			$use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
94 94
             
95
-            $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor', 'off');
95
+			$link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor', 'off');
96 96
 
97 97
 			
98 98
 			//text alignement
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 			$tz_offset = get_UTC_offset();
131 131
 			$post_date = get_the_time('U', $postid);
132 132
 			$time = (time()+$tz_offset);
133
-            $delta = $time - $post_date;
133
+			$delta = $time - $post_date;
134 134
             
135 135
 			$strings = array(
136 136
 				'save' 				=> __('Save','lasso'),
@@ -185,11 +185,11 @@  discard block
 block discarded – undo
185 185
 			$gallery_nonce = wp_create_nonce( $gallery_nonce_action );
186 186
 			
187 187
 			
188
-            if ($allow_change_date) {
189
-			    $permalink = get_site_url().'/?p='.$postid;
190
-            } else {
191
-                $permalink = get_permalink($postid);
192
-            }
188
+			if ($allow_change_date) {
189
+				$permalink = get_site_url().'/?p='.$postid;
190
+			} else {
191
+				$permalink = get_permalink($postid);
192
+			}
193 193
 			
194 194
 			// rest api
195 195
 			$rest_nonce = '';
@@ -209,17 +209,17 @@  discard block
 block discarded – undo
209 209
 				}
210 210
 			}
211 211
             
212
-            //excerpt
213
-            $post_excerpt = "";
214
-            $post_excerpt = $post->post_excerpt;
212
+			//excerpt
213
+			$post_excerpt = "";
214
+			$post_excerpt = $post->post_excerpt;
215 215
             
216
-            //find if this is multi page. -1 if not
217
-            $multipage = self::is_multipage();
218
-            $post_content = "";
219
-            //pass post_content if we need to process multipage. In future we may need to pass this for other purposes
220
-            if ($multipage != -1) {
221
-               $post_content = $post->post_content;
222
-            }
216
+			//find if this is multi page. -1 if not
217
+			$multipage = self::is_multipage();
218
+			$post_content = "";
219
+			//pass post_content if we need to process multipage. In future we may need to pass this for other purposes
220
+			if ($multipage != -1) {
221
+			   $post_content = $post->post_content;
222
+			}
223 223
 
224 224
 			// localized objects
225 225
 			$objects = array(
@@ -295,17 +295,17 @@  discard block
 block discarded – undo
295 295
 				'customFields'      => $custom_fields,
296 296
 				'clickToInsert'     => ($insert_comp_ui =='click'),
297 297
 				'buttonOnEmptyP'     => ($insert_comp_ui =='mediumcom'),      // auto show a button to insert components on an empty paragraph      
298
-                'rtl'               => is_rtl(),				
298
+				'rtl'               => is_rtl(),				
299 299
 				'skipToEdit'        =>( $delta < 10 && $delta >=0 ), // if it's a new post, skip to edit mode
300 300
 				'linksEditable'    => $links_editable,
301 301
 				'supportPendingStatus' => !$no_pending_status,
302 302
 				'tableCode' => apply_filters( 'lasso_table_html_code','<table><tr><th>Cell 1</th><th>Cell 2</th></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table><p></p>'),
303
-                'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) || self::gutenberg_active(),//,
304
-                'multipages'=> $multipage,
305
-                'post_content'=>$post_content,
306
-                'post_excerpt'=>$post_excerpt,
307
-                'oldWPimg'=> $use_old_wpimg =='on',
308
-                'prefixHTTP'=> $link_prefix_http =='on'
303
+				'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) || self::gutenberg_active(),//,
304
+				'multipages'=> $multipage,
305
+				'post_content'=>$post_content,
306
+				'post_excerpt'=>$post_excerpt,
307
+				'oldWPimg'=> $use_old_wpimg =='on',
308
+				'prefixHTTP'=> $link_prefix_http =='on'
309 309
 			);
310 310
 
311 311
 
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 			
314 314
 			
315 315
 			if (!$using_restapiv2) {
316
-               // enqueue REST API V1
316
+			   // enqueue REST API V1
317 317
 			   wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
318 318
 			   $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) );
319 319
 			   wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings );
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 			if ($show_color) {
330 330
 				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true);
331 331
 			} else {
332
-			    wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
332
+				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
333 333
 			}
334 334
 			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) );
335 335
 
@@ -338,44 +338,44 @@  discard block
 block discarded – undo
338 338
 
339 339
 	}
340 340
     
341
-    function gutenberg_active() {
341
+	function gutenberg_active() {
342 342
         
343
-        // Gutenberg plugin is installed and activated.
344
-        $gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) );
345
-
346
-        // Block editor since 5.0.
347
-        $block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' );
348
-
349
-        if ( ! $gutenberg && ! $block_editor ) {
350
-            return false;
351
-        }
352
-
353
-        if ( self::is_classic_editor_plugin_active() ) {
354
-            $editor_option       = get_option( 'classic-editor-replace' );
355
-            $block_editor_active = array( 'no-replace', 'block' );
356
-
357
-            return in_array( $editor_option, $block_editor_active, true );
358
-        }
359
-
360
-        return true;
361
-    }
362
-
363
-    /**
364
-     * Check if Classic Editor plugin is active.
365
-     *
366
-     * @return bool
367
-     */
368
-    function is_classic_editor_plugin_active() {
369
-        if ( ! function_exists( 'is_plugin_active' ) ) {
370
-            include_once ABSPATH . 'wp-admin/includes/plugin.php';
371
-        }
372
-
373
-        if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) {
374
-            return true;
375
-        }
376
-
377
-        return false;
378
-    }
343
+		// Gutenberg plugin is installed and activated.
344
+		$gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) );
345
+
346
+		// Block editor since 5.0.
347
+		$block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' );
348
+
349
+		if ( ! $gutenberg && ! $block_editor ) {
350
+			return false;
351
+		}
352
+
353
+		if ( self::is_classic_editor_plugin_active() ) {
354
+			$editor_option       = get_option( 'classic-editor-replace' );
355
+			$block_editor_active = array( 'no-replace', 'block' );
356
+
357
+			return in_array( $editor_option, $block_editor_active, true );
358
+		}
359
+
360
+		return true;
361
+	}
362
+
363
+	/**
364
+	 * Check if Classic Editor plugin is active.
365
+	 *
366
+	 * @return bool
367
+	 */
368
+	function is_classic_editor_plugin_active() {
369
+		if ( ! function_exists( 'is_plugin_active' ) ) {
370
+			include_once ABSPATH . 'wp-admin/includes/plugin.php';
371
+		}
372
+
373
+		if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) {
374
+			return true;
375
+		}
376
+
377
+		return false;
378
+	}
379 379
 
380 380
 }
381 381
 
Please login to merge, or discard this patch.
Spacing   +108 added lines, -108 removed lines patch added patch discarded remove patch
@@ -10,9 +10,9 @@  discard block
 block discarded – undo
10 10
 
11 11
 class assets {
12 12
 
13
-	public function __construct(){
13
+	public function __construct() {
14 14
 
15
-		add_action('wp_enqueue_scripts', array($this,'scripts'));
15
+		add_action('wp_enqueue_scripts', array($this, 'scripts'));
16 16
 	}
17 17
     
18 18
     function is_multipage()
@@ -22,16 +22,16 @@  discard block
 block discarded – undo
22 22
         if (!$pos) return -1;
23 23
         
24 24
         global $wp;
25
-        $url =  home_url( $wp->request );
26
-        $index = intval(basename($url)) == 0 ? 0 : intval(basename($url))-1;
25
+        $url = home_url($wp->request);
26
+        $index = intval(basename($url)) == 0 ? 0 : intval(basename($url)) - 1;
27 27
         return $index;        
28 28
     }
29 29
 
30
-	public function scripts(){
30
+	public function scripts() {
31 31
 
32 32
 	
33 33
 		global $post;
34
-		if ( lasso_user_can('edit_posts') 
34
+		if (lasso_user_can('edit_posts') 
35 35
 		     /* uncomment this line to disable Editus on Gutenberg posts*/
36 36
              /* && !( function_exists( 'has_blocks' ) && has_blocks( $post->post_content)  && !is_home()) */              
37 37
              ) {
@@ -39,9 +39,9 @@  discard block
 block discarded – undo
39 39
 			/**    Returns the time offset from UTC
40 40
 			*/
41 41
 			function get_UTC_offset() {
42
-				$timezone_string = get_option( 'timezone_string' );
43
-				if (empty( $timezone_string ) ) {
44
-					return get_option('gmt_offset')*3600;
42
+				$timezone_string = get_option('timezone_string');
43
+				if (empty($timezone_string)) {
44
+					return get_option('gmt_offset') * 3600;
45 45
 				}
46 46
 				
47 47
 				$origin_dtz = new \DateTimeZone($timezone_string);				
@@ -53,8 +53,8 @@  discard block
 block discarded – undo
53 53
 			wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true);
54 54
 
55 55
             //don't load autocomplete if it's a stockholm theme
56
-			$themename  	= wp_get_theme()->get('Name');
57
-			if ($themename !='Stockholm' ) {
56
+			$themename = wp_get_theme()->get('Name');
57
+			if ($themename != 'Stockholm') {
58 58
 				wp_enqueue_script('jquery-ui-autocomplete');
59 59
 			}
60 60
 			wp_enqueue_script('jquery-ui-draggable');
@@ -67,30 +67,30 @@  discard block
 block discarded – undo
67 67
 			// url for json api
68 68
 			$home_url = function_exists('json_get_url_prefix') ? json_get_url_prefix() : false;
69 69
 
70
-			$article_object 	= lasso_editor_get_option('article_class','lasso_editor');
70
+			$article_object 	= lasso_editor_get_option('article_class', 'lasso_editor');
71 71
 
72
-			$article_object 	= empty( $article_object ) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object;
72
+			$article_object 	= empty($article_object) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object;
73 73
 
74
-			$featImgClass 		= lasso_editor_get_option('featimg_class','lasso_editor');
75
-			if (empty( $featImgClass )) {
74
+			$featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor');
75
+			if (empty($featImgClass)) {
76 76
 				$featImgClass = lasso_get_supported_theme_featured_image_class();
77 77
 			}
78
-			$titleClass 		= lasso_editor_get_option('title_class','lasso_editor');
79
-			if (empty( $titleClass )) {
78
+			$titleClass = lasso_editor_get_option('title_class', 'lasso_editor');
79
+			if (empty($titleClass)) {
80 80
 				$titleClass = lasso_get_supported_theme_title_class();
81 81
 			}
82
-			$toolbar_headings  	= lasso_editor_get_option('toolbar_headings', 'lasso_editor');
83
-			$toolbar_headings_h4  	= lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
82
+			$toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor');
83
+			$toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
84 84
 			$objectsNoSave  	= lasso_editor_get_option('dont_save', 'lasso_editor');
85
-			$objectsNonEditable  	= lasso_editor_get_option('non_editable', 'lasso_editor');
85
+			$objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor');
86 86
 			$disableRESTSave = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor');
87
-			$save_to_post_disabled  = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' );
88
-			$edit_post_disabled  = lasso_editor_get_option( 'post_edit_disabled', 'lasso_editor' );
87
+			$save_to_post_disabled = lasso_editor_get_option('post_save_disabled', 'lasso_editor');
88
+			$edit_post_disabled = lasso_editor_get_option('post_edit_disabled', 'lasso_editor');
89 89
 			
90
-			$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor','b');
91
-			$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor','i');
90
+			$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor', 'b');
91
+			$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor', 'i');
92 92
             
93
-            $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
93
+            $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor', 'off');
94 94
             
95 95
             $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor', 'off');
96 96
 
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
 			
110 110
 			if ($show_color) {
111 111
 				//color picker
112
-				wp_enqueue_style( 'wp-color-picker' );
113
-				wp_enqueue_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 );
112
+				wp_enqueue_style('wp-color-picker');
113
+				wp_enqueue_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), false, 1);
114 114
 			}
115 115
 			
116 116
 			// click to insert components, not drag and drop
@@ -122,54 +122,54 @@  discard block
 block discarded – undo
122 122
 			
123 123
 			// custom fields
124 124
 			
125
-			$custom_fields = apply_filters( 'editus_custom_fields', null ); 
125
+			$custom_fields = apply_filters('editus_custom_fields', null); 
126 126
 
127 127
 
128 128
 			// post id reference
129 129
 			$postid 			= get_the_ID();
130 130
 			$tz_offset = get_UTC_offset();
131 131
 			$post_date = get_the_time('U', $postid);
132
-			$time = (time()+$tz_offset);
132
+			$time = (time() + $tz_offset);
133 133
             $delta = $time - $post_date;
134 134
             
135 135
 			$strings = array(
136
-				'save' 				=> __('Save','lasso'),
137
-				'selectText'	  	=> __('Please Select Text First.','lasso'),
138
-				'cancel' 			=> __('Cancel','lasso'),
139
-				'exiteditor' 		=> __('Exit Editor','lasso'),
140
-				'saving' 			=> __('Saving...','lasso'),
141
-				'saved'				=> __('Saved!','lasso'),
142
-				'adding' 			=> __('Adding...','lasso'),
143
-				'added'				=> __('Added!','lasso'),
144
-				'loading' 			=> __('Loading...','lasso'),
145
-				'loadMore'			=> __('Load More','lasso'),
146
-				'close'			=> __('Close','lasso'),
147
-				'noPostsFound'		=> __('No more posts found','lasso'),
148
-				'fetchFail'	    	=> __('Fetching failed.','lasso'),
149
-				'galleryCreated' 	=> __('Gallery Created!','lasso'),
150
-				'galleryUpdated' 	=> __('Gallery Updated!','lasso'),
151
-				'justWrite'			=> __('Just write...','lasso'),
152
-				'chooseImage'		=> __('Choose an image','lasso'),
153
-				'updateImage'		=> __('Update Image','lasso'),
154
-				'insertImage'		=> __('Insert Image','lasso'),
155
-				'selectImage'		=> __('Select Image','lasso'),
156
-				'removeFeatImg'     => __('Remove featured image?','lasso'),
157
-				'updateSelectedImg' => __('Update Selected Image','lasso'),
158
-				'chooseImages'		=> __('Choose images','lasso'),
159
-				'editImage'			=> __('Edit Image','lasso'),
160
-				'addImages'			=> __('Add Images','lasso'),
161
-				'addNewGallery'		=> __('Add New Gallery','lasso'),
162
-				'selectGallery'		=> __('Select Editus Gallery Image','lasso'),
163
-				'useSelectedImages' => __('Use Selected Images','lasso'),
164
-				'publishPost'		=> __('Publish Post?','lasso'),
165
-				'publishYes'		=> __('Yes, publish it!','lasso'),
166
-				'deletePost'		=> __('Trash Post?','lasso'),
167
-				'deleteYes'			=> __('Yes, trash it!','lasso'),
168
-				'warning'			=> __('Oh snap!','laso'),
169
-				'cancelText'		=> __('O.K. got it!','lasso'),
170
-				'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'),
136
+				'save' 				=> __('Save', 'lasso'),
137
+				'selectText'	  	=> __('Please Select Text First.', 'lasso'),
138
+				'cancel' 			=> __('Cancel', 'lasso'),
139
+				'exiteditor' 		=> __('Exit Editor', 'lasso'),
140
+				'saving' 			=> __('Saving...', 'lasso'),
141
+				'saved'				=> __('Saved!', 'lasso'),
142
+				'adding' 			=> __('Adding...', 'lasso'),
143
+				'added'				=> __('Added!', 'lasso'),
144
+				'loading' 			=> __('Loading...', 'lasso'),
145
+				'loadMore'			=> __('Load More', 'lasso'),
146
+				'close'			=> __('Close', 'lasso'),
147
+				'noPostsFound'		=> __('No more posts found', 'lasso'),
148
+				'fetchFail'	    	=> __('Fetching failed.', 'lasso'),
149
+				'galleryCreated' 	=> __('Gallery Created!', 'lasso'),
150
+				'galleryUpdated' 	=> __('Gallery Updated!', 'lasso'),
151
+				'justWrite'			=> __('Just write...', 'lasso'),
152
+				'chooseImage'		=> __('Choose an image', 'lasso'),
153
+				'updateImage'		=> __('Update Image', 'lasso'),
154
+				'insertImage'		=> __('Insert Image', 'lasso'),
155
+				'selectImage'		=> __('Select Image', 'lasso'),
156
+				'removeFeatImg'     => __('Remove featured image?', 'lasso'),
157
+				'updateSelectedImg' => __('Update Selected Image', 'lasso'),
158
+				'chooseImages'		=> __('Choose images', 'lasso'),
159
+				'editImage'			=> __('Edit Image', 'lasso'),
160
+				'addImages'			=> __('Add Images', 'lasso'),
161
+				'addNewGallery'		=> __('Add New Gallery', 'lasso'),
162
+				'selectGallery'		=> __('Select Editus Gallery Image', 'lasso'),
163
+				'useSelectedImages' => __('Use Selected Images', 'lasso'),
164
+				'publishPost'		=> __('Publish Post?', 'lasso'),
165
+				'publishYes'		=> __('Yes, publish it!', 'lasso'),
166
+				'deletePost'		=> __('Trash Post?', 'lasso'),
167
+				'deleteYes'			=> __('Yes, trash it!', 'lasso'),
168
+				'warning'			=> __('Oh snap!', 'laso'),
169
+				'cancelText'		=> __('O.K. got it!', 'lasso'),
170
+				'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'),
171 171
 				'missingConfirm'	=> __('Update Settings', 'lasso'),
172
-				'helperText'		=> __('one more letter','lasso'),
172
+				'helperText'		=> __('one more letter', 'lasso'),
173 173
 				'editingBackup'  	=> __('You are currently editing a backup copy of this post.'),
174 174
 				
175 175
 				'catsPlaceholder'     => __('add categories...'),
@@ -178,11 +178,11 @@  discard block
 block discarded – undo
178 178
 				
179 179
 			);
180 180
 
181
-			$api_url = trailingslashit( home_url() ) . 'lasso-internal-api';
181
+			$api_url = trailingslashit(home_url()).'lasso-internal-api';
182 182
 
183 183
 			$gallery_class = new gallery();
184 184
 			$gallery_nonce_action = $gallery_class->nonce_action;
185
-			$gallery_nonce = wp_create_nonce( $gallery_nonce_action );
185
+			$gallery_nonce = wp_create_nonce($gallery_nonce_action);
186 186
 			
187 187
 			
188 188
             if ($allow_change_date) {
@@ -197,13 +197,13 @@  discard block
 block discarded – undo
197 197
 			  
198 198
 			if (function_exists('rest_url')) {
199 199
 				//$rest_root = esc_url_raw( rest_url());
200
-				$rest_nonce = wp_create_nonce( 'wp_rest' );
201
-				$settings = array( 'root' => $rest_root, 'nonce' => $rest_nonce );
202
-				wp_enqueue_script( 'wp-api', '', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
203
-				wp_localize_script( 'wp-api', 'wpApiSettings', $settings );
204
-				wp_localize_script( 'wp-api', 'WP_API_Settings', $settings );
200
+				$rest_nonce = wp_create_nonce('wp_rest');
201
+				$settings = array('root' => $rest_root, 'nonce' => $rest_nonce);
202
+				wp_enqueue_script('wp-api', '', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true);
203
+				wp_localize_script('wp-api', 'wpApiSettings', $settings);
204
+				wp_localize_script('wp-api', 'WP_API_Settings', $settings);
205 205
 				
206
-				if ( class_exists( 'WP_REST_Controller' )) {
206
+				if (class_exists('WP_REST_Controller')) {
207 207
 					// we are using REST API V2
208 208
 					$using_restapiv2 = true;
209 209
 				}
@@ -223,8 +223,8 @@  discard block
 block discarded – undo
223 223
 
224 224
 			// localized objects
225 225
 			$objects = array(
226
-				'ajaxurl' 			=> esc_url( $api_url ),
227
-				'ajaxurl2' 			=> esc_url( admin_url( 'admin-ajax.php' )),
226
+				'ajaxurl' 			=> esc_url($api_url),
227
+				'ajaxurl2' 			=> esc_url(admin_url('admin-ajax.php')),
228 228
 				'siteUrl'           => site_url(),
229 229
 				'rest_root'         => $rest_root,
230 230
 				'rest_nonce'        => $rest_nonce,
@@ -233,13 +233,13 @@  discard block
 block discarded – undo
233 233
 				'featImgClass'		=> $featImgClass,
234 234
 				'titleClass'		=> $titleClass,
235 235
 				'strings'			=> $strings,
236
-				'settingsLink'		=> function_exists('is_multisite') && is_multisite() ? network_admin_url( 'settings.php?page=lasso-editor' ) : admin_url( 'admin.php?page=lasso-editor-settings' ),
237
-				'post_status'		=> get_post_status( $postid ),
236
+				'settingsLink'		=> function_exists('is_multisite') && is_multisite() ? network_admin_url('settings.php?page=lasso-editor') : admin_url('admin.php?page=lasso-editor-settings'),
237
+				'post_status'		=> get_post_status($postid),
238 238
 				'postid'			=> $postid,
239 239
 				'permalink'			=> $permalink,
240 240
 				'edit_others_pages'	=> current_user_can('edit_others_pages') ? true : false,
241 241
 				'edit_others_posts'	=> current_user_can('edit_others_posts') ? true : false,
242
-				'userCanEdit'		=> current_user_can('edit_post', $postid ),
242
+				'userCanEdit'		=> current_user_can('edit_post', $postid),
243 243
 				'can_publish'		=> is_page() ? current_user_can('publish_pages') : current_user_can('publish_posts'),
244 244
 				//'can_publish_posts'	=> current_user_can('publish_posts'),
245 245
 				//'can_publish_pages'	=> current_user_can('publish_pages'),
@@ -275,37 +275,37 @@  discard block
 block discarded – undo
275 275
 				'postTags'    		=> lasso_get_objects('tag'),
276 276
 				'noResultsDiv'		=> lasso_editor_empty_results(),
277 277
 				'noRevisionsDiv'	=> lasso_editor_empty_results('revision'),
278
-				'mapTileProvider'   => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider( $postid ) : false,
279
-				'mapLocations'		=> get_post_meta( $postid, 'ase_map_component_locations' ),
280
-				'mapStart'			=> get_post_meta( $postid, 'ase_map_component_start_point', true ),
281
-				'mapZoom'			=> get_post_meta( $postid, 'ase_map_component_zoom', true ),
278
+				'mapTileProvider'   => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider($postid) : false,
279
+				'mapLocations'		=> get_post_meta($postid, 'ase_map_component_locations'),
280
+				'mapStart'			=> get_post_meta($postid, 'ase_map_component_start_point', true),
281
+				'mapZoom'			=> get_post_meta($postid, 'ase_map_component_zoom', true),
282 282
 				'revisionModal' 	=> lasso_editor_revision_modal(),
283 283
 				'isMobile'          => wp_is_mobile(),
284
-				'enableAutoSave'    => lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ),
284
+				'enableAutoSave'    => lasso_editor_get_option('enable_autosave', 'lasso_editor'),
285 285
 				'showColor'         => $show_color,
286 286
 				'showAlignment'     => $show_align,
287 287
 				'showIgnoredItems'  => lasso_editor_get_option('show_ignored_items', 'lasso_editor'),
288 288
 				'restapi2'          => $using_restapiv2,
289 289
 				'saveusingrest'     => $using_restapiv2 && !$disableRESTSave,
290
-				'newObjectContent'  => '<p>'.apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso') ).'</p>',
290
+				'newObjectContent'  => '<p>'.apply_filters('lasso_new_object_content', __('Once upon a time...', 'lasso')).'</p>',
291 291
 				'disableSavePost'   => $save_to_post_disabled,
292 292
 				'disableEditPost'   => $edit_post_disabled,
293 293
 				'boldTag'           => $bold_tag,
294 294
 				'iTag'           	=> $i_tag,
295 295
 				'customFields'      => $custom_fields,
296
-				'clickToInsert'     => ($insert_comp_ui =='click'),
297
-				'buttonOnEmptyP'     => ($insert_comp_ui =='mediumcom'),      // auto show a button to insert components on an empty paragraph      
296
+				'clickToInsert'     => ($insert_comp_ui == 'click'),
297
+				'buttonOnEmptyP'     => ($insert_comp_ui == 'mediumcom'), // auto show a button to insert components on an empty paragraph      
298 298
                 'rtl'               => is_rtl(),				
299
-				'skipToEdit'        =>( $delta < 10 && $delta >=0 ), // if it's a new post, skip to edit mode
299
+				'skipToEdit'        =>($delta < 10 && $delta >= 0), // if it's a new post, skip to edit mode
300 300
 				'linksEditable'    => $links_editable,
301 301
 				'supportPendingStatus' => !$no_pending_status,
302
-				'tableCode' => apply_filters( 'lasso_table_html_code','<table><tr><th>Cell 1</th><th>Cell 2</th></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table><p></p>'),
303
-                'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) || self::gutenberg_active(),//,
302
+				'tableCode' => apply_filters('lasso_table_html_code', '<table><tr><th>Cell 1</th><th>Cell 2</th></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table><p></p>'),
303
+                'hasGutenberg' => (function_exists('has_blocks') && has_blocks($post->post_content)) || self::gutenberg_active(), //,
304 304
                 'multipages'=> $multipage,
305 305
                 'post_content'=>$post_content,
306 306
                 'post_excerpt'=>$post_excerpt,
307
-                'oldWPimg'=> $use_old_wpimg =='on',
308
-                'prefixHTTP'=> $link_prefix_http =='on'
307
+                'oldWPimg'=> $use_old_wpimg == 'on',
308
+                'prefixHTTP'=> $link_prefix_http == 'on'
309 309
 			);
310 310
 
311 311
 
@@ -314,9 +314,9 @@  discard block
 block discarded – undo
314 314
 			
315 315
 			if (!$using_restapiv2) {
316 316
                // enqueue REST API V1
317
-			   wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
318
-			   $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) );
319
-			   wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings );
317
+			   wp_enqueue_script('wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true);
318
+			   $settings = array('root' => home_url($home_url), 'nonce' => wp_create_nonce('wp_json'));
319
+			   wp_localize_script('wp-api-js', 'WP_API_Settings', $settings);
320 320
 			}
321 321
 			
322 322
 			if ($allow_change_date) {
@@ -325,13 +325,13 @@  discard block
 block discarded – undo
325 325
 				wp_enqueue_style('jquery-ui');
326 326
 			}
327 327
 
328
-			$postfix = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? '' : '.min';
328
+			$postfix = (defined('SCRIPT_DEBUG') && true === SCRIPT_DEBUG) ? '' : '.min';
329 329
 			if ($show_color) {
330
-				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true);
330
+				wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api', 'iris'), LASSO_VERSION, true);
331 331
 			} else {
332
-			    wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
332
+			    wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
333 333
 			}
334
-			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) );
334
+			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects));
335 335
 
336 336
 
337 337
 		}
@@ -341,20 +341,20 @@  discard block
 block discarded – undo
341 341
     function gutenberg_active() {
342 342
         
343 343
         // Gutenberg plugin is installed and activated.
344
-        $gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) );
344
+        $gutenberg = !(false === has_filter('replace_editor', 'gutenberg_init'));
345 345
 
346 346
         // Block editor since 5.0.
347
-        $block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' );
347
+        $block_editor = version_compare($GLOBALS['wp_version'], '5.0-beta', '>');
348 348
 
349
-        if ( ! $gutenberg && ! $block_editor ) {
349
+        if (!$gutenberg && !$block_editor) {
350 350
             return false;
351 351
         }
352 352
 
353
-        if ( self::is_classic_editor_plugin_active() ) {
354
-            $editor_option       = get_option( 'classic-editor-replace' );
355
-            $block_editor_active = array( 'no-replace', 'block' );
353
+        if (self::is_classic_editor_plugin_active()) {
354
+            $editor_option       = get_option('classic-editor-replace');
355
+            $block_editor_active = array('no-replace', 'block');
356 356
 
357
-            return in_array( $editor_option, $block_editor_active, true );
357
+            return in_array($editor_option, $block_editor_active, true);
358 358
         }
359 359
 
360 360
         return true;
@@ -366,11 +366,11 @@  discard block
 block discarded – undo
366 366
      * @return bool
367 367
      */
368 368
     function is_classic_editor_plugin_active() {
369
-        if ( ! function_exists( 'is_plugin_active' ) ) {
370
-            include_once ABSPATH . 'wp-admin/includes/plugin.php';
369
+        if (!function_exists('is_plugin_active')) {
370
+            include_once ABSPATH.'wp-admin/includes/plugin.php';
371 371
         }
372 372
 
373
-        if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) {
373
+        if (is_plugin_active('classic-editor/classic-editor.php')) {
374 374
             return true;
375 375
         }
376 376
 
Please login to merge, or discard this patch.
public/includes/editor-modules--gallery.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -11,12 +11,12 @@  discard block
 block discarded – undo
11 11
 
12 12
 	ob_start();
13 13
 
14
-	if ( $galleries ) { ?>
14
+	if ($galleries) { ?>
15 15
 	
16
-		<?php if ( lasso_user_can( 'publish_posts' ) ): ?>
16
+		<?php if (lasso_user_can('publish_posts')): ?>
17 17
 			<div class="ase-gallery-opts ase-gallery-opts--create-gallery" style="display:inline !important; postion:relative !important;left:12px !important">
18 18
 				<div class="ase-gallery-opts--single lasso-option">
19
-				<a href="#" class="editor-btn-secondary" id="lasso--gallery__create"><?php _e( 'Create gallery', 'lasso' );?></a>
19
+				<a href="#" class="editor-btn-secondary" id="lasso--gallery__create"><?php _e('Create gallery', 'lasso'); ?></a>
20 20
 				</div>
21 21
 			</div>
22 22
 		<?php endif; ?>
@@ -24,11 +24,11 @@  discard block
 block discarded – undo
24 24
 		<div class="ase-gallery-opts ase-gallery-opts--edit-gallery" >
25 25
 			<div class="ase-gallery-opts--single lasso-option">
26 26
 
27
-				<label><?php _e( 'Manage Images', 'lasso' );?>
28
-					<a href="#" id="ase-gallery-add-image" class="lasso-editor-tiny-btn" title="<?php esc_attr_e( 'Add Images', 'lasso' );?>"><i class="lasso-icon-pencil"></i></a>
27
+				<label><?php _e('Manage Images', 'lasso'); ?>
28
+					<a href="#" id="ase-gallery-add-image" class="lasso-editor-tiny-btn" title="<?php esc_attr_e('Add Images', 'lasso'); ?>"><i class="lasso-icon-pencil"></i></a>
29 29
 
30 30
 				</label>
31
-				<small class="lasso-option-desc"><?php _e( 'Rearrange or edit the images in this gallery.', 'lasso' );?></small>
31
+				<small class="lasso-option-desc"><?php _e('Rearrange or edit the images in this gallery.', 'lasso'); ?></small>
32 32
 
33 33
 				<div id="lasso--gallery__images"><span class="lasso-icon-spinner6"></span></div>
34 34
 
@@ -38,22 +38,22 @@  discard block
 block discarded – undo
38 38
 
39 39
 	<?php }
40 40
 
41
-	if ( lasso_user_can( 'publish_posts' ) ): ?>
41
+	if (lasso_user_can('publish_posts')): ?>
42 42
 
43 43
 		<div class="ase-gallery-opts ase-gallery-opts--create-gallery2" style="display:none;">
44 44
 
45 45
 			<div class="ase-gallery-opts--single lasso-option">
46 46
 
47
-				<label><?php _e( 'Create a Gallery', 'lasso' );?></label>
47
+				<label><?php _e('Create a Gallery', 'lasso'); ?></label>
48 48
 				<small class="lasso-option-desc">Gallery Name:</small>
49 49
                 <input type="text" id="lasso--gallery__galleryname" value="New Gallery"><br>
50 50
 				
51
-				<small class="lasso-option-desc"><?php _e( 'Select images to create a gallery.', 'lasso' );?></small>
52
-				<a href="#" class="editor-btn-secondary" id="lasso--gallery__selectImages"><?php _e( 'Select Images', 'lasso' );?></a>
51
+				<small class="lasso-option-desc"><?php _e('Select images to create a gallery.', 'lasso'); ?></small>
52
+				<a href="#" class="editor-btn-secondary" id="lasso--gallery__selectImages"><?php _e('Select Images', 'lasso'); ?></a>
53 53
 
54 54
 				<div id="ase-gallery-images"></div>
55 55
 
56
-				<a style="display:none;" class="editor-btn-secondary" data-post-title="<?php echo esc_attr( strtolower( the_title_attribute() ) );?>" id="lasso--gallery__save" href="#"><?php _e( 'Create Gallery', 'lasso' );?></a>
56
+				<a style="display:none;" class="editor-btn-secondary" data-post-title="<?php echo esc_attr(strtolower(the_title_attribute())); ?>" id="lasso--gallery__save" href="#"><?php _e('Create Gallery', 'lasso'); ?></a>
57 57
 
58 58
 			</div>
59 59
 
@@ -64,14 +64,14 @@  discard block
 block discarded – undo
64 64
 	<!-- Gallery Layout/Type Chooser -->
65 65
 	<div class="ase-gallery-opts ase-gallery-opts--type" >
66 66
 		<div data-option="gallery-type" class="ase-gallery-opts--single lasso-option">
67
-			<label><?php _e( 'Gallery Type', 'lasso' );?></label>
68
-			<small class="lasso-option-desc"><?php _e( 'Select the type of gallery.', 'lasso' );?></small>
67
+			<label><?php _e('Gallery Type', 'lasso'); ?></label>
68
+			<small class="lasso-option-desc"><?php _e('Select the type of gallery.', 'lasso'); ?></small>
69 69
 			<fieldset>
70
-	      		<label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="grid"><?php _e( 'Grid', 'lasso' );?></label>
71
-	        	<label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="thumbnail"><?php _e( 'Thumbnail', 'lasso' );?></label>
70
+	      		<label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="grid"><?php _e('Grid', 'lasso'); ?></label>
71
+	        	<label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="thumbnail"><?php _e('Thumbnail', 'lasso'); ?></label>
72 72
 				<label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="sequence">Sequence</label>
73
-				<label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="photoset"><?php _e( 'Photoset', 'lasso' );?></label>
74
-				<label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="stacked"><?php _e( 'Parallax', 'lasso' );?></label>
73
+				<label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="photoset"><?php _e('Photoset', 'lasso'); ?></label>
74
+				<label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="stacked"><?php _e('Parallax', 'lasso'); ?></label>
75 75
 				<label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="hero">Hero</label>
76 76
 			</fieldset>
77 77
 		</div>
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
 	<div class="ase-gallery-opts ase-gallery-opts--grid" style="display:none;">
82 82
 
83 83
 		<div data-option="itemwidth" class="ase-gallery-opts--single lasso-option">
84
-			<label for="lasso_grid_gallery_width"><?php _e( 'Grid Item Width', 'lasso' );?></label>
85
-			<small class="lasso-option-desc"><?php _e( 'Adjust the width of the individual grid items, only if using Grid gallery style. Default is 400.', 'lasso' );?></small>
84
+			<label for="lasso_grid_gallery_width"><?php _e('Grid Item Width', 'lasso'); ?></label>
85
+			<small class="lasso-option-desc"><?php _e('Adjust the width of the individual grid items, only if using Grid gallery style. Default is 400.', 'lasso'); ?></small>
86 86
 			<input type="text_small" class="lasso-generator-attr" name="lasso_grid_gallery_width" value="">
87 87
 		</div>
88 88
 
@@ -92,24 +92,24 @@  discard block
 block discarded – undo
92 92
 	<div class="ase-gallery-opts ase-gallery-opts--thumb" style="display:none;">
93 93
 
94 94
 		<div data-option="transition" class="ase-gallery-opts--single lasso-option">
95
-			<label for="lasso_thumb_gallery_transition"><?php _e( 'Gallery Transition', 'lasso' );?></label>
96
-			<small class="lasso-option-desc"><?php _e( 'Adjust the transition effect for the Thumbnail gallery. Default is slide.', 'lasso' );?></small>
95
+			<label for="lasso_thumb_gallery_transition"><?php _e('Gallery Transition', 'lasso'); ?></label>
96
+			<small class="lasso-option-desc"><?php _e('Adjust the transition effect for the Thumbnail gallery. Default is slide.', 'lasso'); ?></small>
97 97
 		   	<select name="lasso_thumb_gallery_transition" class="lasso-generator-attr">
98
-		      <option value="crossfade"><?php _e( 'Fade', 'lasso' );?></option>
99
-		      <option value="slide"><?php _e( 'Slide', 'lasso' );?></option>
100
-		      <option value="dissolve"><?php _e( 'Dissolve', 'lasso' );?></option>
98
+		      <option value="crossfade"><?php _e('Fade', 'lasso'); ?></option>
99
+		      <option value="slide"><?php _e('Slide', 'lasso'); ?></option>
100
+		      <option value="dissolve"><?php _e('Dissolve', 'lasso'); ?></option>
101 101
 		    </select>
102 102
 		</div>
103 103
 
104 104
 		<div data-option="speed" class="ase-gallery-opts--single lasso-option">
105
-			<label for="lasso_thumb_gallery_transition_speed"><?php _e( 'Gallery Transition Speed', 'lasso' );?></label>
106
-			<small class="lasso-option-desc"><?php _e( 'Activate slideshow by setting a speed for the transition.5000 = 5 seconds.', 'lasso' );?></small>
105
+			<label for="lasso_thumb_gallery_transition_speed"><?php _e('Gallery Transition Speed', 'lasso'); ?></label>
106
+			<small class="lasso-option-desc"><?php _e('Activate slideshow by setting a speed for the transition.5000 = 5 seconds.', 'lasso'); ?></small>
107 107
 			<input type="text" class="lasso-generator-attr" name="lasso_thumb_gallery_transition_speed" value="">
108 108
 		</div>
109 109
 
110 110
 		<div data-option="hide-thumbs" class="ase-gallery-opts--single lasso-option">
111 111
 			<input class="lasso-generator-attr" type="checkbox" name="lasso_thumb_gallery_hide_thumbs">
112
-			<label for="lasso_thumb_gallery_hide_thumbs"><?php _e( 'Hide Gallery Thumbnails', 'lasso' );?></label>
112
+			<label for="lasso_thumb_gallery_hide_thumbs"><?php _e('Hide Gallery Thumbnails', 'lasso'); ?></label>
113 113
 		</div>
114 114
 
115 115
 	</div>
@@ -118,8 +118,8 @@  discard block
 block discarded – undo
118 118
 	<div class="ase-gallery-opts ase-gallery-opts--photoset" style="display:none;">
119 119
 
120 120
 		<div data-option="pslayout" class="ase-gallery-opts--single lasso-option">
121
-			<label for="lasso-photoset-gallery-layout"><?php _e( 'Gallery Layout', 'lasso' );?></label>
122
-			<small class="lasso-option-desc"><?php _e( 'Let\'s say you have 4 images in this gallery. If you enter 121 you will have one image on the top row, two images on the second row, and one image on the third row.', 'lasso' );?></small>
121
+			<label for="lasso-photoset-gallery-layout"><?php _e('Gallery Layout', 'lasso'); ?></label>
122
+			<small class="lasso-option-desc"><?php _e('Let\'s say you have 4 images in this gallery. If you enter 121 you will have one image on the top row, two images on the second row, and one image on the third row.', 'lasso'); ?></small>
123 123
 			<input type="text" class="lasso-generator-attr" name="lasso_photoset_gallery_layout" value="">
124 124
 		</div>
125 125
 
@@ -134,8 +134,8 @@  discard block
 block discarded – undo
134 134
 	<div class="ase-gallery-opts ase-gallery-opts--hero" style="display:none;">
135 135
 
136 136
 		<div data-option="height" class="ase-gallery-opts--single lasso-option">
137
-			<label for="lasso_gallery_height"><?php _e( 'Main Gallery Height', 'lasso' );?></label>
138
-			<small class="lasso-option-desc"><?php _e( 'Adjust the overall height of the gallery. Acceptable values include 500px or 50% etc.', 'lasso' );?></small>
137
+			<label for="lasso_gallery_height"><?php _e('Main Gallery Height', 'lasso'); ?></label>
138
+			<small class="lasso-option-desc"><?php _e('Adjust the overall height of the gallery. Acceptable values include 500px or 50% etc.', 'lasso'); ?></small>
139 139
 			<input type="text_small" class="lasso-generator-attr" name="lasso_gallery_height" value="">
140 140
 		</div>
141 141
 
@@ -145,13 +145,13 @@  discard block
 block discarded – undo
145 145
 	<div class="ase-gallery-opts ase-gallery-opts--global">
146 146
 
147 147
 		<div data-option="width" class="ase-gallery-opts--single lasso-option">
148
-			<label for="lasso_gallery_width"><?php _e( 'Main Gallery Width', 'lasso' );?></label>
149
-			<small class="lasso-option-desc"><?php _e( 'Adjust the overall width of the gallery. Acceptable values include 500px or 50% etc.', 'lasso' );?></small>
148
+			<label for="lasso_gallery_width"><?php _e('Main Gallery Width', 'lasso'); ?></label>
149
+			<small class="lasso-option-desc"><?php _e('Adjust the overall width of the gallery. Acceptable values include 500px or 50% etc.', 'lasso'); ?></small>
150 150
 			<input type="text_small" class="lasso-generator-attr" name="lasso_gallery_width" value="">
151 151
 		</div>
152 152
 		<div data-option="caption" class="ase-gallery-opts--single lasso-option">
153
-			<label for="lasso_gallery_caption"><?php _e( 'Gallery Caption', 'lasso' );?></label>
154
-			<small class="lasso-option-desc"><?php _e( 'Add an optional caption for the gallery.', 'lasso' );?></small>
153
+			<label for="lasso_gallery_caption"><?php _e('Gallery Caption', 'lasso'); ?></label>
154
+			<small class="lasso-option-desc"><?php _e('Add an optional caption for the gallery.', 'lasso'); ?></small>
155 155
 			<textarea name="lasso_gallery_caption" class="lasso-generator-attr"></textarea>
156 156
 		</div>
157 157
 
Please login to merge, or discard this patch.