Completed
Push — master ( 002905...36046d )
by
unknown
01:30
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   +85 added lines, -85 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;
@@ -419,57 +419,57 @@  discard block
 block discarded – undo
419 419
 		 );
420 420
 		foreach ($_POST as $key => $value) {
421 421
 			if ($key !="code" && $key !="action") {
422
-			    //$shortcode = $shortcode.$key.'="'.$value.'" ';
422
+				//$shortcode = $shortcode.$key.'="'.$value.'" ';
423 423
 				$atts[$key] = $value;
424 424
 			}
425 425
 		}
426 426
 		if ($code == "aesop_video") {
427
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
428
-		    echo aesop_video_shortcode($atts);
427
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
428
+			echo aesop_video_shortcode($atts);
429 429
 		}
430 430
 		else if ($code == "aesop_image") {
431
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
432
-		    echo aesop_image_shortcode($atts);
431
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
432
+			echo aesop_image_shortcode($atts);
433 433
 		}
434 434
 		else if ($code == "aesop_quote") {
435
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
436
-		    echo aesop_quote_shortcode($atts);
435
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
436
+			echo aesop_quote_shortcode($atts);
437 437
 		}
438 438
 		else if ($code == "aesop_parallax") {
439
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
440
-		    echo aesop_parallax_shortcode($atts);
439
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
440
+			echo aesop_parallax_shortcode($atts);
441 441
 		}
442 442
 		else if ($code == "aesop_character") {
443
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
444
-		    echo aesop_character_shortcode($atts);
443
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
444
+			echo aesop_character_shortcode($atts);
445 445
 		}
446 446
 		else if ($code == "aesop_collection") {
447
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
448
-		    echo aesop_collection_shortcode($atts);
447
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
448
+			echo aesop_collection_shortcode($atts);
449 449
 		}
450 450
 		else if ($code == "aesop_chapter") {
451
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
452
-		    echo aesop_chapter_shortcode($atts);
451
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
452
+			echo aesop_chapter_shortcode($atts);
453 453
 		}
454 454
 		else if ($code == "aesop_content") {
455
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
456
-		    echo aesop_content_shortcode($atts, $atts['content_data']);
455
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
456
+			echo aesop_content_shortcode($atts, $atts['content_data']);
457 457
 		}
458 458
 		else if ($code == "aesop_gallery") {
459
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
460
-		    echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
459
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
460
+			echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
461 461
 		}
462 462
 		else if ($code == "aesop_audio") {
463
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
464
-		    echo aesop_audio_shortcode($atts);
463
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
464
+			echo aesop_audio_shortcode($atts);
465 465
 		}
466
-        else if ($code == "aesop_wpimg") {
467
-            self::wpimg($atts);
466
+		else if ($code == "aesop_wpimg") {
467
+			self::wpimg($atts);
468 468
 		}
469 469
 		else {
470 470
 			$code = '['.$code.' ';
471 471
 			foreach ($atts as $key => $value) {
472
-			    $code = ''.$key.'="'.$value.'" ';
472
+				$code = ''.$key.'="'.$value.'" ';
473 473
 			}
474 474
 			$code = $code.']';
475 475
 			echo do_shortcode($code);
@@ -478,52 +478,52 @@  discard block
 block discarded – undo
478 478
 		exit; 
479 479
 	}
480 480
     
481
-    public static function wpimg($atts) {
481
+	public static function wpimg($atts) {
482 482
 
483
-        echo '<figure data-component-type="wpimg"';
483
+		echo '<figure data-component-type="wpimg"';
484 484
         
485
-        $extra = "";
485
+		$extra = "";
486 486
         
487
-        // try to use srcset and sizes on new WP installs
487
+		// try to use srcset and sizes on new WP installs
488 488
 		if ( function_exists('wp_get_attachment_image_srcset') && $attachment_id = attachment_url_to_postid( $atts['img'] ) ) {
489 489
 			$srcset = wp_get_attachment_image_srcset( $attachment_id, 'full' );
490 490
 			$sizes = wp_get_attachment_image_sizes( $attachment_id, 'full' );
491
-            $extra = "srcset='$srcset' sizes='$sizes' ";
492
-        }
493
-        $extra .= 'style="margin:auto;';
494
-        if ($atts['imgwidth'] || $atts['imgheight']) {
495
-            if ($atts['imgwidth']) {
496
-                $extra .= 'width:'. $atts['imgwidth'].';';
497
-            }
498
-            if ($atts['imgheight']) {
499
-                $extra .= 'height:'. $atts['imgheight'].';';
500
-            }
491
+			$extra = "srcset='$srcset' sizes='$sizes' ";
492
+		}
493
+		$extra .= 'style="margin:auto;';
494
+		if ($atts['imgwidth'] || $atts['imgheight']) {
495
+			if ($atts['imgwidth']) {
496
+				$extra .= 'width:'. $atts['imgwidth'].';';
497
+			}
498
+			if ($atts['imgheight']) {
499
+				$extra .= 'height:'. $atts['imgheight'].';';
500
+			}
501 501
             
502
-        }
503
-        $extra .= '"';
502
+		}
503
+		$extra .= '"';
504 504
         
505
-        foreach ($atts as $key => $value) {
505
+		foreach ($atts as $key => $value) {
506 506
 			 echo ' data-'.$key.'="'.$value.'"';
507 507
 		}
508
-        //echo ' class="wp-image- lasso--wpimg__wrap lasso-component">';
509
-        echo ' class="wp-image wp-caption lasso-component">';
510
-        if ($atts['link'])
511
-        {
512
-            echo '<a href="' . $atts['link'] . '">';
513
-        }
514
-        echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  .  '" '. $extra. '>';
515
-        if ($atts['link'])
516
-        {
517
-            echo '</a>';
518
-        }
519
-        if ($atts['caption'])
520
-        {
521
-            echo '<figcaption class="wp-caption-text">'.$atts['caption'].'</figcaption>';
522
-        }
523
-        echo '</figure>';
524
-        echo '<p> </p>';
525
-        return;
526
-    }
508
+		//echo ' class="wp-image- lasso--wpimg__wrap lasso-component">';
509
+		echo ' class="wp-image wp-caption lasso-component">';
510
+		if ($atts['link'])
511
+		{
512
+			echo '<a href="' . $atts['link'] . '">';
513
+		}
514
+		echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  .  '" '. $extra. '>';
515
+		if ($atts['link'])
516
+		{
517
+			echo '</a>';
518
+		}
519
+		if ($atts['caption'])
520
+		{
521
+			echo '<figcaption class="wp-caption-text">'.$atts['caption'].'</figcaption>';
522
+		}
523
+		echo '</figure>';
524
+		echo '<p> </p>';
525
+		return;
526
+	}
527 527
 	
528 528
 	
529 529
 	public function get_ase_options()
@@ -559,12 +559,12 @@  discard block
 block discarded – undo
559 559
 		exit;
560 560
 	}
561 561
     
562
-    /* This function doesn't actually publish post, but should be called when a post is published */
563
-    public function on_publish_post( ) {
562
+	/* This function doesn't actually publish post, but should be called when a post is published */
563
+	public function on_publish_post( ) {
564 564
 
565 565
 		$post_id = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
566 566
         
567
-        do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) );
567
+		do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) );
568 568
 
569 569
 		exit;
570 570
 	}
@@ -622,14 +622,14 @@  discard block
 block discarded – undo
622 622
 			$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
623 623
 			
624 624
 			if ($taxonomy =='category') {
625
-                // convert from names to category ids
625
+				// convert from names to category ids
626 626
 				$cats = array();
627 627
 				foreach ($value as $cat) {
628 628
 					$cat_id = get_cat_ID($cat);
629 629
 					if ($cat_id !=0) {
630 630
 						$cats [] = $cat_id;
631 631
 					} else if ($allow_new_category) {
632
-					    $cats [] = wp_create_category($cat);
632
+						$cats [] = wp_create_category($cat);
633 633
 					}
634 634
 				}
635 635
 				$value = $cats;
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
 		}
650 650
 	}
651 651
     
652
-    public function create_gallery( ) {
652
+	public function create_gallery( ) {
653 653
 
654 654
 		$postid  	= isset( $_POST['postid'] ) ? $_POST['postid'] : false;
655 655
         
@@ -703,10 +703,10 @@  discard block
 block discarded – undo
703 703
 			'message' => 'gallery-created',
704 704
 			'id' => $postid)
705 705
 		);
706
-        exit;
706
+		exit;
707 707
 	}
708 708
     
709
-    public function update_gallery( ) {
709
+	public function update_gallery( ) {
710 710
         
711 711
 		$options      = isset( $_POST['fields'] ) ? $_POST['fields'] : false;
712 712
         
@@ -722,12 +722,12 @@  discard block
 block discarded – undo
722 722
 
723 723
 		self::save_gallery_options( $postid, $gallery_ids, $options, $type );
724 724
 
725
-        echo json_encode( array('message' => 'gallery-updated') );
725
+		echo json_encode( array('message' => 'gallery-updated') );
726 726
 
727
-        exit;
727
+		exit;
728 728
 	}
729 729
     
730
-    public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) {
730
+	public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) {
731 731
 
732 732
 		// gallery width
733 733
 		$gallery_width = isset( $options['width'] ) ? $options['width'] : false;
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
 	public function set_date( $postid, $value) {
812 812
 		if( $value ) {
813 813
 			$value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time( 'timestamp', 1 ));
814
-            wp_update_post(
814
+			wp_update_post(
815 815
 				array (
816 816
 					'ID'            => $postid, // ID of the post to update
817 817
 					'post_date'     => date( 'Y-m-d H:i:s',  strtotime($value) ),
Please login to merge, or discard this patch.
Spacing   +177 added lines, -177 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,53 +414,53 @@  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
 			    //$shortcode = $shortcode.$key.'="'.$value.'" ';
423 423
 				$atts[$key] = $value;
424 424
 			}
425 425
 		}
426 426
 		if ($code == "aesop_video") {
427
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
427
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
428 428
 		    echo aesop_video_shortcode($atts);
429 429
 		}
430 430
 		else if ($code == "aesop_image") {
431
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
431
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
432 432
 		    echo aesop_image_shortcode($atts);
433 433
 		}
434 434
 		else if ($code == "aesop_quote") {
435
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
435
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
436 436
 		    echo aesop_quote_shortcode($atts);
437 437
 		}
438 438
 		else if ($code == "aesop_parallax") {
439
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
439
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
440 440
 		    echo aesop_parallax_shortcode($atts);
441 441
 		}
442 442
 		else if ($code == "aesop_character") {
443
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
443
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
444 444
 		    echo aesop_character_shortcode($atts);
445 445
 		}
446 446
 		else if ($code == "aesop_collection") {
447
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
447
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
448 448
 		    echo aesop_collection_shortcode($atts);
449 449
 		}
450 450
 		else if ($code == "aesop_chapter") {
451
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
451
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
452 452
 		    echo aesop_chapter_shortcode($atts);
453 453
 		}
454 454
 		else if ($code == "aesop_content") {
455
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
455
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
456 456
 		    echo aesop_content_shortcode($atts, $atts['content_data']);
457 457
 		}
458 458
 		else if ($code == "aesop_gallery") {
459
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
460
-		    echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
459
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
460
+		    echo do_shortcode('[aesop_gallery id="'.$atts["id"].'"]');
461 461
 		}
462 462
 		else if ($code == "aesop_audio") {
463
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
463
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
464 464
 		    echo aesop_audio_shortcode($atts);
465 465
 		}
466 466
         else if ($code == "aesop_wpimg") {
@@ -485,18 +485,18 @@  discard block
 block discarded – undo
485 485
         $extra = "";
486 486
         
487 487
         // try to use srcset and sizes on new WP installs
488
-		if ( function_exists('wp_get_attachment_image_srcset') && $attachment_id = attachment_url_to_postid( $atts['img'] ) ) {
489
-			$srcset = wp_get_attachment_image_srcset( $attachment_id, 'full' );
490
-			$sizes = wp_get_attachment_image_sizes( $attachment_id, 'full' );
488
+		if (function_exists('wp_get_attachment_image_srcset') && $attachment_id = attachment_url_to_postid($atts['img'])) {
489
+			$srcset = wp_get_attachment_image_srcset($attachment_id, 'full');
490
+			$sizes = wp_get_attachment_image_sizes($attachment_id, 'full');
491 491
             $extra = "srcset='$srcset' sizes='$sizes' ";
492 492
         }
493 493
         $extra .= 'style="margin:auto;';
494 494
         if ($atts['imgwidth'] || $atts['imgheight']) {
495 495
             if ($atts['imgwidth']) {
496
-                $extra .= 'width:'. $atts['imgwidth'].';';
496
+                $extra .= 'width:'.$atts['imgwidth'].';';
497 497
             }
498 498
             if ($atts['imgheight']) {
499
-                $extra .= 'height:'. $atts['imgheight'].';';
499
+                $extra .= 'height:'.$atts['imgheight'].';';
500 500
             }
501 501
             
502 502
         }
@@ -509,9 +509,9 @@  discard block
 block discarded – undo
509 509
         echo ' class="wp-image wp-caption lasso-component">';
510 510
         if ($atts['link'])
511 511
         {
512
-            echo '<a href="' . $atts['link'] . '">';
512
+            echo '<a href="'.$atts['link'].'">';
513 513
         }
514
-        echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  .  '" '. $extra. '>';
514
+        echo '<img src="'.$atts['img'].'" alt="'.$atts['alt'].'" '.$extra.'>';
515 515
         if ($atts['link'])
516 516
         {
517 517
             echo '</a>';
@@ -529,20 +529,20 @@  discard block
 block discarded – undo
529 529
 	public function get_ase_options()
530 530
 	{
531 531
 		$blob = lasso_editor_options_blob();
532
-		$code= $_POST["component"];
532
+		$code = $_POST["component"];
533 533
 		echo $blob[$code];
534 534
 		exit; 
535 535
 	}
536 536
 	
537 537
 	public function delete_post( ) {
538 538
 
539
-		$postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
539
+		$postid = isset($_POST['postid']) ? $_POST['postid'] : false;
540 540
 
541 541
 		// bail out if the current user can't publish posts
542
-		if ( !lasso_user_can( 'delete_post', $postid ) )
542
+		if (!lasso_user_can('delete_post', $postid))
543 543
 			return;
544 544
 		
545
-		if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_delete_post' )) {
545
+		if (!wp_verify_nonce($_POST['nonce'], 'lasso_delete_post')) {
546 546
 			wp_send_json_error();
547 547
 			exit;
548 548
 		}
@@ -552,9 +552,9 @@  discard block
 block discarded – undo
552 552
 			'post_status' 	=> 'trash'
553 553
 		);
554 554
 
555
-		wp_update_post( apply_filters( 'lasso_object_deleted_args', $args ) );
555
+		wp_update_post(apply_filters('lasso_object_deleted_args', $args));
556 556
 
557
-		do_action( 'lasso_object_deleted', $postid, get_current_user_ID() );
557
+		do_action('lasso_object_deleted', $postid, get_current_user_ID());
558 558
 
559 559
 		exit;
560 560
 	}
@@ -562,40 +562,40 @@  discard block
 block discarded – undo
562 562
     /* This function doesn't actually publish post, but should be called when a post is published */
563 563
     public function on_publish_post( ) {
564 564
 
565
-		$post_id = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
565
+		$post_id = isset($_POST['postid']) ? $_POST['postid'] : false;
566 566
         
567
-        do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) );
567
+        do_action('transition_post_status', 'publish', 'draft', get_post($post_id));
568 568
 
569 569
 		exit;
570 570
 	}
571 571
 	
572 572
 	public function set_featured_img( ) {
573 573
 
574
-		$postid  	= isset( $_POST['postid'] ) ? $_POST['postid'] : false;
575
-		$image_id  	= isset( $_POST['image_id'] ) ? absint( $_POST['image_id'] ) : false;
576
-		if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_gallery' )) {
574
+		$postid = isset($_POST['postid']) ? $_POST['postid'] : false;
575
+		$image_id = isset($_POST['image_id']) ? absint($_POST['image_id']) : false;
576
+		if (!wp_verify_nonce($_POST['nonce'], 'lasso_gallery')) {
577 577
 			wp_send_json_error();
578 578
 			exit;
579 579
 		}	
580 580
 
581
-		set_post_thumbnail( $postid, $image_id );
581
+		set_post_thumbnail($postid, $image_id);
582 582
 
583
-		do_action( 'lasso_featured_image_set', $postid, $image_id, get_current_user_ID() );
583
+		do_action('lasso_featured_image_set', $postid, $image_id, get_current_user_ID());
584 584
 
585 585
 		exit;
586 586
 	}
587 587
 	
588 588
 	public function del_featured_img( ) {
589 589
 
590
-		$postid  = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
591
-		if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_gallery' )) {
590
+		$postid = isset($_POST['postid']) ? $_POST['postid'] : false;
591
+		if (!wp_verify_nonce($_POST['nonce'], 'lasso_gallery')) {
592 592
 			wp_send_json_error();
593 593
 			exit;
594 594
 		}	
595 595
 
596
-		delete_post_thumbnail( $postid );
596
+		delete_post_thumbnail($postid);
597 597
 
598
-		do_action( 'lasso_featured_image_deleted', $postid, get_current_user_ID() );
598
+		do_action('lasso_featured_image_deleted', $postid, get_current_user_ID());
599 599
 
600 600
 		exit;
601 601
 	}
@@ -616,17 +616,17 @@  discard block
 block discarded – undo
616 616
 		return self::$revisions;
617 617
 	}*/
618 618
 	
619
-	public function set_post_terms( $postid, $value, $taxonomy ) {
620
-		if( $value ) {
621
-			$value = explode( ',', $value );
622
-			$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
619
+	public function set_post_terms($postid, $value, $taxonomy) {
620
+		if ($value) {
621
+			$value = explode(',', $value);
622
+			$allow_new_category = lasso_editor_get_option('allow_new_category', 'lasso_editor');
623 623
 			
624
-			if ($taxonomy =='category') {
624
+			if ($taxonomy == 'category') {
625 625
                 // convert from names to category ids
626 626
 				$cats = array();
627 627
 				foreach ($value as $cat) {
628 628
 					$cat_id = get_cat_ID($cat);
629
-					if ($cat_id !=0) {
629
+					if ($cat_id != 0) {
630 630
 						$cats [] = $cat_id;
631 631
 					} else if ($allow_new_category) {
632 632
 					    $cats [] = wp_create_category($cat);
@@ -635,71 +635,71 @@  discard block
 block discarded – undo
635 635
 				$value = $cats;
636 636
 			}
637 637
 	
638
-			$result = wp_set_object_terms( $postid, $value, $taxonomy );
638
+			$result = wp_set_object_terms($postid, $value, $taxonomy);
639 639
 		}
640
-		else  {
640
+		else {
641 641
 			//remove all terms from post
642
-			$result = wp_set_object_terms( $postid, null, $taxonomy );
642
+			$result = wp_set_object_terms($postid, null, $taxonomy);
643 643
 		}
644 644
 
645
-		if ( ! is_wp_error( $result ) ) {
645
+		if (!is_wp_error($result)) {
646 646
 			return true;
647
-		}else{
647
+		} else {
648 648
 			return false;
649 649
 		}
650 650
 	}
651 651
     
652 652
     public function create_gallery( ) {
653 653
 
654
-		$postid  	= isset( $_POST['postid'] ) ? $_POST['postid'] : false;
654
+		$postid = isset($_POST['postid']) ? $_POST['postid'] : false;
655 655
         
656
-		if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_gallery' )) {
656
+		if (!wp_verify_nonce($_POST['nonce'], 'lasso_gallery')) {
657 657
 			wp_send_json_error();
658 658
 			exit;
659 659
 		}	
660 660
 
661
-		if (  ! lasso_user_can( 'publish_posts' ) ) {
661
+		if (!lasso_user_can('publish_posts')) {
662 662
 			return false;
663 663
 
664 664
 		}
665 665
 
666
-		$gallery_ids = isset( $_POST['gallery_ids'] ) ? $_POST['gallery_ids'] : false;
666
+		$gallery_ids = isset($_POST['gallery_ids']) ? $_POST['gallery_ids'] : false;
667 667
 
668 668
 		// bail if no gallery ids
669
-		if ( empty( $gallery_ids ) ) {
669
+		if (empty($gallery_ids)) {
670 670
 			return false;
671 671
 		}
672 672
 
673
-		$type   		 = isset( $_POST['gallery_type'] ) ? $_POST['gallery_type'] : false;
674
-		$edgallerytitle	 = isset( $_POST['edgallerytitle'] ) ? $_POST['edgallerytitle'] : $postid.'-'.rand();
673
+		$type = isset($_POST['gallery_type']) ? $_POST['gallery_type'] : false;
674
+		$edgallerytitle = isset($_POST['edgallerytitle']) ? $_POST['edgallerytitle'] : $postid.'-'.rand();
675 675
 
676 676
 		// insert a new gallery
677 677
 		$args = array(
678
-			'post_title'    => $edgallerytitle ,
678
+			'post_title'    => $edgallerytitle,
679 679
 			'post_status'   => 'publish',
680 680
 			'post_type'     => 'ai_galleries'
681 681
 		);
682 682
 
683
-		$postid = wp_insert_post( apply_filters( 'lasso_insert_gallery_args', $args ) );
683
+		$postid = wp_insert_post(apply_filters('lasso_insert_gallery_args', $args));
684 684
 
685 685
 		// update gallery ids
686
-		if ( $gallery_ids ) {
686
+		if ($gallery_ids) {
687 687
 
688
-			update_post_meta( $postid, '_ase_gallery_images', $gallery_ids );
688
+			update_post_meta($postid, '_ase_gallery_images', $gallery_ids);
689 689
 
690 690
 		}
691 691
 
692 692
 		// update the gallery type
693
-		if ( !empty( $type ) ) {
693
+		if (!empty($type)) {
694 694
 
695
-			update_post_meta( $postid, 'aesop_gallery_type', $type );
695
+			update_post_meta($postid, 'aesop_gallery_type', $type);
696 696
 
697 697
 		}
698 698
 
699
-		do_action( 'lasso_gallery_published', $postid, $gallery_ids, get_current_user_ID() );
699
+		do_action('lasso_gallery_published', $postid, $gallery_ids, get_current_user_ID());
700 700
 
701 701
 
702
-		echo json_encode( array(
702
+		echo json_encode(array(
703 703
 			'message' => 'gallery-created',
704 704
 			'id' => $postid)
705 705
 		);
@@ -708,114 +708,114 @@  discard block
 block discarded – undo
708 708
     
709 709
     public function update_gallery( ) {
710 710
         
711
-		$options      = isset( $_POST['fields'] ) ? $_POST['fields'] : false;
711
+		$options      = isset($_POST['fields']) ? $_POST['fields'] : false;
712 712
         
713
-		$postid   	  = !empty( $options ) ? (int) $options['id'] : false;
714
-		$gallery_ids  = isset( $_POST['gallery_ids'] ) ? $_POST['gallery_ids'] : false;
715
-		if ( $_POST[ 'gallery_type' ] ) {
716
-			$type = $_POST[ 'gallery_type' ];
717
-		}elseif ( ! empty( $options ) && $options[ 'galleryType' ] ) {
718
-			$type = $options[ 'galleryType' ];
719
-		}else{
713
+		$postid = !empty($options) ? (int) $options['id'] : false;
714
+		$gallery_ids  = isset($_POST['gallery_ids']) ? $_POST['gallery_ids'] : false;
715
+		if ($_POST['gallery_type']) {
716
+			$type = $_POST['gallery_type'];
717
+		}elseif (!empty($options) && $options['galleryType']) {
718
+			$type = $options['galleryType'];
719
+		} else {
720 720
 			$type = false;
721 721
 		}
722 722
 
723
-		self::save_gallery_options( $postid, $gallery_ids, $options, $type );
723
+		self::save_gallery_options($postid, $gallery_ids, $options, $type);
724 724
 
725
-        echo json_encode( array('message' => 'gallery-updated') );
725
+        echo json_encode(array('message' => 'gallery-updated'));
726 726
 
727 727
         exit;
728 728
 	}
729 729
     
730
-    public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) {
730
+    public function save_gallery_options($postid, $gallery_ids, $options, $type = false) {
731 731
 
732 732
 		// gallery width
733
-		$gallery_width = isset( $options['width'] ) ? $options['width'] : false;
733
+		$gallery_width = isset($options['width']) ? $options['width'] : false;
734 734
 
735 735
 		// gallery grid item width
736
-		$item_width = isset( $options['itemwidth'] ) ? $options['itemwidth'] : false;
736
+		$item_width = isset($options['itemwidth']) ? $options['itemwidth'] : false;
737 737
 
738 738
 		// caption
739
-		$caption = isset( $options['caption'] ) ? $options['caption'] : false;
739
+		$caption = isset($options['caption']) ? $options['caption'] : false;
740 740
 
741 741
 		// gallery transition
742
-		$transition = isset( $options['transition'] ) ? $options['transition'] : false;
742
+		$transition = isset($options['transition']) ? $options['transition'] : false;
743 743
 
744 744
 		// gallery transition speed
745
-		$transitionSpeed = isset( $options['speed'] ) ? $options['speed'] : false;
745
+		$transitionSpeed = isset($options['speed']) ? $options['speed'] : false;
746 746
 
747 747
 		// gallery hide thumbs
748
-		$hideThumbs = isset( $options['hideThumbs'] ) ? $options['hideThumbs'] : false;
748
+		$hideThumbs = isset($options['hideThumbs']) ? $options['hideThumbs'] : false;
749 749
 
750 750
 		// photoset layout hardwired to on for now
751
-		$psLayout = isset( $options['pslayout'] ) ? $options['pslayout'] : false;
751
+		$psLayout = isset($options['pslayout']) ? $options['pslayout'] : false;
752 752
 
753 753
 		// photoset layout
754
-		$psLightbox = 'on';//isset( $options['pslightbox'] ) ? $options['pslightbox'] : false;
754
+		$psLightbox = 'on'; //isset( $options['pslightbox'] ) ? $options['pslightbox'] : false;
755 755
 		
756 756
 		// hero gallery height
757
-		$gallery_height = isset( $options['height'] ) ? $options['height'] : false;
757
+		$gallery_height = isset($options['height']) ? $options['height'] : false;
758 758
 
759 759
 		// update gallery ids
760
-		if ( !empty( $gallery_ids ) ) {
760
+		if (!empty($gallery_ids)) {
761 761
 
762
-			update_post_meta( $postid, '_ase_gallery_images', $gallery_ids );
762
+			update_post_meta($postid, '_ase_gallery_images', $gallery_ids);
763 763
 
764 764
 		}
765 765
 
766
-		update_post_meta( $postid, 'aesop_gallery_type', sanitize_text_field( trim( $type ) ) );
766
+		update_post_meta($postid, 'aesop_gallery_type', sanitize_text_field(trim($type)));
767 767
 
768
-		update_post_meta( $postid, 'aesop_gallery_width', sanitize_text_field( trim( $gallery_width ) ) );
768
+		update_post_meta($postid, 'aesop_gallery_width', sanitize_text_field(trim($gallery_width)));
769 769
 
770
-		update_post_meta( $postid, 'aesop_grid_gallery_width', sanitize_text_field( trim( $item_width ) ) );
770
+		update_post_meta($postid, 'aesop_grid_gallery_width', sanitize_text_field(trim($item_width)));
771 771
 
772
-		update_post_meta( $postid, 'aesop_gallery_caption', sanitize_text_field( trim( $caption ) ) );
772
+		update_post_meta($postid, 'aesop_gallery_caption', sanitize_text_field(trim($caption)));
773 773
 
774
-		update_post_meta( $postid, 'aesop_thumb_gallery_transition', sanitize_text_field( trim( $transition ) ) );
774
+		update_post_meta($postid, 'aesop_thumb_gallery_transition', sanitize_text_field(trim($transition)));
775 775
 
776
-		update_post_meta( $postid, 'aesop_thumb_gallery_transition_speed', absint( trim( $transitionSpeed ) ) );
776
+		update_post_meta($postid, 'aesop_thumb_gallery_transition_speed', absint(trim($transitionSpeed)));
777 777
 
778
-		update_post_meta( $postid, 'aesop_thumb_gallery_hide_thumbs', sanitize_text_field( trim( $hideThumbs ) ) );
778
+		update_post_meta($postid, 'aesop_thumb_gallery_hide_thumbs', sanitize_text_field(trim($hideThumbs)));
779 779
 
780
-		update_post_meta( $postid, 'aesop_photoset_gallery_layout', sanitize_text_field( trim( $psLayout ) ) );
780
+		update_post_meta($postid, 'aesop_photoset_gallery_layout', sanitize_text_field(trim($psLayout)));
781 781
 
782
-		update_post_meta( $postid, 'aesop_photoset_gallery_lightbox', sanitize_text_field( trim( $psLightbox ) ) );
782
+		update_post_meta($postid, 'aesop_photoset_gallery_lightbox', sanitize_text_field(trim($psLightbox)));
783 783
 		
784
-		update_post_meta( $postid, 'aesop_hero_gallery_height', sanitize_text_field( trim( $gallery_height ) ) );
784
+		update_post_meta($postid, 'aesop_hero_gallery_height', sanitize_text_field(trim($gallery_height)));
785 785
 		
786 786
 		//hardwired for now
787 787
 		
788
-		update_post_meta( $postid, 'aesop_hero_gallery_transition_speed', 300 );
788
+		update_post_meta($postid, 'aesop_hero_gallery_transition_speed', 300);
789 789
 
790 790
 	}
791 791
 	
792
-	function getEnglishMonthName($foreignMonthName){
792
+	function getEnglishMonthName($foreignMonthName) {
793 793
 
794 794
 		  setlocale(LC_ALL, 'en_US');
795 795
 
796
-		  $month_numbers = range(1,12);
796
+		  $month_numbers = range(1, 12);
797 797
 
798
-		  foreach($month_numbers as $month)
799
-			$english_months[] = strftime('%B',mktime(0,0,0,$month,1,2011));
798
+		  foreach ($month_numbers as $month)
799
+			$english_months[] = strftime('%B', mktime(0, 0, 0, $month, 1, 2011));
800 800
 
801 801
 		  setlocale(LC_ALL, get_locale());
802 802
 
803
-		  foreach($month_numbers as $month)
804
-			$foreign_months[] = utf8_encode(strftime('%B',mktime(0,0,0,$month,1,2011)));
803
+		  foreach ($month_numbers as $month)
804
+			$foreign_months[] = utf8_encode(strftime('%B', mktime(0, 0, 0, $month, 1, 2011)));
805 805
 
806 806
 		  return str_replace($foreign_months, $english_months, $foreignMonthName);
807 807
 	}
808 808
 
809 809
 
810 810
 	
811
-	public function set_date( $postid, $value) {
812
-		if( $value ) {
813
-			$value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time( 'timestamp', 1 ));
811
+	public function set_date($postid, $value) {
812
+		if ($value) {
813
+			$value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time('timestamp', 1));
814 814
             wp_update_post(
815
-				array (
815
+				array(
816 816
 					'ID'            => $postid, // ID of the post to update
817
-					'post_date'     => date( 'Y-m-d H:i:s',  strtotime($value) ),
818
-					'post_date_gmt'     => gmdate( 'Y-m-d H:i:s',  strtotime($value) ),
817
+					'post_date'     => date('Y-m-d H:i:s', strtotime($value)),
818
+					'post_date_gmt'     => gmdate('Y-m-d H:i:s', strtotime($value)),
819 819
 				)
820 820
 			);
821 821
 		}
Please login to merge, or discard this patch.
Braces   +24 added lines, -33 removed lines patch added patch discarded remove patch
@@ -426,47 +426,36 @@  discard block
 block discarded – undo
426 426
 		if ($code == "aesop_video") {
427 427
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
428 428
 		    echo aesop_video_shortcode($atts);
429
-		}
430
-		else if ($code == "aesop_image") {
429
+		} else if ($code == "aesop_image") {
431 430
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
432 431
 		    echo aesop_image_shortcode($atts);
433
-		}
434
-		else if ($code == "aesop_quote") {
432
+		} else if ($code == "aesop_quote") {
435 433
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
436 434
 		    echo aesop_quote_shortcode($atts);
437
-		}
438
-		else if ($code == "aesop_parallax") {
435
+		} else if ($code == "aesop_parallax") {
439 436
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
440 437
 		    echo aesop_parallax_shortcode($atts);
441
-		}
442
-		else if ($code == "aesop_character") {
438
+		} else if ($code == "aesop_character") {
443 439
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
444 440
 		    echo aesop_character_shortcode($atts);
445
-		}
446
-		else if ($code == "aesop_collection") {
441
+		} else if ($code == "aesop_collection") {
447 442
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
448 443
 		    echo aesop_collection_shortcode($atts);
449
-		}
450
-		else if ($code == "aesop_chapter") {
444
+		} else if ($code == "aesop_chapter") {
451 445
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
452 446
 		    echo aesop_chapter_shortcode($atts);
453
-		}
454
-		else if ($code == "aesop_content") {
447
+		} else if ($code == "aesop_content") {
455 448
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
456 449
 		    echo aesop_content_shortcode($atts, $atts['content_data']);
457
-		}
458
-		else if ($code == "aesop_gallery") {
450
+		} else if ($code == "aesop_gallery") {
459 451
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
460 452
 		    echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
461
-		}
462
-		else if ($code == "aesop_audio") {
453
+		} else if ($code == "aesop_audio") {
463 454
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
464 455
 		    echo aesop_audio_shortcode($atts);
465
-		}
466
-        else if ($code == "aesop_wpimg") {
456
+		} else if ($code == "aesop_wpimg") {
467 457
             self::wpimg($atts);
468
-		}
469
-		else {
458
+		} else {
470 459
 			$code = '['.$code.' ';
471 460
 			foreach ($atts as $key => $value) {
472 461
 			    $code = ''.$key.'="'.$value.'" ';
@@ -539,8 +528,9 @@  discard block
 block discarded – undo
539 528
 		$postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
540 529
 
541 530
 		// bail out if the current user can't publish posts
542
-		if ( !lasso_user_can( 'delete_post', $postid ) )
543
-			return;
531
+		if ( !lasso_user_can( 'delete_post', $postid ) ) {
532
+					return;
533
+		}
544 534
 		
545 535
 		if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_delete_post' )) {
546 536
 			wp_send_json_error();
@@ -636,15 +626,14 @@  discard block
 block discarded – undo
636 626
 			}
637 627
 	
638 628
 			$result = wp_set_object_terms( $postid, $value, $taxonomy );
639
-		}
640
-		else  {
629
+		} else  {
641 630
 			//remove all terms from post
642 631
 			$result = wp_set_object_terms( $postid, null, $taxonomy );
643 632
 		}
644 633
 
645 634
 		if ( ! is_wp_error( $result ) ) {
646 635
 			return true;
647
-		}else{
636
+		} else{
648 637
 			return false;
649 638
 		}
650 639
 	}
@@ -714,9 +703,9 @@  discard block
 block discarded – undo
714 703
 		$gallery_ids  = isset( $_POST['gallery_ids'] ) ? $_POST['gallery_ids'] : false;
715 704
 		if ( $_POST[ 'gallery_type' ] ) {
716 705
 			$type = $_POST[ 'gallery_type' ];
717
-		}elseif ( ! empty( $options ) && $options[ 'galleryType' ] ) {
706
+		} elseif ( ! empty( $options ) && $options[ 'galleryType' ] ) {
718 707
 			$type = $options[ 'galleryType' ];
719
-		}else{
708
+		} else{
720 709
 			$type = false;
721 710
 		}
722 711
 
@@ -795,13 +784,15 @@  discard block
 block discarded – undo
795 784
 
796 785
 		  $month_numbers = range(1,12);
797 786
 
798
-		  foreach($month_numbers as $month)
799
-			$english_months[] = strftime('%B',mktime(0,0,0,$month,1,2011));
787
+		  foreach($month_numbers as $month) {
788
+		  			$english_months[] = strftime('%B',mktime(0,0,0,$month,1,2011));
789
+		  }
800 790
 
801 791
 		  setlocale(LC_ALL, get_locale());
802 792
 
803
-		  foreach($month_numbers as $month)
804
-			$foreign_months[] = utf8_encode(strftime('%B',mktime(0,0,0,$month,1,2011)));
793
+		  foreach($month_numbers as $month) {
794
+		  			$foreign_months[] = utf8_encode(strftime('%B',mktime(0,0,0,$month,1,2011)));
795
+		  }
805 796
 
806 797
 		  return str_replace($foreign_months, $english_months, $foreignMonthName);
807 798
 	}
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   +75 added lines, -75 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');
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 			$tz_offset = get_UTC_offset();
127 127
 			$post_date = get_the_time('U', $postid);
128 128
 			$time = (time()+$tz_offset);
129
-            $delta = $time - $post_date;
129
+			$delta = $time - $post_date;
130 130
             
131 131
 			$strings = array(
132 132
 				'save' 				=> __('Save','lasso'),
@@ -181,11 +181,11 @@  discard block
 block discarded – undo
181 181
 			$gallery_nonce = wp_create_nonce( $gallery_nonce_action );
182 182
 			
183 183
 			
184
-            if ($allow_change_date) {
185
-			    $permalink = get_site_url().'/?p='.$postid;
186
-            } else {
187
-                $permalink = get_permalink($postid);
188
-            }
184
+			if ($allow_change_date) {
185
+				$permalink = get_site_url().'/?p='.$postid;
186
+			} else {
187
+				$permalink = get_permalink($postid);
188
+			}
189 189
 			
190 190
 			// rest api
191 191
 			$rest_nonce = '';
@@ -205,17 +205,17 @@  discard block
 block discarded – undo
205 205
 				}
206 206
 			}
207 207
             
208
-            //excerpt
209
-            $post_excerpt = "";
210
-            $post_excerpt = $post->post_excerpt;
208
+			//excerpt
209
+			$post_excerpt = "";
210
+			$post_excerpt = $post->post_excerpt;
211 211
             
212
-            //find if this is multi page. -1 if not
213
-            $multipage = self::is_multipage();
214
-            $post_content = "";
215
-            //pass post_content if we need to process multipage. In future we may need to pass this for other purposes
216
-            if ($multipage != -1) {
217
-               $post_content = $post->post_content;
218
-            }
212
+			//find if this is multi page. -1 if not
213
+			$multipage = self::is_multipage();
214
+			$post_content = "";
215
+			//pass post_content if we need to process multipage. In future we may need to pass this for other purposes
216
+			if ($multipage != -1) {
217
+			   $post_content = $post->post_content;
218
+			}
219 219
 
220 220
 			// localized objects
221 221
 			$objects = array(
@@ -291,15 +291,15 @@  discard block
 block discarded – undo
291 291
 				'customFields'      => $custom_fields,
292 292
 				'clickToInsert'     => ($insert_comp_ui =='click'),
293 293
 				'buttonOnEmptyP'     => ($insert_comp_ui =='mediumcom'),      // auto show a button to insert components on an empty paragraph      
294
-                'rtl'               => is_rtl(),				
294
+				'rtl'               => is_rtl(),				
295 295
 				'skipToEdit'        =>( $delta < 10 && $delta >=0 ), // if it's a new post, skip to edit mode
296 296
 				'linksEditable'    => $links_editable,
297 297
 				'supportPendingStatus' => !$no_pending_status,
298 298
 				'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>'),
299
-                'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) || self::gutenberg_active(),//,
300
-                'multipages'=> $multipage,
301
-                'post_content'=>$post_content,
302
-                'post_excerpt'=>$post_excerpt
299
+				'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) || self::gutenberg_active(),//,
300
+				'multipages'=> $multipage,
301
+				'post_content'=>$post_content,
302
+				'post_excerpt'=>$post_excerpt
303 303
 			);
304 304
 
305 305
 
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 			
308 308
 			
309 309
 			if (!$using_restapiv2) {
310
-               // enqueue REST API V1
310
+			   // enqueue REST API V1
311 311
 			   wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
312 312
 			   $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) );
313 313
 			   wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings );
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 			if ($show_color) {
324 324
 				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true);
325 325
 			} else {
326
-			    wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
326
+				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
327 327
 			}
328 328
 			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) );
329 329
 
@@ -332,44 +332,44 @@  discard block
 block discarded – undo
332 332
 
333 333
 	}
334 334
     
335
-    function gutenberg_active() {
335
+	function gutenberg_active() {
336 336
         
337
-        // Gutenberg plugin is installed and activated.
338
-        $gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) );
339
-
340
-        // Block editor since 5.0.
341
-        $block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' );
342
-
343
-        if ( ! $gutenberg && ! $block_editor ) {
344
-            return false;
345
-        }
346
-
347
-        if ( self::is_classic_editor_plugin_active() ) {
348
-            $editor_option       = get_option( 'classic-editor-replace' );
349
-            $block_editor_active = array( 'no-replace', 'block' );
350
-
351
-            return in_array( $editor_option, $block_editor_active, true );
352
-        }
353
-
354
-        return true;
355
-    }
356
-
357
-    /**
358
-     * Check if Classic Editor plugin is active.
359
-     *
360
-     * @return bool
361
-     */
362
-    function is_classic_editor_plugin_active() {
363
-        if ( ! function_exists( 'is_plugin_active' ) ) {
364
-            include_once ABSPATH . 'wp-admin/includes/plugin.php';
365
-        }
366
-
367
-        if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) {
368
-            return true;
369
-        }
370
-
371
-        return false;
372
-    }
337
+		// Gutenberg plugin is installed and activated.
338
+		$gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) );
339
+
340
+		// Block editor since 5.0.
341
+		$block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' );
342
+
343
+		if ( ! $gutenberg && ! $block_editor ) {
344
+			return false;
345
+		}
346
+
347
+		if ( self::is_classic_editor_plugin_active() ) {
348
+			$editor_option       = get_option( 'classic-editor-replace' );
349
+			$block_editor_active = array( 'no-replace', 'block' );
350
+
351
+			return in_array( $editor_option, $block_editor_active, true );
352
+		}
353
+
354
+		return true;
355
+	}
356
+
357
+	/**
358
+	 * Check if Classic Editor plugin is active.
359
+	 *
360
+	 * @return bool
361
+	 */
362
+	function is_classic_editor_plugin_active() {
363
+		if ( ! function_exists( 'is_plugin_active' ) ) {
364
+			include_once ABSPATH . 'wp-admin/includes/plugin.php';
365
+		}
366
+
367
+		if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) {
368
+			return true;
369
+		}
370
+
371
+		return false;
372
+	}
373 373
 
374 374
 }
375 375
 
Please login to merge, or discard this patch.
Spacing   +105 added lines, -105 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,28 +67,28 @@  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 93
 			
94 94
 			//text alignement
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
 			
106 106
 			if ($show_color) {
107 107
 				//color picker
108
-				wp_enqueue_style( 'wp-color-picker' );
109
-				wp_enqueue_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 );
108
+				wp_enqueue_style('wp-color-picker');
109
+				wp_enqueue_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), false, 1);
110 110
 			}
111 111
 			
112 112
 			// click to insert components, not drag and drop
@@ -118,54 +118,54 @@  discard block
 block discarded – undo
118 118
 			
119 119
 			// custom fields
120 120
 			
121
-			$custom_fields = apply_filters( 'editus_custom_fields', null ); 
121
+			$custom_fields = apply_filters('editus_custom_fields', null); 
122 122
 
123 123
 
124 124
 			// post id reference
125 125
 			$postid 			= get_the_ID();
126 126
 			$tz_offset = get_UTC_offset();
127 127
 			$post_date = get_the_time('U', $postid);
128
-			$time = (time()+$tz_offset);
128
+			$time = (time() + $tz_offset);
129 129
             $delta = $time - $post_date;
130 130
             
131 131
 			$strings = array(
132
-				'save' 				=> __('Save','lasso'),
133
-				'selectText'	  	=> __('Please Select Text First.','lasso'),
134
-				'cancel' 			=> __('Cancel','lasso'),
135
-				'exiteditor' 		=> __('Exit Editor','lasso'),
136
-				'saving' 			=> __('Saving...','lasso'),
137
-				'saved'				=> __('Saved!','lasso'),
138
-				'adding' 			=> __('Adding...','lasso'),
139
-				'added'				=> __('Added!','lasso'),
140
-				'loading' 			=> __('Loading...','lasso'),
141
-				'loadMore'			=> __('Load More','lasso'),
142
-				'close'			=> __('Close','lasso'),
143
-				'noPostsFound'		=> __('No more posts found','lasso'),
144
-				'fetchFail'	    	=> __('Fetching failed.','lasso'),
145
-				'galleryCreated' 	=> __('Gallery Created!','lasso'),
146
-				'galleryUpdated' 	=> __('Gallery Updated!','lasso'),
147
-				'justWrite'			=> __('Just write...','lasso'),
148
-				'chooseImage'		=> __('Choose an image','lasso'),
149
-				'updateImage'		=> __('Update Image','lasso'),
150
-				'insertImage'		=> __('Insert Image','lasso'),
151
-				'selectImage'		=> __('Select Image','lasso'),
152
-				'removeFeatImg'     => __('Remove featured image?','lasso'),
153
-				'updateSelectedImg' => __('Update Selected Image','lasso'),
154
-				'chooseImages'		=> __('Choose images','lasso'),
155
-				'editImage'			=> __('Edit Image','lasso'),
156
-				'addImages'			=> __('Add Images','lasso'),
157
-				'addNewGallery'		=> __('Add New Gallery','lasso'),
158
-				'selectGallery'		=> __('Select Editus Gallery Image','lasso'),
159
-				'useSelectedImages' => __('Use Selected Images','lasso'),
160
-				'publishPost'		=> __('Publish Post?','lasso'),
161
-				'publishYes'		=> __('Yes, publish it!','lasso'),
162
-				'deletePost'		=> __('Trash Post?','lasso'),
163
-				'deleteYes'			=> __('Yes, trash it!','lasso'),
164
-				'warning'			=> __('Oh snap!','laso'),
165
-				'cancelText'		=> __('O.K. got it!','lasso'),
166
-				'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'),
132
+				'save' 				=> __('Save', 'lasso'),
133
+				'selectText'	  	=> __('Please Select Text First.', 'lasso'),
134
+				'cancel' 			=> __('Cancel', 'lasso'),
135
+				'exiteditor' 		=> __('Exit Editor', 'lasso'),
136
+				'saving' 			=> __('Saving...', 'lasso'),
137
+				'saved'				=> __('Saved!', 'lasso'),
138
+				'adding' 			=> __('Adding...', 'lasso'),
139
+				'added'				=> __('Added!', 'lasso'),
140
+				'loading' 			=> __('Loading...', 'lasso'),
141
+				'loadMore'			=> __('Load More', 'lasso'),
142
+				'close'			=> __('Close', 'lasso'),
143
+				'noPostsFound'		=> __('No more posts found', 'lasso'),
144
+				'fetchFail'	    	=> __('Fetching failed.', 'lasso'),
145
+				'galleryCreated' 	=> __('Gallery Created!', 'lasso'),
146
+				'galleryUpdated' 	=> __('Gallery Updated!', 'lasso'),
147
+				'justWrite'			=> __('Just write...', 'lasso'),
148
+				'chooseImage'		=> __('Choose an image', 'lasso'),
149
+				'updateImage'		=> __('Update Image', 'lasso'),
150
+				'insertImage'		=> __('Insert Image', 'lasso'),
151
+				'selectImage'		=> __('Select Image', 'lasso'),
152
+				'removeFeatImg'     => __('Remove featured image?', 'lasso'),
153
+				'updateSelectedImg' => __('Update Selected Image', 'lasso'),
154
+				'chooseImages'		=> __('Choose images', 'lasso'),
155
+				'editImage'			=> __('Edit Image', 'lasso'),
156
+				'addImages'			=> __('Add Images', 'lasso'),
157
+				'addNewGallery'		=> __('Add New Gallery', 'lasso'),
158
+				'selectGallery'		=> __('Select Editus Gallery Image', 'lasso'),
159
+				'useSelectedImages' => __('Use Selected Images', 'lasso'),
160
+				'publishPost'		=> __('Publish Post?', 'lasso'),
161
+				'publishYes'		=> __('Yes, publish it!', 'lasso'),
162
+				'deletePost'		=> __('Trash Post?', 'lasso'),
163
+				'deleteYes'			=> __('Yes, trash it!', 'lasso'),
164
+				'warning'			=> __('Oh snap!', 'laso'),
165
+				'cancelText'		=> __('O.K. got it!', 'lasso'),
166
+				'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'),
167 167
 				'missingConfirm'	=> __('Update Settings', 'lasso'),
168
-				'helperText'		=> __('one more letter','lasso'),
168
+				'helperText'		=> __('one more letter', 'lasso'),
169 169
 				'editingBackup'  	=> __('You are currently editing a backup copy of this post.'),
170 170
 				
171 171
 				'catsPlaceholder'     => __('add categories...'),
@@ -174,11 +174,11 @@  discard block
 block discarded – undo
174 174
 				
175 175
 			);
176 176
 
177
-			$api_url = trailingslashit( home_url() ) . 'lasso-internal-api';
177
+			$api_url = trailingslashit(home_url()).'lasso-internal-api';
178 178
 
179 179
 			$gallery_class = new gallery();
180 180
 			$gallery_nonce_action = $gallery_class->nonce_action;
181
-			$gallery_nonce = wp_create_nonce( $gallery_nonce_action );
181
+			$gallery_nonce = wp_create_nonce($gallery_nonce_action);
182 182
 			
183 183
 			
184 184
             if ($allow_change_date) {
@@ -193,13 +193,13 @@  discard block
 block discarded – undo
193 193
 			  
194 194
 			if (function_exists('rest_url')) {
195 195
 				//$rest_root = esc_url_raw( rest_url());
196
-				$rest_nonce = wp_create_nonce( 'wp_rest' );
197
-				$settings = array( 'root' => $rest_root, 'nonce' => $rest_nonce );
198
-				wp_enqueue_script( 'wp-api', '', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
199
-				wp_localize_script( 'wp-api', 'wpApiSettings', $settings );
200
-				wp_localize_script( 'wp-api', 'WP_API_Settings', $settings );
196
+				$rest_nonce = wp_create_nonce('wp_rest');
197
+				$settings = array('root' => $rest_root, 'nonce' => $rest_nonce);
198
+				wp_enqueue_script('wp-api', '', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true);
199
+				wp_localize_script('wp-api', 'wpApiSettings', $settings);
200
+				wp_localize_script('wp-api', 'WP_API_Settings', $settings);
201 201
 				
202
-				if ( class_exists( 'WP_REST_Controller' )) {
202
+				if (class_exists('WP_REST_Controller')) {
203 203
 					// we are using REST API V2
204 204
 					$using_restapiv2 = true;
205 205
 				}
@@ -219,8 +219,8 @@  discard block
 block discarded – undo
219 219
 
220 220
 			// localized objects
221 221
 			$objects = array(
222
-				'ajaxurl' 			=> esc_url( $api_url ),
223
-				'ajaxurl2' 			=> esc_url( admin_url( 'admin-ajax.php' )),
222
+				'ajaxurl' 			=> esc_url($api_url),
223
+				'ajaxurl2' 			=> esc_url(admin_url('admin-ajax.php')),
224 224
 				'siteUrl'           => site_url(),
225 225
 				'rest_root'         => $rest_root,
226 226
 				'rest_nonce'        => $rest_nonce,
@@ -229,13 +229,13 @@  discard block
 block discarded – undo
229 229
 				'featImgClass'		=> $featImgClass,
230 230
 				'titleClass'		=> $titleClass,
231 231
 				'strings'			=> $strings,
232
-				'settingsLink'		=> function_exists('is_multisite') && is_multisite() ? network_admin_url( 'settings.php?page=lasso-editor' ) : admin_url( 'admin.php?page=lasso-editor-settings' ),
233
-				'post_status'		=> get_post_status( $postid ),
232
+				'settingsLink'		=> function_exists('is_multisite') && is_multisite() ? network_admin_url('settings.php?page=lasso-editor') : admin_url('admin.php?page=lasso-editor-settings'),
233
+				'post_status'		=> get_post_status($postid),
234 234
 				'postid'			=> $postid,
235 235
 				'permalink'			=> $permalink,
236 236
 				'edit_others_pages'	=> current_user_can('edit_others_pages') ? true : false,
237 237
 				'edit_others_posts'	=> current_user_can('edit_others_posts') ? true : false,
238
-				'userCanEdit'		=> current_user_can('edit_post', $postid ),
238
+				'userCanEdit'		=> current_user_can('edit_post', $postid),
239 239
 				'can_publish'		=> is_page() ? current_user_can('publish_pages') : current_user_can('publish_posts'),
240 240
 				//'can_publish_posts'	=> current_user_can('publish_posts'),
241 241
 				//'can_publish_pages'	=> current_user_can('publish_pages'),
@@ -271,32 +271,32 @@  discard block
 block discarded – undo
271 271
 				'postTags'    		=> lasso_get_objects('tag'),
272 272
 				'noResultsDiv'		=> lasso_editor_empty_results(),
273 273
 				'noRevisionsDiv'	=> lasso_editor_empty_results('revision'),
274
-				'mapTileProvider'   => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider( $postid ) : false,
275
-				'mapLocations'		=> get_post_meta( $postid, 'ase_map_component_locations' ),
276
-				'mapStart'			=> get_post_meta( $postid, 'ase_map_component_start_point', true ),
277
-				'mapZoom'			=> get_post_meta( $postid, 'ase_map_component_zoom', true ),
274
+				'mapTileProvider'   => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider($postid) : false,
275
+				'mapLocations'		=> get_post_meta($postid, 'ase_map_component_locations'),
276
+				'mapStart'			=> get_post_meta($postid, 'ase_map_component_start_point', true),
277
+				'mapZoom'			=> get_post_meta($postid, 'ase_map_component_zoom', true),
278 278
 				'revisionModal' 	=> lasso_editor_revision_modal(),
279 279
 				'isMobile'          => wp_is_mobile(),
280
-				'enableAutoSave'    => lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ),
280
+				'enableAutoSave'    => lasso_editor_get_option('enable_autosave', 'lasso_editor'),
281 281
 				'showColor'         => $show_color,
282 282
 				'showAlignment'     => $show_align,
283 283
 				'showIgnoredItems'  => lasso_editor_get_option('show_ignored_items', 'lasso_editor'),
284 284
 				'restapi2'          => $using_restapiv2,
285 285
 				'saveusingrest'     => $using_restapiv2 && !$disableRESTSave,
286
-				'newObjectContent'  => '<p>'.apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso') ).'</p>',
286
+				'newObjectContent'  => '<p>'.apply_filters('lasso_new_object_content', __('Once upon a time...', 'lasso')).'</p>',
287 287
 				'disableSavePost'   => $save_to_post_disabled,
288 288
 				'disableEditPost'   => $edit_post_disabled,
289 289
 				'boldTag'           => $bold_tag,
290 290
 				'iTag'           	=> $i_tag,
291 291
 				'customFields'      => $custom_fields,
292
-				'clickToInsert'     => ($insert_comp_ui =='click'),
293
-				'buttonOnEmptyP'     => ($insert_comp_ui =='mediumcom'),      // auto show a button to insert components on an empty paragraph      
292
+				'clickToInsert'     => ($insert_comp_ui == 'click'),
293
+				'buttonOnEmptyP'     => ($insert_comp_ui == 'mediumcom'), // auto show a button to insert components on an empty paragraph      
294 294
                 'rtl'               => is_rtl(),				
295
-				'skipToEdit'        =>( $delta < 10 && $delta >=0 ), // if it's a new post, skip to edit mode
295
+				'skipToEdit'        =>($delta < 10 && $delta >= 0), // if it's a new post, skip to edit mode
296 296
 				'linksEditable'    => $links_editable,
297 297
 				'supportPendingStatus' => !$no_pending_status,
298
-				'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>'),
299
-                'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) || self::gutenberg_active(),//,
298
+				'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>'),
299
+                'hasGutenberg' => (function_exists('has_blocks') && has_blocks($post->post_content)) || self::gutenberg_active(), //,
300 300
                 'multipages'=> $multipage,
301 301
                 'post_content'=>$post_content,
302 302
                 'post_excerpt'=>$post_excerpt
@@ -308,9 +308,9 @@  discard block
 block discarded – undo
308 308
 			
309 309
 			if (!$using_restapiv2) {
310 310
                // enqueue REST API V1
311
-			   wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
312
-			   $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) );
313
-			   wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings );
311
+			   wp_enqueue_script('wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true);
312
+			   $settings = array('root' => home_url($home_url), 'nonce' => wp_create_nonce('wp_json'));
313
+			   wp_localize_script('wp-api-js', 'WP_API_Settings', $settings);
314 314
 			}
315 315
 			
316 316
 			if ($allow_change_date) {
@@ -319,13 +319,13 @@  discard block
 block discarded – undo
319 319
 				wp_enqueue_style('jquery-ui');
320 320
 			}
321 321
 
322
-			$postfix = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? '' : '.min';
322
+			$postfix = (defined('SCRIPT_DEBUG') && true === SCRIPT_DEBUG) ? '' : '.min';
323 323
 			if ($show_color) {
324
-				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true);
324
+				wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api', 'iris'), LASSO_VERSION, true);
325 325
 			} else {
326
-			    wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
326
+			    wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
327 327
 			}
328
-			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) );
328
+			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects));
329 329
 
330 330
 
331 331
 		}
@@ -335,20 +335,20 @@  discard block
 block discarded – undo
335 335
     function gutenberg_active() {
336 336
         
337 337
         // Gutenberg plugin is installed and activated.
338
-        $gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) );
338
+        $gutenberg = !(false === has_filter('replace_editor', 'gutenberg_init'));
339 339
 
340 340
         // Block editor since 5.0.
341
-        $block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' );
341
+        $block_editor = version_compare($GLOBALS['wp_version'], '5.0-beta', '>');
342 342
 
343
-        if ( ! $gutenberg && ! $block_editor ) {
343
+        if (!$gutenberg && !$block_editor) {
344 344
             return false;
345 345
         }
346 346
 
347
-        if ( self::is_classic_editor_plugin_active() ) {
348
-            $editor_option       = get_option( 'classic-editor-replace' );
349
-            $block_editor_active = array( 'no-replace', 'block' );
347
+        if (self::is_classic_editor_plugin_active()) {
348
+            $editor_option       = get_option('classic-editor-replace');
349
+            $block_editor_active = array('no-replace', 'block');
350 350
 
351
-            return in_array( $editor_option, $block_editor_active, true );
351
+            return in_array($editor_option, $block_editor_active, true);
352 352
         }
353 353
 
354 354
         return true;
@@ -360,11 +360,11 @@  discard block
 block discarded – undo
360 360
      * @return bool
361 361
      */
362 362
     function is_classic_editor_plugin_active() {
363
-        if ( ! function_exists( 'is_plugin_active' ) ) {
364
-            include_once ABSPATH . 'wp-admin/includes/plugin.php';
363
+        if (!function_exists('is_plugin_active')) {
364
+            include_once ABSPATH.'wp-admin/includes/plugin.php';
365 365
         }
366 366
 
367
-        if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) {
367
+        if (is_plugin_active('classic-editor/classic-editor.php')) {
368 368
             return true;
369 369
         }
370 370
 
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.