Completed
Push — master ( 019e58...ee1edc )
by
unknown
01:39
created
public/includes/assets.php 2 patches
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/lasso.php 3 patches
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/editor-modules.php 2 patches
Indentation   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 				height: 42px;
115 115
 			}
116 116
 		<?php
117
-            } 
117
+			} 
118 118
 		} else { 
119 119
 		?> 
120 120
 
@@ -123,8 +123,8 @@  discard block
 block discarded – undo
123 123
             }
124 124
             
125 125
         <?php
126
-        }
127
-        ?>
126
+		}
127
+		?>
128 128
         </style>
129 129
 		<div id="lasso--controls" class="lasso-post-status--<?php echo sanitize_html_class( $status );?> <?php echo sanitize_html_class( $custom_classes );?>" data-post-id="<?php echo get_the_ID();?>" >
130 130
 
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 	$toolbar_class  = $toolbar_headings ? 'toolbar-extended' : false;
234 234
 	
235 235
 	// mobile styles
236
-    $mobile_class = $is_mobile ? 'lasso-mobile' : false;
236
+	$mobile_class = $is_mobile ? 'lasso-mobile' : false;
237 237
 	$mobile_style =$is_mobile ? 'style="bottom:0px;"' : null;
238 238
 	
239 239
 	//show color
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
 	
457 457
 	//editor options
458 458
 	$allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor');
459
-    $allow_edit_excerpt = lasso_editor_get_option('allow_edit_excerpt', 'lasso_editor');
459
+	$allow_edit_excerpt = lasso_editor_get_option('allow_edit_excerpt', 'lasso_editor');
460 460
 	$no_url_setting = lasso_editor_get_option('no_url_setting', 'lasso_editor');
461 461
 
462 462
 	// are we singular
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
 	// do we support pending status
470 470
 	$no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor');
471 471
     
472
-    $excerpt = $post->post_excerpt;
472
+	$excerpt = $post->post_excerpt;
473 473
 
474 474
 ?>
475 475
 	<div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>">
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
 						}?>
549 549
 						<?php 
550 550
 						if ($allow_change_date) { 
551
-						    $dateformat = get_option( 'date_format' ); 
551
+							$dateformat = get_option( 'date_format' ); 
552 552
 						?>
553 553
 						    <label><?php _e( 'Post Date', 'lasso' ); ?></label>
554 554
 							<input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/>
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
 						if ( !empty( $types ) ) {
664 664
 							// get the first element
665 665
 							$keys = array_keys($types);
666
-						    $type =$keys[0];						
666
+							$type =$keys[0];						
667 667
 							$type = preg_replace( '/s\b/','', $type );
668 668
 							printf( '<input type="hidden" name="object" value="%s">', lcfirst( esc_attr( $type ) ) );		
669 669
 						}
@@ -691,8 +691,8 @@  discard block
 block discarded – undo
691 691
 	global $post;
692 692
 	
693 693
 	global $wp_post_types;
694
-    $labels = &$wp_post_types['post']->labels;
695
-    $labels->name = 'Articles';
694
+	$labels = &$wp_post_types['post']->labels;
695
+	$labels->name = 'Articles';
696 696
 
697 697
 	ob_start();
698 698
 
@@ -835,8 +835,8 @@  discard block
 block discarded – undo
835 835
 function lasso_editor_options_blob() {
836 836
 
837 837
 	$codes   = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : array();
838
-    $codes   = add_wpimg_options( array() );
839
-    $codes   = apply_filters( 'lasso_custom_options', $codes );
838
+	$codes   = add_wpimg_options( array() );
839
+	$codes   = apply_filters( 'lasso_custom_options', $codes );
840 840
 	$galleries  = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery';
841 841
 
842 842
 	$nonce = wp_create_nonce( 'lasso_gallery' );
@@ -938,9 +938,9 @@  discard block
 block discarded – undo
938 938
 		$return .= '</form>';
939 939
 
940 940
 		// extra JS codes
941
-        if (isset($shortcode['codes'])) {
942
-		    $return .= $shortcode['codes'];
943
-        }
941
+		if (isset($shortcode['codes'])) {
942
+			$return .= $shortcode['codes'];
943
+		}
944 944
 		$blob[$slug] = $return;
945 945
 	}
946 946
 
@@ -950,59 +950,59 @@  discard block
 block discarded – undo
950 950
 
951 951
 function add_wpimg_options( $shortcodes ) {
952 952
 
953
-    $custom = array(
954
-        'wpimg'    => array(
955
-            'name'     => __( 'Image', 'lasso' ),
956
-            'type'     => 'single',
957
-            'atts'     => array(
958
-                'img'    => array(
959
-                    'type'  => 'media_upload',
960
-                    'default'  => '',
961
-                    'desc'   => __( 'Image URL', 'lasso' ),
962
-                    'tip'  => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' )
963
-                ),
953
+	$custom = array(
954
+		'wpimg'    => array(
955
+			'name'     => __( 'Image', 'lasso' ),
956
+			'type'     => 'single',
957
+			'atts'     => array(
958
+				'img'    => array(
959
+					'type'  => 'media_upload',
960
+					'default'  => '',
961
+					'desc'   => __( 'Image URL', 'lasso' ),
962
+					'tip'  => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' )
963
+				),
964 964
                 
965
-                'imgwidth'    => array(
966
-                    'type'  => 'text_small',
967
-                    'default'  => '300px',
968
-                    'desc'   => __( 'Image Width', 'lasso' ),
969
-                    'tip'  => __( 'Width of the image. You can enter the size in pixels or percentage such as <code>40%</code> or <code>500px</code>.', 'aesop-core' )
970
-                ),
971
-                'imgheight'    => array(
972
-                    'type'  => 'text_small',
973
-                    'default'  => '',
974
-                    'desc'   => __( 'Image Height', 'lasso' ),
975
-                    'tip'  => __( 'Used only for the Panorama mode. Can be set using pixel values such as <code>500px</code>. If unspecified, the original height would be used. ', 'aesop-core' )
976
-                ),					
965
+				'imgwidth'    => array(
966
+					'type'  => 'text_small',
967
+					'default'  => '300px',
968
+					'desc'   => __( 'Image Width', 'lasso' ),
969
+					'tip'  => __( 'Width of the image. You can enter the size in pixels or percentage such as <code>40%</code> or <code>500px</code>.', 'aesop-core' )
970
+				),
971
+				'imgheight'    => array(
972
+					'type'  => 'text_small',
973
+					'default'  => '',
974
+					'desc'   => __( 'Image Height', 'lasso' ),
975
+					'tip'  => __( 'Used only for the Panorama mode. Can be set using pixel values such as <code>500px</code>. If unspecified, the original height would be used. ', 'aesop-core' )
976
+				),					
977 977
                 
978
-                'link'    => array(
979
-                    'type'  => 'text',
980
-                    'default'  => '',
981
-                    'desc'   => __( 'Link', 'lasso' ),
982
-                    'tip'  => __( 'URL link', 'lasso' )
983
-                ),
984
-                'alt'    => array(
985
-                    'type'  => 'text',
986
-                    'default'  => '',
987
-                    'desc'   => __( 'Image ALT', 'lasso' ),
988
-                    'tip'  => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' )
989
-                ),
978
+				'link'    => array(
979
+					'type'  => 'text',
980
+					'default'  => '',
981
+					'desc'   => __( 'Link', 'lasso' ),
982
+					'tip'  => __( 'URL link', 'lasso' )
983
+				),
984
+				'alt'    => array(
985
+					'type'  => 'text',
986
+					'default'  => '',
987
+					'desc'   => __( 'Image ALT', 'lasso' ),
988
+					'tip'  => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' )
989
+				),
990 990
                 
991
-                'caption'    => array(
992
-                    'type'  => 'text_area',
993
-                    'default'  => '',
994
-                    'desc'   => __( 'Caption', 'lasso' ),
995
-                    'tip'  => __( 'Optional caption for the image.', 'lasso' )
996
-                ),
991
+				'caption'    => array(
992
+					'type'  => 'text_area',
993
+					'default'  => '',
994
+					'desc'   => __( 'Caption', 'lasso' ),
995
+					'tip'  => __( 'Optional caption for the image.', 'lasso' )
996
+				),
997 997
                 
998 998
 
999
-            ),
1000
-            'desc'     => __( 'An image.', 'aesop-core' ),
1001
-            'codes'    => ''
1002
-        )
1003
-    );
999
+			),
1000
+			'desc'     => __( 'An image.', 'aesop-core' ),
1001
+			'codes'    => ''
1002
+		)
1003
+	);
1004 1004
 
1005
-    return array_merge( $shortcodes, $custom );
1005
+	return array_merge( $shortcodes, $custom );
1006 1006
 }
1007 1007
 
1008 1008
 /**
@@ -1047,23 +1047,23 @@  discard block
 block discarded – undo
1047 1047
  * @return string
1048 1048
  */
1049 1049
 function lasso_editor_adjustBrightness($hex, $steps) { 
1050
-    $steps = max(-255, min(255, $steps));
1050
+	$steps = max(-255, min(255, $steps));
1051 1051
 
1052
-    // Normalize into a six character long hex string
1053
-    $hex = str_replace('#', '', $hex);
1054
-    if (strlen($hex) == 3) {
1055
-        $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2);
1056
-    }
1052
+	// Normalize into a six character long hex string
1053
+	$hex = str_replace('#', '', $hex);
1054
+	if (strlen($hex) == 3) {
1055
+		$hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2);
1056
+	}
1057 1057
 
1058
-    // Split into three parts: R, G and B
1059
-    $color_parts = str_split($hex, 2);
1060
-    $return = '#';
1058
+	// Split into three parts: R, G and B
1059
+	$color_parts = str_split($hex, 2);
1060
+	$return = '#';
1061 1061
 
1062
-    foreach ($color_parts as $color) {
1063
-        $color   = hexdec($color); // Convert to decimal
1064
-        $color   = max(0,min(255,$color + $steps)); // Adjust color
1065
-        $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code
1066
-    }
1062
+	foreach ($color_parts as $color) {
1063
+		$color   = hexdec($color); // Convert to decimal
1064
+		$color   = max(0,min(255,$color + $steps)); // Adjust color
1065
+		$return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code
1066
+	}
1067 1067
 
1068
-    return $return;
1068
+	return $return;
1069 1069
 }
Please login to merge, or discard this patch.
Spacing   +282 added lines, -282 removed lines patch added patch discarded remove patch
@@ -11,39 +11,39 @@  discard block
 block discarded – undo
11 11
  *
12 12
  * @since 1.0
13 13
  */
14
-add_action( 'wp_footer', 'lasso_editor_controls' );
14
+add_action('wp_footer', 'lasso_editor_controls');
15 15
 function lasso_editor_controls() {
16 16
 
17 17
 	global $post;
18 18
 
19
-	if ( lasso_user_can('edit_posts') ) {
19
+	if (lasso_user_can('edit_posts')) {
20 20
 
21
-		$status = get_post_status( get_the_ID() );
22
-		$use_old_ui   = lasso_editor_get_option( 'use_old_ui', 'lasso_editor' );
23
-		$button_color1 = lasso_editor_get_option('button-color1', 'lasso_editor','#0000ff');
24
-		$button_color2 = lasso_editor_get_option('button-color2', 'lasso_editor','#000000');
25
-		$dialog_color = lasso_editor_get_option('dialog-color', 'lasso_editor','#000055');
26
-		$text_color = lasso_editor_get_option('text-color', 'lasso_editor','#ffffff');
21
+		$status = get_post_status(get_the_ID());
22
+		$use_old_ui   = lasso_editor_get_option('use_old_ui', 'lasso_editor');
23
+		$button_color1 = lasso_editor_get_option('button-color1', 'lasso_editor', '#0000ff');
24
+		$button_color2 = lasso_editor_get_option('button-color2', 'lasso_editor', '#000000');
25
+		$dialog_color = lasso_editor_get_option('dialog-color', 'lasso_editor', '#000055');
26
+		$text_color = lasso_editor_get_option('text-color', 'lasso_editor', '#ffffff');
27 27
 		$hover_color1 = lasso_editor_adjustBrightness($button_color1, 50);
28 28
 		$hover_color2 = lasso_editor_adjustBrightness($button_color2, 50);
29 29
 
30 30
 		// let users add custom css classes
31
-		$custom_classes = apply_filters( 'lasso_control_classes', '' );
31
+		$custom_classes = apply_filters('lasso_control_classes', '');
32 32
 
33 33
 		$post_access_class   = '';
34
-		$post_new_disabled   = lasso_editor_get_option( 'post_adding_disabled', 'lasso_editor' );
35
-		$post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' );
36
-		$shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' );
34
+		$post_new_disabled   = lasso_editor_get_option('post_adding_disabled', 'lasso_editor');
35
+		$post_settings_disabled = lasso_editor_get_option('post_settings_disabled', 'lasso_editor');
36
+		$shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor');
37 37
 
38 38
 
39 39
 		// CSS class if adding new post objects is disabled
40
-		if ( 'on' == $post_new_disabled ) { $post_access_class = 'lasso--post-new-disabled'; }
40
+		if ('on' == $post_new_disabled) { $post_access_class = 'lasso--post-new-disabled'; }
41 41
 
42 42
 		// CSS class if adjust settings is disabled
43
-		if ( 'on' == $post_settings_disabled ) { $post_access_class = 'lasso--post-settings-disabled'; }
43
+		if ('on' == $post_settings_disabled) { $post_access_class = 'lasso--post-settings-disabled'; }
44 44
 
45 45
 		// CSS class if adding new post objects AND settings are disabled
46
-		if ( 'on' == $post_new_disabled && 'on' == $post_settings_disabled ) { $post_access_class = 'lasso--post-all-disabled'; }
46
+		if ('on' == $post_new_disabled && 'on' == $post_settings_disabled) { $post_access_class = 'lasso--post-all-disabled'; }
47 47
 
48 48
 		// CSS class if shortcodify or (Aesop Shortcode Conversion) is disabled
49 49
 		$sc_saving_class = 'on' == $shortcodify_disabled ? 'shortcodify-disabled' : 'shortcodify-enabled';
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 		?>
58 58
 		<style>
59 59
 		#lasso-html--table:before {
60
-			content: "<?php esc_attr_e( 'Table', 'lasso' );?>";
60
+			content: "<?php esc_attr_e('Table', 'lasso'); ?>";
61 61
 		}
62 62
 		
63 63
 		
@@ -67,32 +67,32 @@  discard block
 block discarded – undo
67 67
 		?>
68 68
 		
69 69
 		.lasso-editor-controls--wrap, #lasso--post-settings2,#lasso--save,#lasso--post-delete,#lasso--exit,#lasso--publish {
70
-			background-image: -webkit-linear-gradient(top,<?php echo $button_color1;?> 0,<?php echo $button_color2;?> 100%);
71
-			background-image: -o-linear-gradient(top,<?php echo $button_color1;?> 0,<?php echo $button_color2;?> 100%);
72
-			background-image: linear-gradient(to bottom,<?php echo $button_color1;?> 0,<?php echo $button_color2;?> 100%);
73
-			color: <?php echo $text_color;?>;
70
+			background-image: -webkit-linear-gradient(top,<?php echo $button_color1; ?> 0,<?php echo $button_color2; ?> 100%);
71
+			background-image: -o-linear-gradient(top,<?php echo $button_color1; ?> 0,<?php echo $button_color2; ?> 100%);
72
+			background-image: linear-gradient(to bottom,<?php echo $button_color1; ?> 0,<?php echo $button_color2; ?> 100%);
73
+			color: <?php echo $text_color; ?>;
74 74
 		}
75 75
 		
76 76
 		.lasso--controls__right a:before, #lasso-toolbar--html__footer_desc, ul.lasso-editor-controls li:before,#lasso-side-comp-button.toolbar--side li:before
77 77
         {
78
-			color: <?php echo $text_color;?> !important;
78
+			color: <?php echo $text_color; ?> !important;
79 79
 		}
80 80
 		
81 81
 		
82 82
 		
83 83
 		ul.lasso-editor-controls li:hover, #lasso--exit:hover,#lasso--post-settings2:hover,#lasso--post-delete:hover,#lasso--publish:hover,#lasso--save:hover {
84
-			background-image: -webkit-linear-gradient(top,<?php echo $hover_color1;?> 0,<?php echo $hover_color2;?> 100%);
85
-			background-image: -o-linear-gradient(top,<?php echo $hover_color1;?> 0,<?php echo $hover_color2;?> 100%);
86
-			background-image: linear-gradient(to bottom,<?php echo $hover_color1;?> 0,<?php echo $hover_color2;?> 100%);
84
+			background-image: -webkit-linear-gradient(top,<?php echo $hover_color1; ?> 0,<?php echo $hover_color2; ?> 100%);
85
+			background-image: -o-linear-gradient(top,<?php echo $hover_color1; ?> 0,<?php echo $hover_color2; ?> 100%);
86
+			background-image: linear-gradient(to bottom,<?php echo $hover_color1; ?> 0,<?php echo $hover_color2; ?> 100%);
87 87
 		}
88 88
 		
89 89
 		.lasso--modal__inner,.sweet-alert,#lasso-toolbar--components.toolbar--drop-up ul,#lasso-toolbar--components__list,#lasso-toolbar--html.html--drop-up #lasso-toolbar--html__wrap,
90 90
 		#lasso-toolbar--link.link--drop-up #lasso-toolbar--link__wrap		{
91
-			background: <?php echo $dialog_color;?>;
92
-			color: <?php echo $text_color;?>;
91
+			background: <?php echo $dialog_color; ?>;
92
+			color: <?php echo $text_color; ?>;
93 93
 		}
94 94
 		.sweet-alert p,.lasso--modal__inner label,.lasso--toolbar__inner label {
95
-			color: <?php echo $text_color;?> !important;
95
+			color: <?php echo $text_color; ?> !important;
96 96
 		}
97 97
 		
98 98
 		<?php if (!$is_mobile) { ?>
@@ -126,48 +126,48 @@  discard block
 block discarded – undo
126 126
         }
127 127
         ?>
128 128
         </style>
129
-		<div id="lasso--controls" class="lasso-post-status--<?php echo sanitize_html_class( $status );?> <?php echo sanitize_html_class( $custom_classes );?>" data-post-id="<?php echo get_the_ID();?>" >
129
+		<div id="lasso--controls" class="lasso-post-status--<?php echo sanitize_html_class($status); ?> <?php echo sanitize_html_class($custom_classes); ?>" data-post-id="<?php echo get_the_ID(); ?>" >
130 130
 
131
-			<ul class="lasso--controls__center lasso-editor-controls lasso-editor-controls--wrap <?php echo $post_access_class;?> "  <?php echo $mobile_style ?> >
131
+			<ul class="lasso--controls__center lasso-editor-controls lasso-editor-controls--wrap <?php echo $post_access_class; ?> "  <?php echo $mobile_style ?> >
132 132
 
133
-				<?php do_action( 'lasso_editor_controls_before' );
133
+				<?php do_action('lasso_editor_controls_before');
134 134
 
135
-				if ( $is_capable ) { ?>
135
+				if ($is_capable) { ?>
136 136
 
137
-					<li id="lasso--edit" title="<?php esc_attr_e( 'Edit Post', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
137
+					<li id="lasso--edit" title="<?php esc_attr_e('Edit Post', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
138 138
 
139
-					<?php if ( 'off' == $post_settings_disabled || empty( $post_settings_disabled ) ) { ?>
140
-						<li id="lasso--post-settings" title="<?php esc_attr_e( 'Post Settings', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
139
+					<?php if ('off' == $post_settings_disabled || empty($post_settings_disabled)) { ?>
140
+						<li id="lasso--post-settings" title="<?php esc_attr_e('Post Settings', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
141 141
 					<?php }
142 142
 
143 143
 				} ?>
144 144
 
145
-				<li id="lasso--post-all" title="<?php esc_attr_e( 'All Posts', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
145
+				<li id="lasso--post-all" title="<?php esc_attr_e('All Posts', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
146 146
 
147
-				<?php if ( $is_capable && wp_revisions_enabled( $post ) ) { ?>
148
-					<li id="lasso--post-revisions" title="<?php esc_attr_e( 'Revisions', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
147
+				<?php if ($is_capable && wp_revisions_enabled($post)) { ?>
148
+					<li id="lasso--post-revisions" title="<?php esc_attr_e('Revisions', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
149 149
 				<?php } ?>
150 150
 
151
-				<?php if ( ( 'off' == $post_new_disabled || empty( $post_new_disabled ) && lasso_user_can('edit_posts') ) ) { ?>
152
-					<li id="lasso--post-new" title="<?php esc_attr_e( 'Add Post', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
151
+				<?php if (('off' == $post_new_disabled || empty($post_new_disabled) && lasso_user_can('edit_posts'))) { ?>
152
+					<li id="lasso--post-new" title="<?php esc_attr_e('Add Post', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
153 153
 				<?php } ?>
154 154
 
155
-				<?php do_action( 'lasso_editor_controls_after' );?>
155
+				<?php do_action('lasso_editor_controls_after'); ?>
156 156
 
157 157
 			</ul>
158 158
 
159
-			<?php if ( is_singular() && !$is_mobile ) { ?>
159
+			<?php if (is_singular() && !$is_mobile) { ?>
160 160
 
161
-				<div class="lasso--controls__right" data-posttype="<?php echo get_post_type( get_the_ID() );?>" data-status="<?php echo $status;?>">
161
+				<div class="lasso--controls__right" data-posttype="<?php echo get_post_type(get_the_ID()); ?>" data-status="<?php echo $status; ?>">
162 162
 				
163
-					<a href="#" title="<?php esc_attr_e( 'Delete Post', 'lasso' );?>" id="lasso--post-delete" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a>
164
-					<a href="#" title="<?php esc_attr_e( 'Post Settings', 'lasso' );?>" id="lasso--post-settings2" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a>
163
+					<a href="#" title="<?php esc_attr_e('Delete Post', 'lasso'); ?>" id="lasso--post-delete" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a>
164
+					<a href="#" title="<?php esc_attr_e('Post Settings', 'lasso'); ?>" id="lasso--post-settings2" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a>
165 165
 
166 166
 
167
-					<a href="#" title="<?php esc_attr_e( 'Save Post', 'lasso' );?>" id="lasso--save" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a>
167
+					<a href="#" title="<?php esc_attr_e('Save Post', 'lasso'); ?>" id="lasso--save" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a>
168 168
 
169
-					<?php if ( ('draft' == $status ) || ('pending' == $status && $can_publish) ) { ?>
170
-						<a href="#" title="<?php $can_publish ? esc_attr_e( 'Publish Post', 'lasso' ) : esc_attr_e( 'Submit For Review', 'lasso' );?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class;?>"></a>
169
+					<?php if (('draft' == $status) || ('pending' == $status && $can_publish)) { ?>
170
+						<a href="#" title="<?php $can_publish ? esc_attr_e('Publish Post', 'lasso') : esc_attr_e('Submit For Review', 'lasso'); ?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class; ?>"></a>
171 171
 					<?php } ?>
172 172
 					
173 173
 
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 		</div>
179 179
 		
180 180
 		
181
-		<?php do_action( 'lasso_editor_controls_after_outside' );?>
181
+		<?php do_action('lasso_editor_controls_after_outside'); ?>
182 182
 
183 183
 	<?php }
184 184
 }
@@ -196,9 +196,9 @@  discard block
 block discarded – undo
196 196
 
197 197
 
198 198
 	// let users add custom css classes
199
-	$custom_classes = apply_filters( 'lasso_sidebar_classes', '' );
199
+	$custom_classes = apply_filters('lasso_sidebar_classes', '');
200 200
 	?>
201
-	<div id="lasso--sidebar" class="<?php echo sanitize_html_class( $custom_classes );?>" >
201
+	<div id="lasso--sidebar" class="<?php echo sanitize_html_class($custom_classes); ?>" >
202 202
 		<div class="lasso--sidebar__inner">
203 203
 			<div id="aesop-generator-settings"><div id="lasso--component__settings"></div></div>
204 204
 		</div>
@@ -220,21 +220,21 @@  discard block
 block discarded – undo
220 220
 	$is_mobile = wp_is_mobile();
221 221
 
222 222
 	// check for lasso story engine and add a class doniting this
223
-	$ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active';
223
+	$ase_status = class_exists('Aesop_Core') || defined('LASSO_CUSTOM') ? 'ase-active' : 'ase-not-active';
224 224
 
225 225
 	// let users add custom css classes
226
-	$custom_classes = apply_filters( 'lasso_toolbar_classes', '' );
226
+	$custom_classes = apply_filters('lasso_toolbar_classes', '');
227 227
 
228 228
 	// are toolbar headings enabled
229
-	$toolbar_headings      = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' );
230
-	$toolbar_headings_h4      = lasso_editor_get_option( 'toolbar_headings_h4', 'lasso_editor' );
231
-	$toolbar_list      = lasso_editor_get_option( 'toolbar_list', 'lasso_editor' );
229
+	$toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor');
230
+	$toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
231
+	$toolbar_list = lasso_editor_get_option('toolbar_list', 'lasso_editor');
232 232
 
233
-	$toolbar_class  = $toolbar_headings ? 'toolbar-extended' : false;
233
+	$toolbar_class = $toolbar_headings ? 'toolbar-extended' : false;
234 234
 	
235 235
 	// mobile styles
236 236
     $mobile_class = $is_mobile ? 'lasso-mobile' : false;
237
-	$mobile_style =$is_mobile ? 'style="bottom:0px;"' : null;
237
+	$mobile_style = $is_mobile ? 'style="bottom:0px;"' : null;
238 238
 	
239 239
 	//show color
240 240
 	$show_color = lasso_editor_get_option('toolbar_show_color', 'lasso_editor');
@@ -242,126 +242,126 @@  discard block
 block discarded – undo
242 242
 	//show alignment
243 243
 	$show_align = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor');
244 244
 	
245
-	$status = get_post_status( get_the_ID() );
245
+	$status = get_post_status(get_the_ID());
246 246
 	
247
-	$shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' );
247
+	$shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor');
248 248
 	
249
-	$sc_saving_class = ('on' == $shortcodify_disabled || $ase_status == 'ase-not-active')  ? 'shortcodify-disabled' : 'shortcodify-enabled';
249
+	$sc_saving_class = ('on' == $shortcodify_disabled || $ase_status == 'ase-not-active') ? 'shortcodify-disabled' : 'shortcodify-enabled';
250 250
 
251 251
 
252 252
 	?>
253
-	<div class="lasso--toolbar_wrap lasso-editor-controls--wrap <?php echo $toolbar_class.' '.$mobile_class.' '.$ase_status.' '.sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style ?>>
254
-		<ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"';}?>>
255
-			<?php do_action( 'lasso_toolbar_components_before' );?>
256
-		    <li id="lasso-toolbar--bold" title="<?php esc_attr_e( 'Bold', 'lasso' );?>"></li>
257
-		    <li id="lasso-toolbar--underline" title="<?php esc_attr_e( 'Underline', 'lasso' );?>"></li>
258
-		    <li id="lasso-toolbar--italic" title="<?php esc_attr_e( 'Italicize', 'lasso' );?>"></li>
259
-		    <li id="lasso-toolbar--strike" title="<?php esc_attr_e( 'Strikethrough', 'lasso' );?>"></li>
260
-			<li id="lasso-toolbar--components" class="lasso-toolbar--components" title="<?php esc_attr_e( 'Insert Component', 'lasso' );?>" style="color:#ffffa0;">
253
+	<div class="lasso--toolbar_wrap lasso-editor-controls--wrap <?php echo $toolbar_class.' '.$mobile_class.' '.$ase_status.' '.sanitize_html_class($custom_classes); ?>" <?php echo $mobile_style ?>>
254
+		<ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"'; }?>>
255
+			<?php do_action('lasso_toolbar_components_before'); ?>
256
+		    <li id="lasso-toolbar--bold" title="<?php esc_attr_e('Bold', 'lasso'); ?>"></li>
257
+		    <li id="lasso-toolbar--underline" title="<?php esc_attr_e('Underline', 'lasso'); ?>"></li>
258
+		    <li id="lasso-toolbar--italic" title="<?php esc_attr_e('Italicize', 'lasso'); ?>"></li>
259
+		    <li id="lasso-toolbar--strike" title="<?php esc_attr_e('Strikethrough', 'lasso'); ?>"></li>
260
+			<li id="lasso-toolbar--components" class="lasso-toolbar--components" title="<?php esc_attr_e('Insert Component', 'lasso'); ?>" style="color:#ffffa0;">
261 261
 			    <ul id="lasso-toolbar--components__list" style="display:none;color:white;">
262
-			    	<?php if ( 'ase-active' == $ase_status ): ?>
263
-						<li data-type="image" title="<?php esc_attr_e( 'Image', 'lasso' );?>" class="lasso-toolbar--component__image"></li>
264
-						<li data-type="character" title="<?php esc_attr_e( 'Character', 'lasso' );?>" class="lasso-toolbar--component__character"></li>
265
-						<li data-type="quote" title="<?php esc_attr_e( 'Quote', 'lasso' );?>"  class="lasso-toolbar--component__quote"></li>
266
-						<li data-type="content" title="<?php esc_attr_e( 'Content', 'lasso' );?>"  class="lasso-toolbar--component__content"></li>
267
-						<li data-type="chapter" title="<?php esc_attr_e( 'Chapter', 'lasso' );?>"  class="lasso-toolbar--component__chapter"></li>
268
-						<li data-type="parallax" title="<?php esc_attr_e( 'Parallax', 'lasso' );?>"  class="lasso-toolbar--component__parallax"></li>
269
-						<li data-type="audio" title="<?php esc_attr_e( 'Audio', 'lasso' );?>"  class="lasso-toolbar--component__audio"></li>
270
-						<li data-type="video" title="<?php esc_attr_e( 'Video', 'lasso' );?>"  class="lasso-toolbar--component__video"></li>
271
-						<li data-type="map" title="<?php esc_attr_e( 'Map', 'lasso' );?>"  class="lasso-toolbar--component__map"></li>
272
-						<li data-type="timeline_stop" title="<?php esc_attr_e( 'Timeline', 'lasso' );?>"  class="lasso-toolbar--component__timeline"></li>
273
-						<li data-type="document" title="<?php esc_attr_e( 'Document', 'lasso' );?>"  class="lasso-toolbar--component__document"></li>
274
-						<li data-type="collection" title="<?php esc_attr_e( 'Collection', 'lasso' );?>"  class="lasso-toolbar--component__collection"></li>
275
-						<li data-type="gallery" title="<?php esc_attr_e( 'Gallery', 'lasso' );?>"  class="lasso-toolbar--component__gallery"></li>
276
-						<?php if ( class_exists ('Aesop_GalleryPop') ) { ?>
277
-						     <li data-type="gallery" title="<?php esc_attr_e( 'Gallery Pop', 'lasso' );?>"  class="lasso-toolbar--component__gallerypop"></li>
262
+			    	<?php if ('ase-active' == $ase_status): ?>
263
+						<li data-type="image" title="<?php esc_attr_e('Image', 'lasso'); ?>" class="lasso-toolbar--component__image"></li>
264
+						<li data-type="character" title="<?php esc_attr_e('Character', 'lasso'); ?>" class="lasso-toolbar--component__character"></li>
265
+						<li data-type="quote" title="<?php esc_attr_e('Quote', 'lasso'); ?>"  class="lasso-toolbar--component__quote"></li>
266
+						<li data-type="content" title="<?php esc_attr_e('Content', 'lasso'); ?>"  class="lasso-toolbar--component__content"></li>
267
+						<li data-type="chapter" title="<?php esc_attr_e('Chapter', 'lasso'); ?>"  class="lasso-toolbar--component__chapter"></li>
268
+						<li data-type="parallax" title="<?php esc_attr_e('Parallax', 'lasso'); ?>"  class="lasso-toolbar--component__parallax"></li>
269
+						<li data-type="audio" title="<?php esc_attr_e('Audio', 'lasso'); ?>"  class="lasso-toolbar--component__audio"></li>
270
+						<li data-type="video" title="<?php esc_attr_e('Video', 'lasso'); ?>"  class="lasso-toolbar--component__video"></li>
271
+						<li data-type="map" title="<?php esc_attr_e('Map', 'lasso'); ?>"  class="lasso-toolbar--component__map"></li>
272
+						<li data-type="timeline_stop" title="<?php esc_attr_e('Timeline', 'lasso'); ?>"  class="lasso-toolbar--component__timeline"></li>
273
+						<li data-type="document" title="<?php esc_attr_e('Document', 'lasso'); ?>"  class="lasso-toolbar--component__document"></li>
274
+						<li data-type="collection" title="<?php esc_attr_e('Collection', 'lasso'); ?>"  class="lasso-toolbar--component__collection"></li>
275
+						<li data-type="gallery" title="<?php esc_attr_e('Gallery', 'lasso'); ?>"  class="lasso-toolbar--component__gallery"></li>
276
+						<?php if (class_exists('Aesop_GalleryPop')) { ?>
277
+						     <li data-type="gallery" title="<?php esc_attr_e('Gallery Pop', 'lasso'); ?>"  class="lasso-toolbar--component__gallerypop"></li>
278 278
 						<?php }?>
279
-						<?php if ( class_exists ('Aesop_Events') ) { ?>
280
-						     <li data-type="events" title="<?php esc_attr_e( 'Event', 'lasso' );?>"  class="lasso-toolbar--component__event"></li>
279
+						<?php if (class_exists('Aesop_Events')) { ?>
280
+						     <li data-type="events" title="<?php esc_attr_e('Event', 'lasso'); ?>"  class="lasso-toolbar--component__event"></li>
281 281
 						<?php }?>
282 282
 					<?php else: ?>
283
-						<li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li>
284
-						<li data-type="wpquote" title="<?php esc_attr_e( 'WordPress Quote', 'lasso' );?>" class="quote lasso-toolbar--component__quote"></li>
285
-						<!--li data-type="wpvideo" title="<?php esc_attr_e( 'WordPress Video', 'lasso' );?>" class="video lasso-toolbar--component__video"></li-->
283
+						<li data-type="wpimg" title="<?php esc_attr_e('WordPress Image', 'lasso'); ?>" class="image lasso-toolbar--component__image"></li>
284
+						<li data-type="wpquote" title="<?php esc_attr_e('WordPress Quote', 'lasso'); ?>" class="quote lasso-toolbar--component__quote"></li>
285
+						<!--li data-type="wpvideo" title="<?php esc_attr_e('WordPress Video', 'lasso'); ?>" class="video lasso-toolbar--component__video"></li-->
286 286
 					<?php endif; ?>
287
-					<?php do_action( 'lasso_toolbar_components' );?>
287
+					<?php do_action('lasso_toolbar_components'); ?>
288 288
 			    </ul>
289 289
 			</li>
290
-		    <?php if ( $toolbar_headings ): ?>
291
-		    <li id="lasso-toolbar--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"></li>
292
-		    <li id="lasso-toolbar--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"></li>
290
+		    <?php if ($toolbar_headings): ?>
291
+		    <li id="lasso-toolbar--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"></li>
292
+		    <li id="lasso-toolbar--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"></li>
293 293
 			<?php endif; ?>
294 294
 			
295 295
 			
296 296
 			
297
-			<?php if ( $toolbar_headings_h4 ): ?>
298
-		    <li id="lasso-toolbar--h4" title="<?php esc_attr_e( 'H4 Heading', 'lasso' );?>"></li>
299
-		    <li id="lasso-toolbar--h5" title="<?php esc_attr_e( 'H5 Heading', 'lasso' );?>"></li>
300
-			<li id="lasso-toolbar--h6" title="<?php esc_attr_e( 'H6 Heading', 'lasso' );?>"></li>
297
+			<?php if ($toolbar_headings_h4): ?>
298
+		    <li id="lasso-toolbar--h4" title="<?php esc_attr_e('H4 Heading', 'lasso'); ?>"></li>
299
+		    <li id="lasso-toolbar--h5" title="<?php esc_attr_e('H5 Heading', 'lasso'); ?>"></li>
300
+			<li id="lasso-toolbar--h6" title="<?php esc_attr_e('H6 Heading', 'lasso'); ?>"></li>
301 301
 			<?php endif; ?>
302 302
 			
303
-			<?php if ( $show_color ): ?>
304
-		    <li id="lasso-toolbar--color-set" title="<?php esc_attr_e( 'Set Color for Selected Text', 'lasso' );?>"></li>
305
-		    <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e( 'Choose Color', 'lasso' );?>"></li>
303
+			<?php if ($show_color): ?>
304
+		    <li id="lasso-toolbar--color-set" title="<?php esc_attr_e('Set Color for Selected Text', 'lasso'); ?>"></li>
305
+		    <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e('Choose Color', 'lasso'); ?>"></li>
306 306
 			<?php endif; ?>
307 307
 			
308
-			<?php if ( $toolbar_list ): ?>
309
-		    <li id="lasso-toolbar--ol" title="<?php esc_attr_e( 'Ordered List', 'lasso' );?>"></li>
310
-		    <li id="lasso-toolbar--ul" title="<?php esc_attr_e( 'Unordered List', 'lasso' );?>"></li>
308
+			<?php if ($toolbar_list): ?>
309
+		    <li id="lasso-toolbar--ol" title="<?php esc_attr_e('Ordered List', 'lasso'); ?>"></li>
310
+		    <li id="lasso-toolbar--ul" title="<?php esc_attr_e('Unordered List', 'lasso'); ?>"></li>
311 311
 			<?php endif; ?>
312 312
 					
313 313
 		    
314
-			<li id="lasso-toolbar--link" title="<?php esc_attr_e( 'Anchor Link', 'lasso' );?>">
314
+			<li id="lasso-toolbar--link" title="<?php esc_attr_e('Anchor Link', 'lasso'); ?>">
315 315
 		    	<div id="lasso-toolbar--link__wrap" <?php echo $mobile_style ?> >
316
-		    		<div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'http://url.com', 'lasso' );?>"></div>
317
-		    		<a href="#" title="<?php esc_attr_e( 'Create Link', 'lasso' );?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a>
316
+		    		<div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e('http://url.com', 'lasso'); ?>"></div>
317
+		    		<a href="#" title="<?php esc_attr_e('Create Link', 'lasso'); ?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a>
318 318
 					<input class="styled-checkbox" type="checkbox" id="aesop-toolbar--link_newtab" checked/>
319
-                    <label for="aesop-toolbar--link_newtab"><?php esc_attr_e( 'Open in a New Tab', 'lasso' );?></label>
319
+                    <label for="aesop-toolbar--link_newtab"><?php esc_attr_e('Open in a New Tab', 'lasso'); ?></label>
320 320
 		    	</div>
321 321
 		    </li>
322
-		    <?php do_action( 'lasso_toolbar_components_after' );?>
323
-		    <li id="lasso-toolbar--html" title="<?php esc_attr_e( 'Insert HTML or Code', 'lasso' );?>">
322
+		    <?php do_action('lasso_toolbar_components_after'); ?>
323
+		    <li id="lasso-toolbar--html" title="<?php esc_attr_e('Insert HTML or Code', 'lasso'); ?>">
324 324
 		    	<div id="lasso-toolbar--html__wrap" <?php echo $mobile_style ?>>
325
-		    		<div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?>"></div>
325
+		    		<div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e('Enter HTML to insert', 'lasso'); ?>"></div>
326 326
 		    		<div id="lasso-toolbar--html__footer">
327 327
 					<div id="lasso-toolbar--html__footer_desc" >
328
-					<?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?><br>
329
-					<?php esc_attr_e( 'You can also use Shortcodes', 'lasso' );?><br>
330
-					<?php esc_attr_e( 'You can also enter a URL to embed, such as Youtube, Vimeo and Twitter URLs.', 'lasso' );?>
328
+					<?php esc_attr_e('Enter HTML to insert', 'lasso'); ?><br>
329
+					<?php esc_attr_e('You can also use Shortcodes', 'lasso'); ?><br>
330
+					<?php esc_attr_e('You can also enter a URL to embed, such as Youtube, Vimeo and Twitter URLs.', 'lasso'); ?>
331 331
 					</div>
332 332
 		    			<ul class="lasso-toolbar--html-snips">
333 333
 						
334
-		    				<?php if ( !$toolbar_headings ): ?>
335
-		    				<li id="lasso-html--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>">
336
-		    				<li id="lasso-html--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>">
334
+		    				<?php if (!$toolbar_headings): ?>
335
+		    				<li id="lasso-html--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>">
336
+		    				<li id="lasso-html--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>">
337 337
 		    				<?php endif; ?>
338
-		    				<li id="lasso-html--ol" title="<?php esc_attr_e( 'Ordered List', 'lasso' );?>">
339
-							<li id="lasso-html--ul" title="<?php esc_attr_e( 'Unordered List', 'lasso' );?>">
338
+		    				<li id="lasso-html--ol" title="<?php esc_attr_e('Ordered List', 'lasso'); ?>">
339
+							<li id="lasso-html--ul" title="<?php esc_attr_e('Unordered List', 'lasso'); ?>">
340 340
 							
341
-							<li id="lasso-html--table" title="<?php esc_attr_e( 'Table', 'lasso' );?>">
341
+							<li id="lasso-html--table" title="<?php esc_attr_e('Table', 'lasso'); ?>">
342 342
 		    			</ul>
343
-		    			<a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e( 'Cancel', 'lasso' );?></a>
344
-		    			<a href="#" title="<?php esc_attr_e( 'Insert HTML or Code', 'lasso' );?>" class="lasso-toolbar--html__control" id="lasso-toolbar--html__insert" ><?php _e( 'Insert', 'lasso' );?></a>
343
+		    			<a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e('Cancel', 'lasso'); ?></a>
344
+		    			<a href="#" title="<?php esc_attr_e('Insert HTML or Code', 'lasso'); ?>" class="lasso-toolbar--html__control" id="lasso-toolbar--html__insert" ><?php _e('Insert', 'lasso'); ?></a>
345 345
 		    		</div>
346 346
 		    	</div>
347 347
 		    </li>
348
-			<?php if ( $show_align ): ?>
349
-		    <li id="lasso-toolbar--left-align" title="<?php esc_attr_e( 'Text Left Align', 'lasso' );?>"></li>
350
-		    <li id="lasso-toolbar--center-align" title="<?php esc_attr_e( 'Text Center Align', 'lasso' );?>"></li>
351
-			<li id="lasso-toolbar--right-align" title="<?php esc_attr_e( 'Text Right Align', 'lasso' );?>"></li>
348
+			<?php if ($show_align): ?>
349
+		    <li id="lasso-toolbar--left-align" title="<?php esc_attr_e('Text Left Align', 'lasso'); ?>"></li>
350
+		    <li id="lasso-toolbar--center-align" title="<?php esc_attr_e('Text Center Align', 'lasso'); ?>"></li>
351
+			<li id="lasso-toolbar--right-align" title="<?php esc_attr_e('Text Right Align', 'lasso'); ?>"></li>
352 352
 			<?php endif; ?>
353 353
 		</ul>
354
-		<?php if ( is_singular() && $is_mobile ) { ?>
354
+		<?php if (is_singular() && $is_mobile) { ?>
355 355
 
356
-				<div class="lasso--controls__right" data-posttype="<?php echo get_post_type( get_the_ID() );?>" data-status="<?php echo $status;?>" style="position:static;bottom:0px;right;0px;left:auto;">
356
+				<div class="lasso--controls__right" data-posttype="<?php echo get_post_type(get_the_ID()); ?>" data-status="<?php echo $status; ?>" style="position:static;bottom:0px;right;0px;left:auto;">
357 357
 
358
-					<a href="#" title="<?php esc_attr_e( 'Delete Post', 'lasso' );?>" id="lasso--post-delete" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a>
359
-					<a href="#" title="<?php esc_attr_e( 'Post Settings', 'lasso' );?>" id="lasso--post-settings2" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a>
358
+					<a href="#" title="<?php esc_attr_e('Delete Post', 'lasso'); ?>" id="lasso--post-delete" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a>
359
+					<a href="#" title="<?php esc_attr_e('Post Settings', 'lasso'); ?>" id="lasso--post-settings2" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a>
360 360
 
361
-					<a href="#" title="<?php esc_attr_e( 'Save Post', 'lasso' );?>" id="lasso--save" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a>
361
+					<a href="#" title="<?php esc_attr_e('Save Post', 'lasso'); ?>" id="lasso--save" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a>
362 362
 
363
-					<?php if ( 'draft' == $status && ( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') )  ) { ?>
364
-						<a href="#" title="<?php esc_attr_e( 'Publish Post', 'lasso' );?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class;?>"></a>
363
+					<?php if ('draft' == $status && (lasso_user_can('publish_posts') || lasso_user_can('publish_pages'))) { ?>
364
+						<a href="#" title="<?php esc_attr_e('Publish Post', 'lasso'); ?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class; ?>"></a>
365 365
 					<?php } ?>
366 366
 
367 367
 				</div>
@@ -379,20 +379,20 @@  discard block
 block discarded – undo
379 379
  */
380 380
 function lasso_editor_settings_toolbar() {
381 381
 
382
-	$delete_nonce = wp_create_nonce( 'lasso-delete-nonce' );
382
+	$delete_nonce = wp_create_nonce('lasso-delete-nonce');
383 383
 
384 384
 	ob_start();
385 385
 
386 386
 
387 387
 	// let users add custom css classes
388
-	$custom_classes = apply_filters( 'lasso_component_classes', '' );
388
+	$custom_classes = apply_filters('lasso_component_classes', '');
389 389
 
390 390
 	?>
391
-	<ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false">
392
-		<li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li>
393
-		<li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li>
394
-		<li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li>
395
-		<li class="lasso-delete" data-postid="<?php echo get_the_ID();?>" data-nonce="<?php echo $delete_nonce;?>" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li>
391
+	<ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false">
392
+		<li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li>
393
+		<li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li>
394
+		<li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li>
395
+		<li class="lasso-delete" data-postid="<?php echo get_the_ID(); ?>" data-nonce="<?php echo $delete_nonce; ?>" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li>
396 396
 	</ul>
397 397
 
398 398
 	<?php return ob_get_clean();
@@ -410,13 +410,13 @@  discard block
 block discarded – undo
410 410
 
411 411
 
412 412
 	// has post thumbnail
413
-	$has_thumbnail = has_post_thumbnail( get_the_ID() ) ? 'class="lasso--featImg--has-thumb"' : false;
413
+	$has_thumbnail = has_post_thumbnail(get_the_ID()) ? 'class="lasso--featImg--has-thumb"' : false;
414 414
 
415 415
 	?>
416
-	<ul id="lasso--featImgControls" <?php echo $has_thumbnail;?>>
417
-		<li id="lasso--featImgUpload"><a title="<?php esc_attr_e( 'Replace Image', 'lasso' );?>" href="#"><i class="lasso-icon-image"></i></a></li>
418
-		<li id="lasso--featImgDelete"><a title="<?php esc_attr_e( 'Delete Image', 'lasso' );?>" href="#"><i class="lasso-icon-bin2"></i></a></li>
419
-		<li id="lasso--featImgSave"><a href="#"><?php esc_attr_e( 'save', 'lasso' );?></a></li>
416
+	<ul id="lasso--featImgControls" <?php echo $has_thumbnail; ?>>
417
+		<li id="lasso--featImgUpload"><a title="<?php esc_attr_e('Replace Image', 'lasso'); ?>" href="#"><i class="lasso-icon-image"></i></a></li>
418
+		<li id="lasso--featImgDelete"><a title="<?php esc_attr_e('Delete Image', 'lasso'); ?>" href="#"><i class="lasso-icon-bin2"></i></a></li>
419
+		<li id="lasso--featImgSave"><a href="#"><?php esc_attr_e('save', 'lasso'); ?></a></li>
420 420
 	</ul>
421 421
 
422 422
 	<?php return ob_get_clean();
@@ -440,19 +440,19 @@  discard block
 block discarded – undo
440 440
 
441 441
 	$postid = get_the_ID();
442 442
 
443
-	$status = get_post_status( $postid );
444
-	$nonce = wp_create_nonce( 'lasso-update-post-settings' );
443
+	$status = get_post_status($postid);
444
+	$nonce = wp_create_nonce('lasso-update-post-settings');
445 445
 
446 446
 	// let users add custom css classes
447
-	$custom_classes = apply_filters( 'lasso_modal_settings_classes', '' );
447
+	$custom_classes = apply_filters('lasso_modal_settings_classes', '');
448 448
 
449 449
 	// objects categories
450
-	$categories 		= lasso_get_post_objects( $postid, 'category' );
451
-	$tags 				= lasso_get_post_objects( $postid, 'tag' );
450
+	$categories = lasso_get_post_objects($postid, 'category');
451
+	$tags = lasso_get_post_objects($postid, 'tag');
452 452
 
453 453
 	// modal tabs
454
-	$tabs  				= lasso_modal_addons('tab');
455
-	$content 			= lasso_modal_addons('content');
454
+	$tabs = lasso_modal_addons('tab');
455
+	$content = lasso_modal_addons('content');
456 456
 	
457 457
 	//editor options
458 458
 	$allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor');
@@ -460,11 +460,11 @@  discard block
 block discarded – undo
460 460
 	$no_url_setting = lasso_editor_get_option('no_url_setting', 'lasso_editor');
461 461
 
462 462
 	// are we singular
463
-	$is_singular 		= is_singular();
463
+	$is_singular = is_singular();
464 464
 	$is_singular_class 	= $is_singular ? 'lasso--postsettings__2col' : 'lasso--postsettings__1col';
465 465
 	$has_thumb_class    = has_post_thumbnail() ? 'has-thumbnail' : 'no-thumbnail';
466 466
 	$theme_supports     = current_theme_supports('post-thumbnails');
467
-	$default_image 		= LASSO_URL.'/admin/assets/img/empty-img.png';
467
+	$default_image = LASSO_URL.'/admin/assets/img/empty-img.png';
468 468
 	
469 469
 	// do we support pending status
470 470
 	$no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor');
@@ -472,26 +472,26 @@  discard block
 block discarded – undo
472 472
     $excerpt = $post->post_excerpt;
473 473
 
474 474
 ?>
475
-	<div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>">
475
+	<div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>">
476 476
 		<div class="lasso--modal__inner">
477 477
 
478
-			<?php if( $tabs ) { echo $tabs; } ?>
478
+			<?php if ($tabs) { echo $tabs; } ?>
479 479
 
480 480
 			<div class="lasso--modal__content modal__content--core visible" data-addon-content="core">
481
-				<form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class;?>" >
481
+				<form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class; ?>" >
482 482
 
483
-					<?php if ( $is_singular && $theme_supports ) : ?>
483
+					<?php if ($is_singular && $theme_supports) : ?>
484 484
 					<div class="lasso--postsettings__left">
485
-						<label><?php _e( 'Featured Image', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Change the featured image for this post.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label>
486
-						<div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url( $default_image );?>">
485
+						<label><?php _e('Featured Image', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Change the featured image for this post.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label>
486
+						<div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url($default_image); ?>">
487 487
 
488 488
 							<div id="lasso--post-thumb__controls" class="lasso--post-thumb__controls">
489
-								<i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image','lasso');?>" class="dashicons dashicons-edit"></i>
490
-								<i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image','lasso');?>" class="dashicons dashicons-no-alt"></i>
489
+								<i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image', 'lasso'); ?>" class="dashicons dashicons-edit"></i>
490
+								<i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image', 'lasso'); ?>" class="dashicons dashicons-no-alt"></i>
491 491
 								<i id="lasso--save-status" class="lasso-icon lasso-icon-spinner6 not-visible"></i>
492 492
 							</div>
493 493
 
494
-							<?php echo has_post_thumbnail() ? get_the_post_thumbnail( $post->ID, 'medium' ) : '<img src="'.$default_image.'">'; ?>
494
+							<?php echo has_post_thumbnail() ? get_the_post_thumbnail($post->ID, 'medium') : '<img src="'.$default_image.'">'; ?>
495 495
 
496 496
 						</div>
497 497
 						<div id="lasso--featImgSave"><a href="#" class="not-visible">Save</a></div>
@@ -501,15 +501,15 @@  discard block
 block discarded – undo
501 501
 
502 502
 					<div class="lasso--postsettings__right">
503 503
 
504
-						<?php if( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ): ?>
504
+						<?php if (lasso_user_can('publish_posts') || lasso_user_can('publish_pages')): ?>
505 505
 						<div class="lasso--postsettings__option story-status-option">
506
-							<label><?php _e( 'Status', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Change the status of the post to draft or publish.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label>
507
-							<ul class="story-status story-status-<?php echo sanitize_html_class( $status );?>">
508
-								<li id="lasso--status-draft"><?php _e( 'Draft', 'lasso' );?></li>
509
-								<?php if( !$no_pending_status ): ?>								
510
-								<li id="lasso--status-pending"><?php _e( 'Pending', 'lasso' );?></li>
506
+							<label><?php _e('Status', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Change the status of the post to draft or publish.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label>
507
+							<ul class="story-status story-status-<?php echo sanitize_html_class($status); ?>">
508
+								<li id="lasso--status-draft"><?php _e('Draft', 'lasso'); ?></li>
509
+								<?php if (!$no_pending_status): ?>								
510
+								<li id="lasso--status-pending"><?php _e('Pending', 'lasso'); ?></li>
511 511
 								<?php endif; ?>
512
-								<li id="lasso--status-publish"><?php _e( 'Publish', 'lasso' );?></li>
512
+								<li id="lasso--status-publish"><?php _e('Publish', 'lasso'); ?></li>
513 513
 							</ul>
514 514
 							<div class="lasso--slider_wrap">
515 515
 								<div id="lasso--slider"></div>
@@ -517,10 +517,10 @@  discard block
 block discarded – undo
517 517
 						</div>
518 518
 						<?php endif; ?>
519 519
 
520
-						<?php if ( 'publish' == $status  && !$no_url_setting): ?>
520
+						<?php if ('publish' == $status && !$no_url_setting): ?>
521 521
 						<div class="lasso--postsettings__option story-slug-option">
522
-							<label><?php _e( 'Post URL', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Change the URL (slug) of this post.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label>
523
-							<input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset( $post ) ? esc_attr( $post->post_name ) : false;?>">
522
+							<label><?php _e('Post URL', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Change the URL (slug) of this post.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label>
523
+							<input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset($post) ? esc_attr($post->post_name) : false; ?>">
524 524
 						</div>
525 525
 						<?php endif; ?>
526 526
 
@@ -529,30 +529,30 @@  discard block
 block discarded – undo
529 529
 					<div class="lasso--postsettings__middle">
530 530
 
531 531
 						<div class="lasso--postsettings__option story-categories-option">
532
-							<label style="width:120px;"><?php _e( 'Categories', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Type a category name and press enter.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label>
533
-							<input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories;?>">
532
+							<label style="width:120px;"><?php _e('Categories', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Type a category name and press enter.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label>
533
+							<input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories; ?>">
534 534
 						</div>
535 535
 
536 536
 						<div class="lasso--postsettings__option story-tags-option">
537
-							<label><?php _e( 'Tags', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Type a tag name and press enter.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label>
538
-							<input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags;?>">
537
+							<label><?php _e('Tags', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Type a tag name and press enter.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label>
538
+							<input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags; ?>">
539 539
 						</div>
540 540
                         <?php 
541 541
 						if ($allow_edit_excerpt) { 
542 542
 						?>
543 543
                         <div class="lasso--postsettings__option story-excerpt-option">
544
-							<label><?php _e( 'Excerpt', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Edit excerpt', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label>
545
-							<input id="lasso--excerpt" class="lasso--modal__trigger-footer" type="text" name="excerpt" value="<?php echo $excerpt;?>" style="width:100%">
544
+							<label><?php _e('Excerpt', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Edit excerpt', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label>
545
+							<input id="lasso--excerpt" class="lasso--modal__trigger-footer" type="text" name="excerpt" value="<?php echo $excerpt; ?>" style="width:100%">
546 546
 						</div>
547 547
                         <?php
548 548
 						}?>
549 549
 						<?php 
550 550
 						if ($allow_change_date) { 
551
-						    $dateformat = get_option( 'date_format' ); 
551
+						    $dateformat = get_option('date_format'); 
552 552
 						?>
553
-						    <label><?php _e( 'Post Date', 'lasso' ); ?></label>
554
-							<input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/>
555
-							<a href="#" id="lasso--postsettings-setnow"><?php _e( 'Set to Now', 'lasso' ); ?></a>
553
+						    <label><?php _e('Post Date', 'lasso'); ?></label>
554
+							<input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid); ?>"/>
555
+							<a href="#" id="lasso--postsettings-setnow"><?php _e('Set to Now', 'lasso'); ?></a>
556 556
 						<?php
557 557
 						}?>
558 558
 
@@ -574,23 +574,23 @@  discard block
 block discarded – undo
574 574
 					?>
575 575
 					<!--/div-->
576 576
 
577
-					<?php do_action( 'lasso_modal_post_form' ); // action ?>
577
+					<?php do_action('lasso_modal_post_form'); // action ?>
578 578
 
579 579
 					<div class="lasso--postsettings__footer" >
580
-						<a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a>
580
+						<a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a>
581 581
 						<input type="hidden" name="status" value="">
582 582
 						<input type="hidden" name="categories" value="">
583
-						<input type="hidden" name="postid" value="<?php echo get_the_ID();?>">
583
+						<input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>">
584 584
 						<input type="hidden" name="action" value="process_update-object_post">
585
-						<input type="hidden" name="nonce" value="<?php echo $nonce;?>">
586
-						<?php do_action( 'lasso_modal_post_form_footer' ); // action ?>
587
-						<input type="submit" id="lasso--postsettings-submit" value="<?php esc_attr_e( 'Save', 'lasso' );?>">
585
+						<input type="hidden" name="nonce" value="<?php echo $nonce; ?>">
586
+						<?php do_action('lasso_modal_post_form_footer'); // action ?>
587
+						<input type="submit" id="lasso--postsettings-submit" value="<?php esc_attr_e('Save', 'lasso'); ?>">
588 588
 					</div>
589 589
 
590 590
 				</form>
591 591
 			</div>
592 592
 
593
-			<?php if( $tabs ) { echo $content; } ?>
593
+			<?php if ($tabs) { echo $content; } ?>
594 594
 
595 595
 		</div>
596 596
 
@@ -612,41 +612,41 @@  discard block
 block discarded – undo
612 612
 	ob_start();
613 613
 
614 614
 
615
-	$status = get_post_status( get_the_ID() );
615
+	$status = get_post_status(get_the_ID());
616 616
 
617
-	$nonce = wp_create_nonce( 'lasso-editor-new-post' );
617
+	$nonce = wp_create_nonce('lasso-editor-new-post');
618 618
 
619 619
 	// let users add custom css classes
620
-	$custom_classes = apply_filters( 'lasso_modal_post_classes', '' );
620
+	$custom_classes = apply_filters('lasso_modal_post_classes', '');
621 621
 
622 622
 	// return the post type
623
-	$type = get_post_type( get_the_ID() );
623
+	$type = get_post_type(get_the_ID());
624 624
 
625 625
 	$mobile_style = "";
626 626
 	if (wp_is_mobile()) {
627 627
 		//$mobile_style = 'style="top:140px !important;"';
628 628
 	}
629 629
 	?>
630
-	<div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style;?>">
630
+	<div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" <?php echo $mobile_style; ?>">
631 631
 		<div class="lasso--modal__inner lasso--hasnewform">
632 632
 
633 633
 			<form id="lasso--postnew__form" enctype="multipart/form-data" class="lasso--post-form">
634 634
 
635 635
 				<div class="lasso--postsettings__option story-slug-option lasso--last-option">
636
-					<label><?php esc_attr_e( 'New <span>post</span> title', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Specify title for new post, then save to edit.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label>
637
-					<input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e( 'Type Your Title Here', 'lasso' );?>">
636
+					<label><?php esc_attr_e('New <span>post</span> title', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Specify title for new post, then save to edit.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label>
637
+					<input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e('Type Your Title Here', 'lasso'); ?>">
638 638
 						<div class="lasso--select-wrap" style="width:90px">
639 639
 						<select id="lasso--select-type" name="story_type">
640 640
 
641 641
 							<?php
642 642
 								$types = lasso_post_types_names();
643
-								if ( !empty( $types ) ) {
644
-									foreach( $types as $name => $label ) {										
645
-										$type = preg_replace( '/s\b/','', $name );
643
+								if (!empty($types)) {
644
+									foreach ($types as $name => $label) {										
645
+										$type = preg_replace('/s\b/', '', $name);
646 646
 										if ($type == 'page' && !current_user_can('edit_pages')) {
647 647
 											continue;
648 648
 										}
649
-										printf( '<option value="%s">%s</option>', lcfirst( esc_attr( $type ) ) , ucfirst( esc_attr( $label ) ) );
649
+										printf('<option value="%s">%s</option>', lcfirst(esc_attr($type)), ucfirst(esc_attr($label)));
650 650
 									}
651 651
 
652 652
 								}
@@ -657,19 +657,19 @@  discard block
 block discarded – undo
657 657
 				</div>
658 658
 
659 659
 				<div class="lasso--postsettings__footer">
660
-					<a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a>
660
+					<a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a>
661 661
 					<input type="hidden" name="action" value="process_new-object_post">
662 662
 					<?php
663
-						if ( !empty( $types ) ) {
663
+						if (!empty($types)) {
664 664
 							// get the first element
665 665
 							$keys = array_keys($types);
666
-						    $type =$keys[0];						
667
-							$type = preg_replace( '/s\b/','', $type );
668
-							printf( '<input type="hidden" name="object" value="%s">', lcfirst( esc_attr( $type ) ) );		
666
+						    $type = $keys[0];						
667
+							$type = preg_replace('/s\b/', '', $type);
668
+							printf('<input type="hidden" name="object" value="%s">', lcfirst(esc_attr($type)));		
669 669
 						}
670 670
 					?>
671
-					<input type="hidden" name="nonce" value="<?php echo $nonce;?>">
672
-					<input type="submit" value="<?php esc_attr_e( 'Create', 'lasso' );?>">
671
+					<input type="hidden" name="nonce" value="<?php echo $nonce; ?>">
672
+					<input type="submit" value="<?php esc_attr_e('Create', 'lasso'); ?>">
673 673
 				</div>
674 674
 
675 675
 			</form>
@@ -697,18 +697,18 @@  discard block
 block discarded – undo
697 697
 	ob_start();
698 698
 
699 699
 	// post status
700
-	$status = get_post_status( get_the_ID() );
700
+	$status = get_post_status(get_the_ID());
701 701
 
702 702
 	// let users add custom css classes
703
-	$custom_classes = apply_filters( 'lasso_modal_all_post_classes', '' );
703
+	$custom_classes = apply_filters('lasso_modal_all_post_classes', '');
704 704
 
705 705
 	?>
706
-	<div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" style="max-height:100%">
706
+	<div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" style="max-height:100%">
707 707
 		<div class="lasso--modal__inner">
708 708
 
709 709
 			<div class="lasso--post-filtering not-visible">
710 710
 				<div class="lasso--search__results">
711
-					<span id="lasso--results-found"></span><?php _e('results found','lasso');?>
711
+					<span id="lasso--results-found"></span><?php _e('results found', 'lasso'); ?>
712 712
 				</div>
713 713
 				<div class="lasso--search">
714 714
 					<i id="lasso--search__toggle" class="dashicons dashicons-search"></i>
@@ -722,18 +722,18 @@  discard block
 block discarded – undo
722 722
 				$post_types = lasso_post_types_names();
723 723
 				$rest_bases = lasso_post_types_rest_base();
724 724
 
725
-				if ( ! empty( $post_types ) ) {
725
+				if (!empty($post_types)) {
726 726
 					$first = 'active';
727
-					foreach( $post_types as $name => $label ) {
727
+					foreach ($post_types as $name => $label) {
728 728
 						if (array_key_exists($name, $rest_bases)) {
729
-							printf( '<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr( $first), esc_attr( $rest_bases[$name] ), esc_attr( $label ) );
729
+							printf('<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr($first), esc_attr($rest_bases[$name]), esc_attr($label));
730 730
 						}
731 731
 						$first = '';
732 732
 					}
733 733
 
734 734
 				}
735 735
 
736
-				do_action('lasso_modal_post_objects');?>
736
+				do_action('lasso_modal_post_objects'); ?>
737 737
 
738 738
 			</ul>
739 739
 			<div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div>
@@ -753,15 +753,15 @@  discard block
 block discarded – undo
753 753
 
754 754
 
755 755
 	// let users add custom css classes
756
-	$custom_classes = apply_filters( 'lasso_wpimg_classes', '' );
756
+	$custom_classes = apply_filters('lasso_wpimg_classes', '');
757 757
 
758 758
 	?>
759
-	<ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false">
760
-		<li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li>
761
-		<!--li id="lasso--wpimg-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li-->
762
-        <li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li>
763
-		<li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li>
764
-		<li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li>
759
+	<ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false">
760
+		<li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li>
761
+		<!--li id="lasso--wpimg-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li-->
762
+        <li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li>
763
+		<li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li>
764
+		<li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li>
765 765
 	</ul>
766 766
 
767 767
 	<?php return ob_get_clean();
@@ -773,14 +773,14 @@  discard block
 block discarded – undo
773 773
 
774 774
 
775 775
 	// let users add custom css classes
776
-	$custom_classes = apply_filters( 'lasso_wpimg_classes', '' );
776
+	$custom_classes = apply_filters('lasso_wpimg_classes', '');
777 777
 
778 778
 	?>
779
-	<ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false">
780
-		<li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li>
781
-		<li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li>
782
-		<li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li>
783
-		<li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li>
779
+	<ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false">
780
+		<li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li>
781
+		<li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li>
782
+		<li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li>
783
+		<li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li>
784 784
 	</ul>
785 785
 
786 786
 	<?php return ob_get_clean();
@@ -793,16 +793,16 @@  discard block
 block discarded – undo
793 793
  */
794 794
 function lasso_map_form_footer() {
795 795
 
796
-	$nonce = wp_create_nonce( 'lasso-process-map' );
796
+	$nonce = wp_create_nonce('lasso-process-map');
797 797
 
798 798
 	ob_start();
799 799
 
800 800
 	?>
801 801
 	<div class="lasso--map-form__footer">
802
-		<input type="hidden" name="postid" value="<?php echo get_the_ID();?>">
803
-		<input type="hidden" name="nonce" value="<?php echo $nonce;?>">
802
+		<input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>">
803
+		<input type="hidden" name="nonce" value="<?php echo $nonce; ?>">
804 804
 		<input type="hidden" name="action" value="process_map_save">
805
-		<input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e( 'Save Locations', 'lasso' );?>">
805
+		<input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e('Save Locations', 'lasso'); ?>">
806 806
 	</div>
807 807
 
808 808
 	<?php return ob_get_clean();
@@ -820,7 +820,7 @@  discard block
 block discarded – undo
820 820
 
821 821
 	?>
822 822
 	<div id="lasso--pagerefresh" class="visible">
823
-		<?php _e( 'Save this post and refesh the page to see these changes.', 'lasso' );?>
823
+		<?php _e('Save this post and refesh the page to see these changes.', 'lasso'); ?>
824 824
 	</div>
825 825
 
826 826
 	<?php return ob_get_clean();
@@ -834,45 +834,45 @@  discard block
 block discarded – undo
834 834
  */
835 835
 function lasso_editor_options_blob() {
836 836
 
837
-	$codes   = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : array();
838
-    $codes   = add_wpimg_options( array() );
839
-    $codes   = apply_filters( 'lasso_custom_options', $codes );
840
-	$galleries  = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery';
837
+	$codes = function_exists('aesop_shortcodes') ? aesop_shortcodes() : array();
838
+    $codes   = add_wpimg_options(array());
839
+    $codes   = apply_filters('lasso_custom_options', $codes);
840
+	$galleries  = function_exists('lasso_editor_galleries_exist') && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery';
841 841
 
842
-	$nonce = wp_create_nonce( 'lasso_gallery' );
842
+	$nonce = wp_create_nonce('lasso_gallery');
843 843
 
844 844
 	$blob = array();
845 845
 
846
-	if ( empty( $codes ) )
846
+	if (empty($codes))
847 847
 		return;
848 848
 
849
-	foreach ( $codes as $slug => $shortcode ) {
849
+	foreach ($codes as $slug => $shortcode) {
850 850
 		$return = '';
851 851
 		// Shortcode has atts
852 852
 
853
-		if ( count( $shortcode['atts'] ) && $shortcode['atts'] ) {
853
+		if (count($shortcode['atts']) && $shortcode['atts']) {
854 854
 
855
-			foreach ( $shortcode['atts'] as $attr_name => $attr_info ) {
855
+			foreach ($shortcode['atts'] as $attr_name => $attr_info) {
856 856
 
857 857
 
858
-				$prefix = isset( $attr_info['prefix'] ) ? sprintf( '<span class="lasso-option-prefix">%s</span>', $attr_info['prefix'] ) : null;
858
+				$prefix = isset($attr_info['prefix']) ? sprintf('<span class="lasso-option-prefix">%s</span>', $attr_info['prefix']) : null;
859 859
 
860 860
 				$return .= '<form id="aesop-generator-settings" class="lasso--component-settings-form" class="'.$galleries.'" method="post">';
861 861
 				$return .= '<p data-option="'.$attr_name.'" class="lasso-option aesop-'.$slug.'-'.$attr_name.'">';
862
-				$return .= '<label for="aesop-generator-attr-' . $attr_name . '">' . $attr_info['desc'] . '</label>';
862
+				$return .= '<label for="aesop-generator-attr-'.$attr_name.'">'.$attr_info['desc'].'</label>';
863 863
 				$return .= '<small class="lasso-option-desc">'.$attr_info['tip'].'</small>';
864 864
 				// Select
865 865
 
866
-				if ( isset( $attr_info['values'] ) ) {
866
+				if (isset($attr_info['values'])) {
867 867
 
868
-					$return .= '<select name="' . $attr_name . '" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr">';
868
+					$return .= '<select name="'.$attr_name.'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr">';
869 869
 
870
-					$i=0;
870
+					$i = 0;
871 871
 
872
-					foreach ( $attr_info['values'] as $attr_value ) {
872
+					foreach ($attr_info['values'] as $attr_value) {
873 873
 						$attr_value_selected = $attr_info['default'] == $attr_value ? ' selected="selected"' : '';
874 874
 
875
-						$return .= '<option value="'.$attr_info['values'][$i]['value'].'" ' . $attr_value_selected . '>'.$attr_info['values'][$i]['name'].'</option>';
875
+						$return .= '<option value="'.$attr_info['values'][$i]['value'].'" '.$attr_value_selected.'>'.$attr_info['values'][$i]['name'].'</option>';
876 876
 
877 877
 						$i++;
878 878
 					}
@@ -881,24 +881,24 @@  discard block
 block discarded – undo
881 881
 
882 882
 				} else {
883 883
 
884
-					$attr_field_type = isset( $attr_info['type'] ) ? $attr_info['type'] : 'text';
884
+					$attr_field_type = isset($attr_info['type']) ? $attr_info['type'] : 'text';
885 885
 
886 886
 					// image upload
887
-					if ( 'media_upload' == $attr_info['type'] ) {
887
+					if ('media_upload' == $attr_info['type']) {
888 888
 
889
-						$return .= '<input type="' . $attr_field_type . '" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />';
889
+						$return .= '<input type="'.$attr_field_type.'" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />';
890 890
 						$return .= '<a href="#" id="lasso-upload-img" class="lasso-option-button" /></a>';
891 891
 
892
-					} elseif ( 'color' == $attr_info['type'] ) {
892
+					} elseif ('color' == $attr_info['type']) {
893 893
 
894
-						$return .= '<input type="color" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />';
894
+						$return .= '<input type="color" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />';
895 895
 
896
-					} elseif ( 'text_area' == $attr_info['type'] ) {
896
+					} elseif ('text_area' == $attr_info['type']) {
897 897
 
898
-						$return .= '<textarea name="' . $attr_name . '" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" placeholder="'.$attr_info['default'].'" /></textarea>'.$prefix.'';
898
+						$return .= '<textarea name="'.$attr_name.'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" placeholder="'.$attr_info['default'].'" /></textarea>'.$prefix.'';
899 899
 
900 900
 					} else {
901
-						$return .= '<input type="' . $attr_field_type . '" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'.$prefix.'';
901
+						$return .= '<input type="'.$attr_field_type.'" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'.$prefix.'';
902 902
 					}
903 903
 				}
904 904
 				$return .= '</p>';
@@ -909,9 +909,9 @@  discard block
 block discarded – undo
909 909
 		///////////////////////////
910 910
 		// START GALLERY AND MAP FRONT END STUFFS
911 911
 		///////////////////////////
912
-		if ( isset( $shortcode['front'] ) && true == $shortcode['front'] ) {
912
+		if (isset($shortcode['front']) && true == $shortcode['front']) {
913 913
 
914
-			if ( 'gallery' == $shortcode['front_type'] ) {
914
+			if ('gallery' == $shortcode['front_type']) {
915 915
 
916 916
 				$return .= lasso_gallery_editor_module();
917 917
 
@@ -922,13 +922,13 @@  discard block
 block discarded – undo
922 922
 		///////////////////////////
923 923
 
924 924
 		// Single shortcode (not closed)
925
-		if ( 'single' == $shortcode['type'] ) {
925
+		if ('single' == $shortcode['type']) {
926 926
 
927 927
 			$return .= '<input type="hidden" name="lasso-generator-content" id="lasso-generator-content" value="false" />';
928 928
 
929 929
 		} else {
930 930
 
931
-			$return .= '<p data-option="content" class="lasso-option lasso-c-comp-text"><label>' . __( 'Content', 'lasso' ) . '</label><textarea type="text" name="lasso-generator-content" id="lasso-generator-content" value="' . $shortcode['content'] . '" /></textarea></p>';
931
+			$return .= '<p data-option="content" class="lasso-option lasso-c-comp-text"><label>'.__('Content', 'lasso').'</label><textarea type="text" name="lasso-generator-content" id="lasso-generator-content" value="'.$shortcode['content'].'" /></textarea></p>';
932 932
 		}
933 933
 
934 934
 		$return .= '<p class="lasso-buttoninsert-wrap"><a href="#" class="lasso-generator-cancel" id="lasso--sidebar__close">Cancel</a><input type="submit" id="lasso-generator-insert" value="Save Settings"></p>';
@@ -948,61 +948,61 @@  discard block
 block discarded – undo
948 948
 }
949 949
 
950 950
 
951
-function add_wpimg_options( $shortcodes ) {
951
+function add_wpimg_options($shortcodes) {
952 952
 
953 953
     $custom = array(
954 954
         'wpimg'    => array(
955
-            'name'     => __( 'Image', 'lasso' ),
955
+            'name'     => __('Image', 'lasso'),
956 956
             'type'     => 'single',
957 957
             'atts'     => array(
958 958
                 'img'    => array(
959 959
                     'type'  => 'media_upload',
960 960
                     'default'  => '',
961
-                    'desc'   => __( 'Image URL', 'lasso' ),
962
-                    'tip'  => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' )
961
+                    'desc'   => __('Image URL', 'lasso'),
962
+                    'tip'  => __('URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core')
963 963
                 ),
964 964
                 
965 965
                 'imgwidth'    => array(
966 966
                     'type'  => 'text_small',
967 967
                     'default'  => '300px',
968
-                    'desc'   => __( 'Image Width', 'lasso' ),
969
-                    'tip'  => __( 'Width of the image. You can enter the size in pixels or percentage such as <code>40%</code> or <code>500px</code>.', 'aesop-core' )
968
+                    'desc'   => __('Image Width', 'lasso'),
969
+                    'tip'  => __('Width of the image. You can enter the size in pixels or percentage such as <code>40%</code> or <code>500px</code>.', 'aesop-core')
970 970
                 ),
971 971
                 'imgheight'    => array(
972 972
                     'type'  => 'text_small',
973 973
                     'default'  => '',
974
-                    'desc'   => __( 'Image Height', 'lasso' ),
975
-                    'tip'  => __( 'Used only for the Panorama mode. Can be set using pixel values such as <code>500px</code>. If unspecified, the original height would be used. ', 'aesop-core' )
974
+                    'desc'   => __('Image Height', 'lasso'),
975
+                    'tip'  => __('Used only for the Panorama mode. Can be set using pixel values such as <code>500px</code>. If unspecified, the original height would be used. ', 'aesop-core')
976 976
                 ),					
977 977
                 
978 978
                 'link'    => array(
979 979
                     'type'  => 'text',
980 980
                     'default'  => '',
981
-                    'desc'   => __( 'Link', 'lasso' ),
982
-                    'tip'  => __( 'URL link', 'lasso' )
981
+                    'desc'   => __('Link', 'lasso'),
982
+                    'tip'  => __('URL link', 'lasso')
983 983
                 ),
984 984
                 'alt'    => array(
985 985
                     'type'  => 'text',
986 986
                     'default'  => '',
987
-                    'desc'   => __( 'Image ALT', 'lasso' ),
988
-                    'tip'  => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' )
987
+                    'desc'   => __('Image ALT', 'lasso'),
988
+                    'tip'  => __('ALT tag used for the image. Primarily used for SEO purposes.', 'lasso')
989 989
                 ),
990 990
                 
991 991
                 'caption'    => array(
992 992
                     'type'  => 'text_area',
993 993
                     'default'  => '',
994
-                    'desc'   => __( 'Caption', 'lasso' ),
995
-                    'tip'  => __( 'Optional caption for the image.', 'lasso' )
994
+                    'desc'   => __('Caption', 'lasso'),
995
+                    'tip'  => __('Optional caption for the image.', 'lasso')
996 996
                 ),
997 997
                 
998 998
 
999 999
             ),
1000
-            'desc'     => __( 'An image.', 'aesop-core' ),
1000
+            'desc'     => __('An image.', 'aesop-core'),
1001 1001
             'codes'    => ''
1002 1002
         )
1003 1003
     );
1004 1004
 
1005
-    return array_merge( $shortcodes, $custom );
1005
+    return array_merge($shortcodes, $custom);
1006 1006
 }
1007 1007
 
1008 1008
 /**
@@ -1022,14 +1022,14 @@  discard block
 block discarded – undo
1022 1022
 				<div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div>
1023 1023
 				<div id="lasso--hide" style="display:none;" class="lasso--post-form">
1024 1024
 					<i class="lasso-icon lasso-icon-move"></i>
1025
-					<label><?php _e( 'Revisions', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Use the slider to view the revision live on the page.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label>
1025
+					<label><?php _e('Revisions', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Use the slider to view the revision live on the page.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label>
1026 1026
 					<div class="lasso--slider_wrap">
1027 1027
 						<div id="lasso--slider"></div>
1028 1028
 					</div>
1029 1029
 					<ul id="lasso--revision-list"></ul>
1030 1030
 					<div class="lasso--btn-group lasso--btn-group-small">
1031
-						<a href="#" class="lasso--btn-secondary" id="lasso--close-modal"><?php _e( 'Cancel', 'lasso' );?></a>
1032
-						<a href="#" class="lasso--btn-primary" id="lasso--select-revision"><?php _e( 'Select', 'lasso' );?></a>
1031
+						<a href="#" class="lasso--btn-secondary" id="lasso--close-modal"><?php _e('Cancel', 'lasso'); ?></a>
1032
+						<a href="#" class="lasso--btn-primary" id="lasso--select-revision"><?php _e('Select', 'lasso'); ?></a>
1033 1033
 					</div>
1034 1034
 				</div>
1035 1035
 
@@ -1052,7 +1052,7 @@  discard block
 block discarded – undo
1052 1052
     // Normalize into a six character long hex string
1053 1053
     $hex = str_replace('#', '', $hex);
1054 1054
     if (strlen($hex) == 3) {
1055
-        $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2);
1055
+        $hex = str_repeat(substr($hex, 0, 1), 2).str_repeat(substr($hex, 1, 1), 2).str_repeat(substr($hex, 2, 1), 2);
1056 1056
     }
1057 1057
 
1058 1058
     // Split into three parts: R, G and B
@@ -1061,7 +1061,7 @@  discard block
 block discarded – undo
1061 1061
 
1062 1062
     foreach ($color_parts as $color) {
1063 1063
         $color   = hexdec($color); // Convert to decimal
1064
-        $color   = max(0,min(255,$color + $steps)); // Adjust color
1064
+        $color   = max(0, min(255, $color + $steps)); // Adjust color
1065 1065
         $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code
1066 1066
     }
1067 1067
 
Please login to merge, or discard this patch.
admin/includes/menus/settings.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 		$edit_post_disabled  = lasso_editor_get_option( 'post_edit_disabled', 'lasso_editor' );
108 108
 		$post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' );
109 109
 		$allow_change_date = lasso_editor_get_option( 'allow_change_date', 'lasso_editor' );
110
-        $allow_edit_excerpt = lasso_editor_get_option( 'allow_edit_excerpt', 'lasso_editor' );
110
+		$allow_edit_excerpt = lasso_editor_get_option( 'allow_edit_excerpt', 'lasso_editor' );
111 111
 		$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
112 112
 		$shortcodify_disabled  = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' );
113 113
 		$enable_autosave  = lasso_editor_get_option( 'enable_autosave', 'lasso_editor' );
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 		$bold_tag = lasso_editor_get_option( 'bold_tag', 'lasso_editor',  "b");
133 133
 		$i_tag = lasso_editor_get_option( 'i_tag', 'lasso_editor',  "i");
134 134
         
135
-        $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
135
+		$add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
136 136
 		
137 137
 		// do we support pending status
138 138
 		$no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor');
Please login to merge, or discard this patch.
Spacing   +158 added lines, -158 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@  discard block
 block discarded – undo
9 9
 
10 10
 	function __construct() {
11 11
 
12
-		add_action( 'admin_menu',     array( $this, 'menu' ) );
13
-		add_action( 'network_admin_menu',   array( $this, 'menu' ) );
14
-		add_action( 'wp_ajax_lasso-editor-settings', array( $this, 'process_settings' ) );
12
+		add_action('admin_menu', array($this, 'menu'));
13
+		add_action('network_admin_menu', array($this, 'menu'));
14
+		add_action('wp_ajax_lasso-editor-settings', array($this, 'process_settings'));
15 15
 
16 16
 	}
17 17
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	function menu() {
24 24
 
25 25
 		// CHANGED Removed condition.
26
-		add_submenu_page( 'lasso-editor', __( 'Settings', 'lasso' ), __( 'Settings', 'lasso' ), 'manage_options', 'lasso-editor-settings', array( $this, 'settings' ) );
26
+		add_submenu_page('lasso-editor', __('Settings', 'lasso'), __('Settings', 'lasso'), 'manage_options', 'lasso-editor-settings', array($this, 'settings'));
27 27
 
28 28
 	}
29 29
 
@@ -45,26 +45,26 @@  discard block
 block discarded – undo
45 45
 	function process_settings() {
46 46
 
47 47
 		// bail out if current user isn't and administrator and they are not logged in
48
-		if ( !current_user_can( 'manage_options' ) || !is_user_logged_in() )
48
+		if (!current_user_can('manage_options') || !is_user_logged_in())
49 49
 			return;
50 50
 
51
-		if ( isset( $_POST['action'] ) && 'lasso-editor-settings' == $_POST['action'] && check_admin_referer( 'nonce', 'lasso_editor_settings' ) ) {
51
+		if (isset($_POST['action']) && 'lasso-editor-settings' == $_POST['action'] && check_admin_referer('nonce', 'lasso_editor_settings')) {
52 52
 
53
-			$options = isset( $_POST['lasso_editor'] ) ? $_POST['lasso_editor'] : false;
53
+			$options = isset($_POST['lasso_editor']) ? $_POST['lasso_editor'] : false;
54 54
 			
55 55
 			$arr = $options['allowed_post_types'];
56
-			$options = array_map( 'sanitize_text_field', $options );
57
-			$options['allowed_post_types'] = array_keys( $arr);
56
+			$options = array_map('sanitize_text_field', $options);
57
+			$options['allowed_post_types'] = array_keys($arr);
58 58
 
59 59
 			
60 60
 
61
-			if ( function_exists( 'is_multisite' ) && is_multisite() ) {
61
+			if (function_exists('is_multisite') && is_multisite()) {
62 62
 
63
-				update_site_option( 'lasso_editor', $options );
63
+				update_site_option('lasso_editor', $options);
64 64
 
65 65
 			} else {
66 66
 
67
-				update_option( 'lasso_editor', $options );
67
+				update_option('lasso_editor', $options);
68 68
 			}
69 69
 
70 70
 			wp_send_json_success();
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 	}
81 81
 	
82 82
 	function create_section_for_color_picker($id, $title, $defvalue) { 
83
-		$color_value = lasso_editor_get_option( $id, 'lasso_editor',$defvalue );
83
+		$color_value = lasso_editor_get_option($id, 'lasso_editor', $defvalue);
84 84
 	 
85 85
 		echo '<div lass="lasso-editor-settings--option-inner">'."\n";
86 86
 		echo '<label>'.$title.'</label>';
@@ -95,42 +95,42 @@  discard block
 block discarded – undo
95 95
 	 */
96 96
 	function lasso_editor_settings_form() {
97 97
 
98
-		if ( !is_user_logged_in() )
98
+		if (!is_user_logged_in())
99 99
 			return;
100 100
 
101
-		$article_object   = lasso_editor_get_option( 'article_class', 'lasso_editor' );
102
-		$featImgClass    = lasso_editor_get_option( 'featimg_class', 'lasso_editor' );
103
-		$titleClass    = lasso_editor_get_option( 'title_class', 'lasso_editor' );
104
-
105
-		$post_new_disabled   = lasso_editor_get_option( 'post_adding_disabled', 'lasso_editor' );
106
-		$save_to_post_disabled  = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' );
107
-		$edit_post_disabled  = lasso_editor_get_option( 'post_edit_disabled', 'lasso_editor' );
108
-		$post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' );
109
-		$allow_change_date = lasso_editor_get_option( 'allow_change_date', 'lasso_editor' );
110
-        $allow_edit_excerpt = lasso_editor_get_option( 'allow_edit_excerpt', 'lasso_editor' );
111
-		$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
112
-		$shortcodify_disabled  = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' );
113
-		$enable_autosave  = lasso_editor_get_option( 'enable_autosave', 'lasso_editor' );
114
-
115
-		$use_old_ui      = lasso_editor_get_option( 'use_old_ui', 'lasso_editor' );
116
-		$toolbar_headings      = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' );
117
-		$toolbar_headings_h4      = lasso_editor_get_option( 'toolbar_headings_h4', 'lasso_editor' );
118
-		$toolbar_list      = lasso_editor_get_option( 'toolbar_list', 'lasso_editor' );
119
-		$toolbar_show_color      = lasso_editor_get_option( 'toolbar_show_color', 'lasso_editor' );
120
-		$toolbar_show_alignment  = lasso_editor_get_option( 'toolbar_show_alignment', 'lasso_editor' );
101
+		$article_object = lasso_editor_get_option('article_class', 'lasso_editor');
102
+		$featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor');
103
+		$titleClass = lasso_editor_get_option('title_class', 'lasso_editor');
104
+
105
+		$post_new_disabled   = lasso_editor_get_option('post_adding_disabled', 'lasso_editor');
106
+		$save_to_post_disabled  = lasso_editor_get_option('post_save_disabled', 'lasso_editor');
107
+		$edit_post_disabled  = lasso_editor_get_option('post_edit_disabled', 'lasso_editor');
108
+		$post_settings_disabled = lasso_editor_get_option('post_settings_disabled', 'lasso_editor');
109
+		$allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor');
110
+        $allow_edit_excerpt = lasso_editor_get_option('allow_edit_excerpt', 'lasso_editor');
111
+		$allow_new_category = lasso_editor_get_option('allow_new_category', 'lasso_editor');
112
+		$shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor');
113
+		$enable_autosave = lasso_editor_get_option('enable_autosave', 'lasso_editor');
114
+
115
+		$use_old_ui = lasso_editor_get_option('use_old_ui', 'lasso_editor');
116
+		$toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor');
117
+		$toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
118
+		$toolbar_list = lasso_editor_get_option('toolbar_list', 'lasso_editor');
119
+		$toolbar_show_color      = lasso_editor_get_option('toolbar_show_color', 'lasso_editor');
120
+		$toolbar_show_alignment  = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor');
121 121
 		
122
-		$objectsNoSave  	= lasso_editor_get_option('dont_save', 'lasso_editor');
123
-		$objectsNonEditable  	= lasso_editor_get_option('non_editable', 'lasso_editor');
122
+		$objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor');
123
+		$objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor');
124 124
 		$disable_tour = lasso_editor_get_option('disable_tour', 'lasso_editor');
125 125
 		$show_ignored_items = lasso_editor_get_option('show_ignored_items', 'lasso_editor');
126 126
 		$save_using_rest_disabled = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor');
127 127
 		
128
-		$default_post_types = apply_filters( 'lasso_allowed_post_types', array( 'post', 'page'));
129
-		$allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor',  $default_post_types);
128
+		$default_post_types = apply_filters('lasso_allowed_post_types', array('post', 'page'));
129
+		$allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', $default_post_types);
130 130
 		
131 131
 		$links_editable = lasso_editor_get_option('links_editable', 'lasso_editor', false);
132
-		$bold_tag = lasso_editor_get_option( 'bold_tag', 'lasso_editor',  "b");
133
-		$i_tag = lasso_editor_get_option( 'i_tag', 'lasso_editor',  "i");
132
+		$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor', "b");
133
+		$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor', "i");
134 134
         
135 135
         $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
136 136
 		
@@ -147,31 +147,31 @@  discard block
 block discarded – undo
147 147
 ?>
148 148
 		<div class="wrap">
149 149
 
150
-	    	<h2><?php _e( 'Editus Settings', 'lasso' );?></h2>
150
+	    	<h2><?php _e('Editus Settings', 'lasso'); ?></h2>
151 151
 
152 152
 			<form id="lasso-editor-settings-form" class="lasso--form-settings" method="post" enctype="multipart/form-data">
153 153
 
154
-				<?php do_action('lasso_settings_before');?>
154
+				<?php do_action('lasso_settings_before'); ?>
155 155
 				
156 156
 				
157 157
 				
158
-				<h3><?php _e( 'Enable for:', 'lasso' );?></h3>
158
+				<h3><?php _e('Enable for:', 'lasso'); ?></h3>
159 159
 				<div class="lasso-editor-settings--option-wrap">
160 160
 					<div class="lasso-editor-settings--option-inner">
161 161
 						
162
-						<span class="lasso--setting-description"><?php _e( 'Enable Editus for the following post types.', 'lasso' );?></span>
162
+						<span class="lasso--setting-description"><?php _e('Enable Editus for the following post types.', 'lasso'); ?></span>
163 163
 						<?php
164 164
 						$args = array(
165 165
 							'public'   => true
166 166
 						);
167 167
 						 
168
-						$allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
169
-						$post_types = get_post_types( $args, 'objects' );
168
+						$allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types);
169
+						$post_types = get_post_types($args, 'objects');
170 170
 						 
171
-						foreach ( $post_types  as $post_type ) {
171
+						foreach ($post_types  as $post_type) {
172 172
 						   if ($post_type->name == 'attachment') continue;
173
-						   $checked ="";
174
-						   if (  in_array( $post_type->name, $allowed_post_types )  ) {
173
+						   $checked = "";
174
+						   if (in_array($post_type->name, $allowed_post_types)) {
175 175
 								$checked = 'checked="checked"';
176 176
 						   }
177 177
 						   echo '<label><input type="checkbox" '.$checked.' name="lasso_editor[allowed_post_types]['.$post_type->name.']" id="lasso_editor[allowed_post_types]['.$post_type->name.']" >'.$post_type->name.'</label>';
@@ -181,230 +181,230 @@  discard block
 block discarded – undo
181 181
 				</div>
182 182
 				
183 183
 
184
-				<h3><?php _e( 'Internal Settings', 'lasso' );?></h3>
184
+				<h3><?php _e('Internal Settings', 'lasso'); ?></h3>
185 185
 				<div class="lasso-editor-settings--option-wrap">
186 186
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
187
-						<label><?php _e( 'Article Class', 'lasso' );?></label>
188
-						<span class="lasso--setting-description"><?php _e( 'Provide the CSS class (including the preceding dot) of container that holds the post. This should be the first parent container class that holds the_content.', 'lasso' );?></span>
189
-						<input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr( $article_object );?>" placeholder=".entry-content">
187
+						<label><?php _e('Article Class', 'lasso'); ?></label>
188
+						<span class="lasso--setting-description"><?php _e('Provide the CSS class (including the preceding dot) of container that holds the post. This should be the first parent container class that holds the_content.', 'lasso'); ?></span>
189
+						<input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr($article_object); ?>" placeholder=".entry-content">
190 190
 					</div>
191 191
 				
192 192
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
193
-						<label><?php _e( 'Featured Image Class', 'lasso' );?></label>
194
-						<span class="lasso--setting-description"><?php _e( 'Provide the CSS class that uses a featured image as a background image. This currently only supports themes that have the featured image set as background image.', 'lasso' );?></span>
195
-						<input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr( $featImgClass );?>" placeholder=".entry-content">
193
+						<label><?php _e('Featured Image Class', 'lasso'); ?></label>
194
+						<span class="lasso--setting-description"><?php _e('Provide the CSS class that uses a featured image as a background image. This currently only supports themes that have the featured image set as background image.', 'lasso'); ?></span>
195
+						<input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr($featImgClass); ?>" placeholder=".entry-content">
196 196
 					</div>
197 197
 				
198 198
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
199
-						<label><?php _e( 'Article Title Class', 'lasso' );?></label>
200
-						<span class="lasso--setting-description"><?php _e( 'Provide the CSS class for the post title. This will enable you to update the title of the post by clicking and typing.', 'lasso' );?></span>
201
-						<input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr( $titleClass );?>" placeholder=".entry-content">
199
+						<label><?php _e('Article Title Class', 'lasso'); ?></label>
200
+						<span class="lasso--setting-description"><?php _e('Provide the CSS class for the post title. This will enable you to update the title of the post by clicking and typing.', 'lasso'); ?></span>
201
+						<input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr($titleClass); ?>" placeholder=".entry-content">
202 202
 					</div>
203 203
 				
204 204
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
205
-						<label><?php _e( 'Ignored Items to Save', 'lasso' );?></label>
206
-						<span class="lasso--setting-description"><?php _e( 'If your post container holds additional markup, list the css class names (comma separated, including the dot) of those items. When you enter the editor, Editus will remove (NOT delete) these items so that it does not save them as HTML.', 'lasso' );?></span>
207
-						<textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNoSave );?></textarea>
205
+						<label><?php _e('Ignored Items to Save', 'lasso'); ?></label>
206
+						<span class="lasso--setting-description"><?php _e('If your post container holds additional markup, list the css class names (comma separated, including the dot) of those items. When you enter the editor, Editus will remove (NOT delete) these items so that it does not save them as HTML.', 'lasso'); ?></span>
207
+						<textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr($objectsNoSave); ?></textarea>
208 208
 					</div>
209 209
 				
210 210
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
211
-						<label><?php _e( 'Read Only Items', 'lasso' );?></label>
212
-						<span class="lasso--setting-description"><?php _e( 'If your post has items that should not be editable, list the css class names (comma separated, including the dot) of those items.', 'lasso' );?></span>
213
-						<textarea name="lasso_editor[non_editable]" id="lasso_editor[non_editable]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNonEditable );?></textarea>
211
+						<label><?php _e('Read Only Items', 'lasso'); ?></label>
212
+						<span class="lasso--setting-description"><?php _e('If your post has items that should not be editable, list the css class names (comma separated, including the dot) of those items.', 'lasso'); ?></span>
213
+						<textarea name="lasso_editor[non_editable]" id="lasso_editor[non_editable]" placeholder=".classname, .another-class"><?php echo esc_attr($objectsNonEditable); ?></textarea>
214 214
 					</div>
215 215
 				
216 216
 					<div class="lasso-editor-settings--option-inner" >
217
-						<input type="checkbox" class="checkbox" name="lasso_editor[show_ignored_items]" id="lasso_editor[show_ignored_items]" <?php echo checked( $show_ignored_items, 'on' );?> >
218
-						<label for="lasso_editor[show_ignored_items]"> <?php _e( 'Show Ignored Items', 'lasso' );?></label>
219
-						<span class="lasso--setting-description"><?php _e( 'By default the ignored items are hidden. Check this to show ignored items while keeping them uneditable.', 'lasso' );?></span>
217
+						<input type="checkbox" class="checkbox" name="lasso_editor[show_ignored_items]" id="lasso_editor[show_ignored_items]" <?php echo checked($show_ignored_items, 'on'); ?> >
218
+						<label for="lasso_editor[show_ignored_items]"> <?php _e('Show Ignored Items', 'lasso'); ?></label>
219
+						<span class="lasso--setting-description"><?php _e('By default the ignored items are hidden. Check this to show ignored items while keeping them uneditable.', 'lasso'); ?></span>
220 220
 					</div>
221 221
 				</div>
222 222
 
223
-				<h3><?php _e( 'Editor UI', 'lasso' );?></h3>
223
+				<h3><?php _e('Editor UI', 'lasso'); ?></h3>
224 224
 				<div class="lasso-editor-settings--option-wrap">
225 225
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
226
-						<input type="checkbox" class="checkbox" name="lasso_editor[use_old_ui]" id="lasso_editor_use_old_ui" <?php echo checked( $use_old_ui, 'on' );?> >
227
-						<label for="lasso_editor[use_old_ui]"><?php _e( 'Use the Old Toolbar', 'lasso' );?></label>
228
-						<span class="lasso--setting-description"><?php _e( 'Use this option to disable the new color options and use the pre-1.0 toolbar.', 'lasso' );?></span>
226
+						<input type="checkbox" class="checkbox" name="lasso_editor[use_old_ui]" id="lasso_editor_use_old_ui" <?php echo checked($use_old_ui, 'on'); ?> >
227
+						<label for="lasso_editor[use_old_ui]"><?php _e('Use the Old Toolbar', 'lasso'); ?></label>
228
+						<span class="lasso--setting-description"><?php _e('Use this option to disable the new color options and use the pre-1.0 toolbar.', 'lasso'); ?></span>
229 229
 					</div>
230 230
 				    <div id="lasso-editor-settings--colors">
231 231
 					<?php
232
-					self::create_section_for_color_picker('button-color1', _e( 'Editor Bar Color Top', 'lasso' ), '#0000ff');
233
-					self::create_section_for_color_picker('button-color2', _e( 'Editor Bar Color Bottom', 'lasso' ), '#000030');
234
-					self::create_section_for_color_picker('dialog-color', _e( 'Dialog Color', 'lasso' ), '#000055');
235
-					self::create_section_for_color_picker('text-color', _e( 'Icon/Text Color', 'lasso' ), '#ffffff');
232
+					self::create_section_for_color_picker('button-color1', _e('Editor Bar Color Top', 'lasso'), '#0000ff');
233
+					self::create_section_for_color_picker('button-color2', _e('Editor Bar Color Bottom', 'lasso'), '#000030');
234
+					self::create_section_for_color_picker('dialog-color', _e('Dialog Color', 'lasso'), '#000055');
235
+					self::create_section_for_color_picker('text-color', _e('Icon/Text Color', 'lasso'), '#ffffff');
236 236
 					?>
237
-					<button type="button" id="lasso-editor-settings--default-colors" ><?php _e( 'Default Colors', 'lasso' );?></button>
237
+					<button type="button" id="lasso-editor-settings--default-colors" ><?php _e('Default Colors', 'lasso'); ?></button>
238 238
 				    <div style="height:50px;"></div>
239 239
 					</div>
240 240
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
241
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked( $toolbar_headings, 'on' );?> >
242
-						<label for="lasso_editor[toolbar_headings]"><?php _e( 'Enable H2 and H3 Buttons', 'lasso' );?></label>
243
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set H2 and H3 settings.', 'lasso' );?></span>
241
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked($toolbar_headings, 'on'); ?> >
242
+						<label for="lasso_editor[toolbar_headings]"><?php _e('Enable H2 and H3 Buttons', 'lasso'); ?></label>
243
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set H2 and H3 settings.', 'lasso'); ?></span>
244 244
 
245 245
 					</div>
246 246
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
247
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings_h4]" id="lasso_editor[toolbar_headings_h4]" <?php echo checked( $toolbar_headings_h4, 'on' );?> >
248
-						<label for="lasso_editor[toolbar_headings_h4]"><?php _e( 'Enable H4/H5/H6 Buttons', 'lasso' );?></label>
249
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set H4/H5/H6 settings.', 'lasso' );?></span>
247
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings_h4]" id="lasso_editor[toolbar_headings_h4]" <?php echo checked($toolbar_headings_h4, 'on'); ?> >
248
+						<label for="lasso_editor[toolbar_headings_h4]"><?php _e('Enable H4/H5/H6 Buttons', 'lasso'); ?></label>
249
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set H4/H5/H6 settings.', 'lasso'); ?></span>
250 250
 
251 251
 					</div>
252 252
 					
253 253
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
254
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_list]" id="lasso_editor[toolbar_list]" <?php echo checked( $toolbar_list, 'on' );?> >
255
-						<label for="lasso_editor[toolbar_list]"><?php _e( 'Enable OL/UL Buttons', 'lasso' );?></label>
256
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to create Ordered and Unordered Lists from text selection.', 'lasso' );?></span>
254
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_list]" id="lasso_editor[toolbar_list]" <?php echo checked($toolbar_list, 'on'); ?> >
255
+						<label for="lasso_editor[toolbar_list]"><?php _e('Enable OL/UL Buttons', 'lasso'); ?></label>
256
+						<span class="lasso--setting-description"><?php _e('Show the buttons to create Ordered and Unordered Lists from text selection.', 'lasso'); ?></span>
257 257
 					</div>
258 258
 					
259 259
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
260
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_color]" id="lasso_editor[toolbar_show_color]" <?php echo checked( $toolbar_show_color, 'on' );?> >
261
-						<label for="lasso_editor[toolbar_show_color]"><?php _e( 'Enable Text Color Buttons', 'lasso' );?></label>
262
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set text colors.', 'lasso' );?></span>
260
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_color]" id="lasso_editor[toolbar_show_color]" <?php echo checked($toolbar_show_color, 'on'); ?> >
261
+						<label for="lasso_editor[toolbar_show_color]"><?php _e('Enable Text Color Buttons', 'lasso'); ?></label>
262
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set text colors.', 'lasso'); ?></span>
263 263
 
264 264
 					</div>
265 265
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
266
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_alignment]" id="lasso_editor[toolbar_show_alignment]" <?php echo checked( $toolbar_show_alignment, 'on' );?> >
267
-						<label for="lasso_editor[toolbar_show_alignment]"><?php _e( 'Enable Text Align Buttons', 'lasso' );?></label>
268
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set text alignment.', 'lasso' );?></span>
266
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_alignment]" id="lasso_editor[toolbar_show_alignment]" <?php echo checked($toolbar_show_alignment, 'on'); ?> >
267
+						<label for="lasso_editor[toolbar_show_alignment]"><?php _e('Enable Text Align Buttons', 'lasso'); ?></label>
268
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set text alignment.', 'lasso'); ?></span>
269 269
 
270 270
 					</div>
271 271
 					
272 272
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
273
-						<input type="checkbox" class="checkbox" name="lasso_editor[links_editable]" id="lasso_editor[links_editable]" <?php echo checked( $links_editable, 'on' );?> >
274
-						<label for="lasso_editor[links_editable]"><?php _e( 'Make links editable under the Editing Mode', 'lasso' );?></label>
275
-						<span class="lasso--setting-description"><?php _e( 'Make links editable under the Editing Mode. Turning this on will make the links non-clickable while editing.', 'lasso' );?></span>
273
+						<input type="checkbox" class="checkbox" name="lasso_editor[links_editable]" id="lasso_editor[links_editable]" <?php echo checked($links_editable, 'on'); ?> >
274
+						<label for="lasso_editor[links_editable]"><?php _e('Make links editable under the Editing Mode', 'lasso'); ?></label>
275
+						<span class="lasso--setting-description"><?php _e('Make links editable under the Editing Mode. Turning this on will make the links non-clickable while editing.', 'lasso'); ?></span>
276 276
 
277 277
 					</div>
278 278
 					<div class="lasso-editor-settings--option-inner">
279
-					    <label for="lasso_editor[insert_comp_ui]"> <?php _e( 'Insert Component UI', 'lasso' );?></label>
280
-						<span class="lasso--setting-description"><?php _e( 'UI mechanism to insert components', 'lasso' );?></span>
279
+					    <label for="lasso_editor[insert_comp_ui]"> <?php _e('Insert Component UI', 'lasso'); ?></label>
280
+						<span class="lasso--setting-description"><?php _e('UI mechanism to insert components', 'lasso'); ?></span>
281 281
 						<div class="lasso-editor-settings--option-inner" style="border:none;">
282
-					       <input type="radio" name="lasso_editor[insert_comp_ui]" value='drag' <?php echo checked( $insert_comp_ui, 'drag' );?>> <?php _e( 'Drag and Drop', 'lasso' );?>
282
+					       <input type="radio" name="lasso_editor[insert_comp_ui]" value='drag' <?php echo checked($insert_comp_ui, 'drag'); ?>> <?php _e('Drag and Drop', 'lasso'); ?>
283 283
 						</div>
284 284
 						<div class="lasso-editor-settings--option-inner" style="border:none;">
285
-						<input type="radio" name="lasso_editor[insert_comp_ui]" value="click" <?php echo checked( $insert_comp_ui, 'click' );?>> <?php _e( 'Click', 'lasso' );?>
285
+						<input type="radio" name="lasso_editor[insert_comp_ui]" value="click" <?php echo checked($insert_comp_ui, 'click'); ?>> <?php _e('Click', 'lasso'); ?>
286 286
 						</div>
287 287
 						<div class="lasso-editor-settings--option-inner" style="border:none;">
288
-						<input type="radio" name="lasso_editor[insert_comp_ui]" value="mediumcom" <?php echo checked( $insert_comp_ui, 'mediumcom' );?>> <?php _e( 'Auto Button on Empty Paragraph. medium.com-like UI.', 'lasso' );?>
288
+						<input type="radio" name="lasso_editor[insert_comp_ui]" value="mediumcom" <?php echo checked($insert_comp_ui, 'mediumcom'); ?>> <?php _e('Auto Button on Empty Paragraph. medium.com-like UI.', 'lasso'); ?>
289 289
 						</div>
290 290
 					</div>
291 291
                     
292 292
 				</div>
293 293
 				
294
-				<h3><?php _e( 'Extra Component', 'lasso' );?></h3>
294
+				<h3><?php _e('Extra Component', 'lasso'); ?></h3>
295 295
                 <div class="lasso-editor-settings--option-wrap" style="border:none;" >
296 296
                     <div class="lasso-editor-settings--option-inner" >
297
-						<input type="checkbox" class="checkbox" name="lasso_editor[add_table]" id="lasso_editor[add_table]" <?php echo checked( $add_table, 'on' );?> >
298
-						<label for="lasso_editor[add_table]"><?php _e( 'Additional Component: Table', 'lasso' );?></label>
299
-						<span class="lasso--setting-description"><?php _e( 'Allow user to add and edit tables.', 'lasso' );?></span>
297
+						<input type="checkbox" class="checkbox" name="lasso_editor[add_table]" id="lasso_editor[add_table]" <?php echo checked($add_table, 'on'); ?> >
298
+						<label for="lasso_editor[add_table]"><?php _e('Additional Component: Table', 'lasso'); ?></label>
299
+						<span class="lasso--setting-description"><?php _e('Allow user to add and edit tables.', 'lasso'); ?></span>
300 300
 
301 301
 					</div>
302 302
                 </div>
303 303
 				
304 304
 
305
-				<h3><?php _e( 'Post Settings UI', 'lasso' );?></h3>
305
+				<h3><?php _e('Post Settings UI', 'lasso'); ?></h3>
306 306
 				<div class="lasso-editor-settings--option-wrap"  >
307 307
 					<div class="lasso-editor-settings--option-inner" style="border:none">
308
-						<input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked( $post_settings_disabled, 'on' );?> >
309
-						<label for="lasso_editor[post_settings_disabled]"> <?php _e( 'Disable Post Settings', 'lasso' );?></label>
310
-						<span class="lasso--setting-description"><?php _e( 'Check this to disable users from being able to edit post settings from the front-end.', 'lasso' );?></span>
308
+						<input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked($post_settings_disabled, 'on'); ?> >
309
+						<label for="lasso_editor[post_settings_disabled]"> <?php _e('Disable Post Settings', 'lasso'); ?></label>
310
+						<span class="lasso--setting-description"><?php _e('Check this to disable users from being able to edit post settings from the front-end.', 'lasso'); ?></span>
311 311
 					</div>
312 312
 					
313 313
 					<div class="lasso-editor-settings--option-inner" style="border:none">
314
-						<input type="checkbox" class="checkbox" name="lasso_editor[allow_change_date]" id="lasso_editor[allow_change_date]" <?php echo checked( $allow_change_date, 'on' );?> >
315
-						<label for="lasso_editor[allow_change_date]"> <?php _e( 'Allow Changing Post Date', 'lasso' );?></label>
316
-						<span class="lasso--setting-description"><?php _e( 'Add the date selector to change the post\'s date to the Post Setting dialog', 'lasso' );?></span>
314
+						<input type="checkbox" class="checkbox" name="lasso_editor[allow_change_date]" id="lasso_editor[allow_change_date]" <?php echo checked($allow_change_date, 'on'); ?> >
315
+						<label for="lasso_editor[allow_change_date]"> <?php _e('Allow Changing Post Date', 'lasso'); ?></label>
316
+						<span class="lasso--setting-description"><?php _e('Add the date selector to change the post\'s date to the Post Setting dialog', 'lasso'); ?></span>
317 317
 					</div>
318 318
                     
319 319
                     <div class="lasso-editor-settings--option-inner" style="border:none">
320
-						<input type="checkbox" class="checkbox" name="lasso_editor[allow_edit_excerpt]" id="lasso_editor[allow_edit_excerpt]" <?php echo checked( $allow_edit_excerpt, 'on' );?> >
321
-						<label for="lasso_editor[allow_edit_excerpt]"> <?php _e( 'Allow Editing Excerpt', 'lasso' );?></label>
322
-						<span class="lasso--setting-description"><?php _e( 'Allow the post\'s excerpt to be edited in the Post Setting dialog', 'lasso' );?></span>
320
+						<input type="checkbox" class="checkbox" name="lasso_editor[allow_edit_excerpt]" id="lasso_editor[allow_edit_excerpt]" <?php echo checked($allow_edit_excerpt, 'on'); ?> >
321
+						<label for="lasso_editor[allow_edit_excerpt]"> <?php _e('Allow Editing Excerpt', 'lasso'); ?></label>
322
+						<span class="lasso--setting-description"><?php _e('Allow the post\'s excerpt to be edited in the Post Setting dialog', 'lasso'); ?></span>
323 323
 					</div>
324 324
 					
325 325
 					<div class="lasso-editor-settings--option-inner" style="border:none">
326
-						<input type="checkbox" class="checkbox" name="lasso_editor[allow_new_category]" id="lasso_editor[allow_new_category]" <?php echo checked( $allow_new_category, 'on' );?> >
327
-						<label for="lasso_editor[allow_new_category]"> <?php _e( 'Allow Adding New Category', 'lasso' );?></label>
328
-						<span class="lasso--setting-description"><?php _e( 'Add the user to create new, previously non-existing categories for posts.', 'lasso' );?></span>
326
+						<input type="checkbox" class="checkbox" name="lasso_editor[allow_new_category]" id="lasso_editor[allow_new_category]" <?php echo checked($allow_new_category, 'on'); ?> >
327
+						<label for="lasso_editor[allow_new_category]"> <?php _e('Allow Adding New Category', 'lasso'); ?></label>
328
+						<span class="lasso--setting-description"><?php _e('Add the user to create new, previously non-existing categories for posts.', 'lasso'); ?></span>
329 329
 					</div>
330 330
 					
331 331
 					<div class="lasso-editor-settings--option-inner" style="border:none">
332
-						<input type="checkbox" class="checkbox" name="lasso_editor[no_pending_status]" id="lasso_editor[no_pending_status]" <?php echo checked( $no_pending_status, 'on' );?> >
333
-						<label for="lasso_editor[no_pending_status]"> <?php _e( 'Do Not Allow "Pending" Status', 'lasso' );?></label>
334
-						<span class="lasso--setting-description"><?php _e( 'Remove the Option to Set the Status to Pending.', 'lasso' );?></span>
332
+						<input type="checkbox" class="checkbox" name="lasso_editor[no_pending_status]" id="lasso_editor[no_pending_status]" <?php echo checked($no_pending_status, 'on'); ?> >
333
+						<label for="lasso_editor[no_pending_status]"> <?php _e('Do Not Allow "Pending" Status', 'lasso'); ?></label>
334
+						<span class="lasso--setting-description"><?php _e('Remove the Option to Set the Status to Pending.', 'lasso'); ?></span>
335 335
 					</div>
336 336
 					
337 337
 					<div class="lasso-editor-settings--option-inner" style="border:none">
338
-						<input type="checkbox" class="checkbox" name="lasso_editor[no_url_setting]" id="lasso_editor[no_slug_setting]" <?php echo checked( $no_url_setting, 'on' );?> >
339
-						<label for="lasso_editor[no_url_setting]"> <?php _e( 'Remove POST URL Option', 'lasso' );?></label>
340
-						<span class="lasso--setting-description"><?php _e( 'Remove the Option to Set the URL for the Post.', 'lasso' );?></span>
338
+						<input type="checkbox" class="checkbox" name="lasso_editor[no_url_setting]" id="lasso_editor[no_slug_setting]" <?php echo checked($no_url_setting, 'on'); ?> >
339
+						<label for="lasso_editor[no_url_setting]"> <?php _e('Remove POST URL Option', 'lasso'); ?></label>
340
+						<span class="lasso--setting-description"><?php _e('Remove the Option to Set the URL for the Post.', 'lasso'); ?></span>
341 341
 					</div>
342 342
 				
343 343
 					<div class="lasso-editor-settings--option-inner" >
344
-						<input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked( $post_new_disabled, 'on' );?> >
345
-						<label for="lasso_editor[post_adding_disabled]"><?php _e( 'Disable Post Adding', 'lasso' );?></label>
346
-						<span class="lasso--setting-description"><?php _e( 'Check this box to disable users from being able to add new posts from the front-end.', 'lasso' );?></span>
344
+						<input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked($post_new_disabled, 'on'); ?> >
345
+						<label for="lasso_editor[post_adding_disabled]"><?php _e('Disable Post Adding', 'lasso'); ?></label>
346
+						<span class="lasso--setting-description"><?php _e('Check this box to disable users from being able to add new posts from the front-end.', 'lasso'); ?></span>
347 347
 					</div>
348 348
 					
349 349
 
350 350
 				</div>
351 351
 				
352
-				<h3><?php _e( 'Misc', 'lasso' );?></h3>
352
+				<h3><?php _e('Misc', 'lasso'); ?></h3>
353 353
 				<div class="lasso-editor-settings--option-wrap">
354 354
 					<div class="lasso-editor-settings--option-inner" style="border:none">
355
-						<input type="checkbox" class="checkbox" name="lasso_editor[disable_tour]" id="lasso_editor[disable_tour]" <?php echo checked( $disable_tour, 'on' );?> >
356
-						<label for="lasso_editor[disable_tour]"> <?php _e( 'Do Not Show Tour Dialog', 'lasso' );?></label>
357
-						<span class="lasso--setting-description"><?php _e( 'Check this box to disable the tour dialog box for all users.', 'lasso' );?></span>
355
+						<input type="checkbox" class="checkbox" name="lasso_editor[disable_tour]" id="lasso_editor[disable_tour]" <?php echo checked($disable_tour, 'on'); ?> >
356
+						<label for="lasso_editor[disable_tour]"> <?php _e('Do Not Show Tour Dialog', 'lasso'); ?></label>
357
+						<span class="lasso--setting-description"><?php _e('Check this box to disable the tour dialog box for all users.', 'lasso'); ?></span>
358 358
 					</div>
359 359
 
360 360
 					<div class="lasso-editor-settings--option-inner" style="border:none">
361
-					    <label for="lasso_editor[bold_tag]"> <?php _e( '"Bold" Tag', 'lasso' );?></label>
362
-						<span class="lasso--setting-description"><?php _e( 'Choose the HTML tag used for the "Bold" style.', 'lasso' );?></span>
363
-					    <input type="radio" name="lasso_editor[bold_tag]" value='b' <?php echo checked( $bold_tag, 'b' );?>> b
364
-						<input type="radio" name="lasso_editor[bold_tag]" value="strong" <?php echo checked( $bold_tag, 'strong' );?>> strong
361
+					    <label for="lasso_editor[bold_tag]"> <?php _e('"Bold" Tag', 'lasso'); ?></label>
362
+						<span class="lasso--setting-description"><?php _e('Choose the HTML tag used for the "Bold" style.', 'lasso'); ?></span>
363
+					    <input type="radio" name="lasso_editor[bold_tag]" value='b' <?php echo checked($bold_tag, 'b'); ?>> b
364
+						<input type="radio" name="lasso_editor[bold_tag]" value="strong" <?php echo checked($bold_tag, 'strong'); ?>> strong
365 365
 					</div>
366 366
 					<div class="lasso-editor-settings--option-inner" >
367
-					    <label for="lasso_editor[i_tag]"> <?php _e( '"Italic" Tag', 'lasso' );?></label>
368
-						<span class="lasso--setting-description"><?php _e( 'Choose the HTML tag used for the "Italic" style.', 'lasso' );?></span>
369
-					    <input type="radio" name="lasso_editor[i_tag]" value='i' <?php echo checked( $i_tag, 'i' );?>> i
370
-						<input type="radio" name="lasso_editor[i_tag]" value="em" <?php echo checked( $i_tag, 'em' );?>> em
367
+					    <label for="lasso_editor[i_tag]"> <?php _e('"Italic" Tag', 'lasso'); ?></label>
368
+						<span class="lasso--setting-description"><?php _e('Choose the HTML tag used for the "Italic" style.', 'lasso'); ?></span>
369
+					    <input type="radio" name="lasso_editor[i_tag]" value='i' <?php echo checked($i_tag, 'i'); ?>> i
370
+						<input type="radio" name="lasso_editor[i_tag]" value="em" <?php echo checked($i_tag, 'em'); ?>> em
371 371
 					</div>
372 372
 				</div>
373 373
 
374
-				<h3><?php _e( 'Advanced Options', 'lasso' );?></h3>
375
-                <span class="lasso--setting-description"><?php _e( 'Suggested not to turn these options on without consulting the developer.', 'lasso' );?></span>
374
+				<h3><?php _e('Advanced Options', 'lasso'); ?></h3>
375
+                <span class="lasso--setting-description"><?php _e('Suggested not to turn these options on without consulting the developer.', 'lasso'); ?></span>
376 376
                 <span class="lasso--setting-description"> </span>
377 377
 				<div class="lasso-editor-settings--option-wrap ">
378 378
 					<div class="lasso-editor-settings--option-inner" style="border:none">
379
-						<input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked( $shortcodify_disabled, 'on' );?> >
380
-						<label for="lasso_editor[shortcodify_disabled]"><?php _e( 'Disable Aesop Component Conversion', 'lasso' );?></label>
381
-						<span class="lasso--setting-description"><?php _e( 'Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso' );?></span>
379
+						<input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked($shortcodify_disabled, 'on'); ?> >
380
+						<label for="lasso_editor[shortcodify_disabled]"><?php _e('Disable Aesop Component Conversion', 'lasso'); ?></label>
381
+						<span class="lasso--setting-description"><?php _e('Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso'); ?></span>
382 382
 					</div>
383 383
 				
384 384
 					<div class="lasso-editor-settings--option-inner" style="border:none">
385
-						<input type="checkbox" class="checkbox" name="lasso_editor[enable_autosave]" id="lasso_editor[enable_autosave]" <?php echo checked( $enable_autosave, 'on' );?> >
386
-						<label for="lasso_editor[enable_autosave]"><?php _e( 'Enable Auto Save', 'lasso' );?></label>
387
-						<span class="lasso--setting-description"><?php _e( 'Check this box to enable auto save.', 'lasso' );?></span>
385
+						<input type="checkbox" class="checkbox" name="lasso_editor[enable_autosave]" id="lasso_editor[enable_autosave]" <?php echo checked($enable_autosave, 'on'); ?> >
386
+						<label for="lasso_editor[enable_autosave]"><?php _e('Enable Auto Save', 'lasso'); ?></label>
387
+						<span class="lasso--setting-description"><?php _e('Check this box to enable auto save.', 'lasso'); ?></span>
388 388
 					</div>
389 389
 				
390 390
 					<div class="lasso-editor-settings--option-inner" style="border:none">
391
-						<input type="checkbox" class="checkbox" name="lasso_editor[post_save_disabled]" id="lasso_editor[post_save_disabled]" <?php echo checked( $save_to_post_disabled, 'on' );?> >
392
-						<label for="lasso_editor[post_save_disabled]"><?php _e( 'Disable Post Saving', 'lasso' );?></label>
393
-						<span class="lasso--setting-description"><?php _e( 'By default the editor will update the database with the post or page it is being used on. Check this box to disable this. If you check this box, it is assumed that you will be using the provided filters to save your own content.', 'lasso' );?></span>
391
+						<input type="checkbox" class="checkbox" name="lasso_editor[post_save_disabled]" id="lasso_editor[post_save_disabled]" <?php echo checked($save_to_post_disabled, 'on'); ?> >
392
+						<label for="lasso_editor[post_save_disabled]"><?php _e('Disable Post Saving', 'lasso'); ?></label>
393
+						<span class="lasso--setting-description"><?php _e('By default the editor will update the database with the post or page it is being used on. Check this box to disable this. If you check this box, it is assumed that you will be using the provided filters to save your own content.', 'lasso'); ?></span>
394 394
 
395 395
 					</div>
396 396
 					
397 397
 					<div class="lasso-editor-settings--option-inner" style="border:none">
398
-						<input type="checkbox" class="checkbox" name="lasso_editor[post_edit_disabled]" id="lasso_editor[post_edit_disabled]" <?php echo checked( $edit_post_disabled, 'on' );?> >
399
-						<label for="lasso_editor[post_edit_disabled]"><?php _e( 'Disable Post Editing', 'lasso' );?></label>
400
-						<span class="lasso--setting-description"><?php _e( 'You may use this option if you only want to edit custom fields. Refer <a href="https://edituswp.com/editing-and-updating-custom-fields-from-frontend/">here</a> for more information. The custom fields you specify will be still editable under the editing mode.', 'lasso' );?></span>
398
+						<input type="checkbox" class="checkbox" name="lasso_editor[post_edit_disabled]" id="lasso_editor[post_edit_disabled]" <?php echo checked($edit_post_disabled, 'on'); ?> >
399
+						<label for="lasso_editor[post_edit_disabled]"><?php _e('Disable Post Editing', 'lasso'); ?></label>
400
+						<span class="lasso--setting-description"><?php _e('You may use this option if you only want to edit custom fields. Refer <a href="https://edituswp.com/editing-and-updating-custom-fields-from-frontend/">here</a> for more information. The custom fields you specify will be still editable under the editing mode.', 'lasso'); ?></span>
401 401
 
402 402
 					</div>
403 403
 				
404 404
 					<div class="lasso-editor-settings--option-inner">
405
-						<input type="checkbox" class="checkbox" name="lasso_editor[save_using_rest_disabled]" id="lasso_editor[save_using_rest_disabled]" <?php echo checked( $save_using_rest_disabled, 'on' );?> >
406
-						<label for="lasso_editor[save_using_rest_disabled]"><?php _e( "Don't Use REST API to Save", 'lasso' );?></label>
407
-						<span class="lasso--setting-description"><?php _e( 'By default the editor will use REST API to save posts. Check this box to use custom AJAX calls instead.', 'lasso' );?></span>
405
+						<input type="checkbox" class="checkbox" name="lasso_editor[save_using_rest_disabled]" id="lasso_editor[save_using_rest_disabled]" <?php echo checked($save_using_rest_disabled, 'on'); ?> >
406
+						<label for="lasso_editor[save_using_rest_disabled]"><?php _e("Don't Use REST API to Save", 'lasso'); ?></label>
407
+						<span class="lasso--setting-description"><?php _e('By default the editor will use REST API to save posts. Check this box to use custom AJAX calls instead.', 'lasso'); ?></span>
408 408
 
409 409
 					</div>
410 410
 				</div>
@@ -414,11 +414,11 @@  discard block
 block discarded – undo
414 414
 
415 415
 				<div class="lasso-editor-settings--submit">
416 416
 				    <input type="hidden" name="action" value="lasso-editor-settings" />
417
-				    <input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save Settings', 'lasso' );?>" />
418
-					<?php wp_nonce_field( 'nonce', 'lasso_editor_settings' ); ?>
417
+				    <input type="submit" class="button-primary" value="<?php esc_attr_e('Save Settings', 'lasso'); ?>" />
418
+					<?php wp_nonce_field('nonce', 'lasso_editor_settings'); ?>
419 419
 				</div>
420 420
 				
421
-				<?php do_action('lasso_settings_after');?>
421
+				<?php do_action('lasso_settings_after'); ?>
422 422
 			</form>
423 423
 
424 424
 		</div><?php
Please login to merge, or discard this patch.
lasso.php 2 patches
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 add_filter('register_post_type_args', 'lasso_show_in_rest', 10, 2);
49 49
 function lasso_show_in_rest($args, $post_type){
50 50
  
51
-    $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( ) );
51
+	$allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( ) );
52 52
 	$allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
53 53
 	if (in_array( $post_type,$allowed_post_types)) {
54 54
 		$args['show_in_rest'] = true;
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 		}
58 58
 	}
59 59
  
60
-    return $args;
60
+	return $args;
61 61
 }
62 62
 
63 63
 
@@ -106,25 +106,25 @@  discard block
 block discarded – undo
106 106
 //table codes to be added
107 107
 class editus_table {
108 108
     
109
-    public function __construct(){
110
-        $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
111
-        if ($add_table) {
112
-            add_action('wp_enqueue_scripts', array($this,'scripts'));
109
+	public function __construct(){
110
+		$add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
111
+		if ($add_table) {
112
+			add_action('wp_enqueue_scripts', array($this,'scripts'));
113 113
             
114
-        }
114
+		}
115 115
 	}
116 116
     
117
-    function scripts()
118
-    {
119
-        add_action('lasso_editor_controls_after_outside', array($this,'editus_table_edit_menu'));
120
-            add_filter('lasso_components',array($this,'editus_components_add_table'),10,1);
121
-            add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_table'), 10 );
122
-            wp_enqueue_style( 'editus-table-style', LASSO_URL.  '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true );
123
-            wp_enqueue_script( 'editus_table',  LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true );
124
-    }
117
+	function scripts()
118
+	{
119
+		add_action('lasso_editor_controls_after_outside', array($this,'editus_table_edit_menu'));
120
+			add_filter('lasso_components',array($this,'editus_components_add_table'),10,1);
121
+			add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_table'), 10 );
122
+			wp_enqueue_style( 'editus-table-style', LASSO_URL.  '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true );
123
+			wp_enqueue_script( 'editus_table',  LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true );
124
+	}
125 125
     
126
-    function editus_table_edit_menu()
127
-    { ?>
126
+	function editus_table_edit_menu()
127
+	{ ?>
128 128
 
129 129
         <ul class='editus-table-menu'>
130 130
           <li data-action="insertcol"><?php echo __('Insert Column','lasso')?></li>
@@ -133,31 +133,31 @@  discard block
 block discarded – undo
133 133
           <li data-action="delrow"><?php echo __('Delete Row','lasso')?></li>
134 134
         </ul>
135 135
     <?php
136
-    }
136
+	}
137 137
     
138 138
     
139
-    function editus_html_table()
140
-    {   
141
-        return '<figure class="wp-block-table"><table><tr><th>Cell 1</th><th>Cell 2</th></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table></figure><p></p>';
142
-    }
139
+	function editus_html_table()
140
+	{   
141
+		return '<figure class="wp-block-table"><table><tr><th>Cell 1</th><th>Cell 2</th></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table></figure><p></p>';
142
+	}
143 143
 
144 144
 
145
-    function editus_components_add_table( $array ){
146
-        $custom = array(
147
-               'htmltable' => array(
148
-                         'name'    => __('HTML Table','lasso'),
149
-                          'content' => self::editus_html_table(),
150
-                )
151
-        );
152
-        return array_merge( $array, $custom );
153
-    }
145
+	function editus_components_add_table( $array ){
146
+		$custom = array(
147
+			   'htmltable' => array(
148
+						 'name'    => __('HTML Table','lasso'),
149
+						  'content' => self::editus_html_table(),
150
+				)
151
+		);
152
+		return array_merge( $array, $custom );
153
+	}
154 154
 
155 155
 
156
-    function editus_toolbar_components_add_table( ) {
157
-          ?>
156
+	function editus_toolbar_components_add_table( ) {
157
+		  ?>
158 158
           <li data-type="htmltable" title="<?php esc_attr_e( 'HTML Table', 'lasso' );?>" class="quote lasso-toolbar--component__htmltable dashicons dashicons-grid-view"></li>
159 159
           <?php
160
-    }
160
+	}
161 161
 }
162 162
 
163 163
 
Please login to merge, or discard this patch.
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -18,27 +18,27 @@  discard block
 block discarded – undo
18 18
  */
19 19
 
20 20
 // If this file is called directly, abort.
21
-if ( ! defined( 'WPINC' ) ) {
21
+if (!defined('WPINC')) {
22 22
 	die;
23 23
 }
24 24
 
25 25
 // Set some constants
26
-define( 'LASSO_VERSION', '1.3.0' );
27
-define( 'LASSO_DIR', plugin_dir_path( __FILE__ ) );
28
-define( 'LASSO_URL', plugins_url( '', __FILE__ ) );
29
-define( 'LASSO_FILE', __FILE__ );
26
+define('LASSO_VERSION', '1.3.0');
27
+define('LASSO_DIR', plugin_dir_path(__FILE__));
28
+define('LASSO_URL', plugins_url('', __FILE__));
29
+define('LASSO_FILE', __FILE__);
30 30
 
31 31
 /**
32 32
  * Load plugin if PHP version is 5.4 or later.
33 33
  */
34
-if ( version_compare( PHP_VERSION, '5.4.0', '>=' ) ) {
34
+if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
35 35
 
36
-	include_once( LASSO_DIR . '/bootstrap.php' );
36
+	include_once(LASSO_DIR.'/bootstrap.php');
37 37
 
38 38
 } else {
39 39
 
40 40
 	add_action('admin_head', 'lasso_fail_notice');
41
-	function lasso_fail_notice(){
41
+	function lasso_fail_notice() {
42 42
 
43 43
 		printf('<div class="error"><p>Editus requires PHP 5.4 or higher.</p></div>');
44 44
 
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
 }
47 47
 
48 48
 add_filter('register_post_type_args', 'lasso_show_in_rest', 10, 2);
49
-function lasso_show_in_rest($args, $post_type){
49
+function lasso_show_in_rest($args, $post_type) {
50 50
  
51
-    $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( ) );
52
-	$allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
53
-	if (in_array( $post_type,$allowed_post_types)) {
51
+    $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array( ));
52
+	$allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types);
53
+	if (in_array($post_type, $allowed_post_types)) {
54 54
 		$args['show_in_rest'] = true;
55 55
 		if ($post_type != 'post' && $post_type != 'page') {
56 56
 			$args['rest_base'] = $post_type;
@@ -61,21 +61,21 @@  discard block
 block discarded – undo
61 61
 }
62 62
 
63 63
 
64
-function lasso_editor_get_option( $option, $section, $default = '' ) {
64
+function lasso_editor_get_option($option, $section, $default = '') {
65 65
 
66
-	if ( empty( $option ) )
66
+	if (empty($option))
67 67
 		return;
68 68
 
69
-	if ( function_exists( 'is_multisite' ) && is_multisite() ) {
69
+	if (function_exists('is_multisite') && is_multisite()) {
70 70
 
71
-		$options = get_site_option( $section );
71
+		$options = get_site_option($section);
72 72
 
73 73
 	} else {
74 74
 
75
-		$options = get_option( $section );
75
+		$options = get_option($section);
76 76
 	}
77 77
 
78
-	if ( isset( $options[$option] ) ) {
78
+	if (isset($options[$option])) {
79 79
 		return $options[$option];
80 80
 	}
81 81
 
@@ -88,17 +88,17 @@  discard block
 block discarded – undo
88 88
 ));
89 89
 
90 90
 // Gutenberg
91
-if( function_exists( 'is_gutenberg_page' ) ) {
92
-	function add_raw_to_post( $response, $post, $request ) {
91
+if (function_exists('is_gutenberg_page')) {
92
+	function add_raw_to_post($response, $post, $request) {
93 93
 		$response_data = $response->get_data();
94
-		if ( is_array( $response_data['content'] )) {
95
-			$response_data['content']['raw'] =  $post->post_content ;
96
-			$response->set_data( $response_data );
94
+		if (is_array($response_data['content'])) {
95
+			$response_data['content']['raw'] = $post->post_content;
96
+			$response->set_data($response_data);
97 97
 		}
98 98
 
99 99
 		return $response;
100 100
 	}
101
-	add_filter( "rest_prepare_post", 'add_raw_to_post', 10, 3 );
101
+	add_filter("rest_prepare_post", 'add_raw_to_post', 10, 3);
102 102
 }
103 103
 
104 104
 
@@ -106,31 +106,31 @@  discard block
 block discarded – undo
106 106
 //table codes to be added
107 107
 class editus_table {
108 108
     
109
-    public function __construct(){
109
+    public function __construct() {
110 110
         $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
111 111
         if ($add_table) {
112
-            add_action('wp_enqueue_scripts', array($this,'scripts'));
112
+            add_action('wp_enqueue_scripts', array($this, 'scripts'));
113 113
             
114 114
         }
115 115
 	}
116 116
     
117 117
     function scripts()
118 118
     {
119
-        add_action('lasso_editor_controls_after_outside', array($this,'editus_table_edit_menu'));
120
-            add_filter('lasso_components',array($this,'editus_components_add_table'),10,1);
121
-            add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_table'), 10 );
122
-            wp_enqueue_style( 'editus-table-style', LASSO_URL.  '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true );
123
-            wp_enqueue_script( 'editus_table',  LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true );
119
+        add_action('lasso_editor_controls_after_outside', array($this, 'editus_table_edit_menu'));
120
+            add_filter('lasso_components', array($this, 'editus_components_add_table'), 10, 1);
121
+            add_action('lasso_toolbar_components', array($this, 'editus_toolbar_components_add_table'), 10);
122
+            wp_enqueue_style('editus-table-style', LASSO_URL.'/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true);
123
+            wp_enqueue_script('editus_table', LASSO_URL.'/public/assets/js/editus-table-edit-public.js', array('jquery'), LASSO_VERSION, true);
124 124
     }
125 125
     
126 126
     function editus_table_edit_menu()
127 127
     { ?>
128 128
 
129 129
         <ul class='editus-table-menu'>
130
-          <li data-action="insertcol"><?php echo __('Insert Column','lasso')?></li>
131
-          <li data-action="insertrow"><?php echo __('Insert Row','lasso')?></li>
132
-          <li data-action="delcol"><?php echo __('Delete Column','lasso')?></li>
133
-          <li data-action="delrow"><?php echo __('Delete Row','lasso')?></li>
130
+          <li data-action="insertcol"><?php echo __('Insert Column', 'lasso')?></li>
131
+          <li data-action="insertrow"><?php echo __('Insert Row', 'lasso')?></li>
132
+          <li data-action="delcol"><?php echo __('Delete Column', 'lasso')?></li>
133
+          <li data-action="delrow"><?php echo __('Delete Row', 'lasso')?></li>
134 134
         </ul>
135 135
     <?php
136 136
     }
@@ -142,20 +142,20 @@  discard block
 block discarded – undo
142 142
     }
143 143
 
144 144
 
145
-    function editus_components_add_table( $array ){
145
+    function editus_components_add_table($array) {
146 146
         $custom = array(
147 147
                'htmltable' => array(
148
-                         'name'    => __('HTML Table','lasso'),
148
+                         'name'    => __('HTML Table', 'lasso'),
149 149
                           'content' => self::editus_html_table(),
150 150
                 )
151 151
         );
152
-        return array_merge( $array, $custom );
152
+        return array_merge($array, $custom);
153 153
     }
154 154
 
155 155
 
156 156
     function editus_toolbar_components_add_table( ) {
157 157
           ?>
158
-          <li data-type="htmltable" title="<?php esc_attr_e( 'HTML Table', 'lasso' );?>" class="quote lasso-toolbar--component__htmltable dashicons dashicons-grid-view"></li>
158
+          <li data-type="htmltable" title="<?php esc_attr_e('HTML Table', 'lasso'); ?>" class="quote lasso-toolbar--component__htmltable dashicons dashicons-grid-view"></li>
159 159
           <?php
160 160
     }
161 161
 }
Please login to merge, or discard this patch.