Completed
Push — master ( 5519a7...31090b )
by
unknown
01:29
created
includes/process/meta.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
 	 *
29 29
 	 * @return bool Always returns true.
30 30
 	 */
31
-	public function update( $data ) {
31
+	public function update($data) {
32 32
 
33
-		$post_id = isset( $data['post_id'] ) ? $data['post_id'] : false;
33
+		$post_id = isset($data['post_id']) ? $data['post_id'] : false;
34 34
 
35 35
 			
36 36
 		/**
@@ -40,13 +40,13 @@  discard block
 block discarded – undo
40 40
 		 *
41 41
 		 * @param array $allowed_fields The fields
42 42
 		 */
43
-		$allowed_fields = apply_filters( 'lasso_meta_fields', array() );
44
-		if ( ! empty( $allowed_fields ) ) {
45
-			foreach( $allowed_fields as $field ) {
46
-				if ( isset( $data[ $field ] ) ) {
43
+		$allowed_fields = apply_filters('lasso_meta_fields', array());
44
+		if (!empty($allowed_fields)) {
45
+			foreach ($allowed_fields as $field) {
46
+				if (isset($data[$field])) {
47 47
 					//this original line changed dash to underscore
48 48
 					//update_post_meta( $post_id, lasso_unclean_string( $field ), $data[ $field ]  );
49
-					update_post_meta( $post_id,  $field, $data[ $field ]  );
49
+					update_post_meta($post_id, $field, $data[$field]);
50 50
 				}
51 51
 			}
52 52
 		}
@@ -64,8 +64,8 @@  discard block
 block discarded – undo
64 64
 	 *
65 65
 	 * @return array Array of keys to pull from $data per action and their sanitization callback
66 66
 	 */
67
-	public static function params(){
68
-		$params[ 'process_meta_update' ] = array(
67
+	public static function params() {
68
+		$params['process_meta_update'] = array(
69 69
 			'post_id' 	=> 'absint',
70 70
 			'tab_name'	=> 'trim'
71 71
 		);
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 * @return array Array of additional functions to use to authorize action.
83 83
 	 */
84 84
 	public static function auth_callbacks() {
85
-		$params[ 'process_meta_update' ] = array(
85
+		$params['process_meta_update'] = array(
86 86
 			'lasso_user_can'
87 87
 		);
88 88
 
Please login to merge, or discard this patch.
public/includes/option-engine.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 *	Get an array of addon data for the settings modal
44 44
 *	@since 0.9.4
45 45
 */
46
-function lasso_get_modal_tabs(){
46
+function lasso_get_modal_tabs() {
47 47
 
48 48
 	$tabs = array();
49 49
 
@@ -60,34 +60,34 @@  discard block
 block discarded – undo
60 60
 *	@uses lasso_modal_addons_content()
61 61
 *	@since 0.9.4
62 62
 */
63
-function lasso_modal_addons( $type = 'tab' ){
63
+function lasso_modal_addons($type = 'tab') {
64 64
 
65 65
 	$tabs = lasso_get_modal_tabs();
66 66
 	$out = '';
67 67
 
68
-	if ( $tabs ):
68
+	if ($tabs):
69 69
 
70
-		if ( 'tab' == $type ) {
70
+		if ('tab' == $type) {
71 71
 
72 72
 			$out = '<ul class="lasso--modal__tabs">';
73 73
 
74 74
 				$out .= '<li class="active-tab" data-addon-name="core">Editus</li>';
75 75
 
76
-				foreach ( $tabs as $tab ) {
76
+				foreach ($tabs as $tab) {
77 77
 
78
-					if ( isset( $tab ) ) {
78
+					if (isset($tab)) {
79 79
 
80
-						$out .= lasso_modal_addons_content( $tab, $type );
80
+						$out .= lasso_modal_addons_content($tab, $type);
81 81
 					}
82 82
 				}
83 83
 
84 84
 			$out .= '</ul>';
85 85
 
86
-		} elseif ( 'content' == $type ) {
87
-			foreach ( $tabs as $tab ) {
86
+		} elseif ('content' == $type) {
87
+			foreach ($tabs as $tab) {
88 88
 
89
-				if ( isset( $tab ) ) {
90
-					$out .= lasso_modal_addons_content( $tab , $type );
89
+				if (isset($tab)) {
90
+					$out .= lasso_modal_addons_content($tab, $type);
91 91
 				}
92 92
 			}
93 93
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
 	endif;
97 97
 
98
-	return !empty( $out ) ? $out : false;
98
+	return !empty($out) ? $out : false;
99 99
 }
100 100
 
101 101
 /**
@@ -115,26 +115,26 @@  discard block
 block discarded – undo
115 115
 *	@since 0.9.5
116 116
 *	@subpackage lasso_modal_addons_content
117 117
 */
118
-function lasso_option_form( $name = '', $options = array() ){
118
+function lasso_option_form($name = '', $options = array()) {
119 119
 
120 120
 	ob_start();
121 121
 
122
-	if ( empty( $name ) || empty( $options ) || !is_array( $options ) )
122
+	if (empty($name) || empty($options) || !is_array($options))
123 123
 		return;
124 124
 
125 125
 	$nonce = wp_create_nonce('lasso-process-post-meta');
126
-	$key   = sprintf('_lasso_%s_settings', $name );
126
+	$key   = sprintf('_lasso_%s_settings', $name);
127 127
 
128
-	$out = sprintf('<form id="lasso--post-form" class="lasso--post-form">' );
128
+	$out = sprintf('<form id="lasso--post-form" class="lasso--post-form">');
129 129
 
130
-		$out .= lasso_option_fields( $name, $options );
131
-		$out .='<div class="form--bottom">';
132
-			$out .='<input type="submit" value="'.__( 'Save', 'lasso' ).'">';
133
-			$out .='<input type="hidden" name="tab_name" value="'.$key.'">';
134
-			$out .='<input type="hidden" name="post_id" value="'.get_the_ID().'">';
135
-			$out .='<input type="hidden" name="nonce" value="'.$nonce.'">';
136
-			$out .='<input type="hidden" name="action" value="process_meta_update">';
137
-		$out .='</div>';
130
+		$out .= lasso_option_fields($name, $options);
131
+		$out .= '<div class="form--bottom">';
132
+			$out .= '<input type="submit" value="'.__('Save', 'lasso').'">';
133
+			$out .= '<input type="hidden" name="tab_name" value="'.$key.'">';
134
+			$out .= '<input type="hidden" name="post_id" value="'.get_the_ID().'">';
135
+			$out .= '<input type="hidden" name="nonce" value="'.$nonce.'">';
136
+			$out .= '<input type="hidden" name="action" value="process_meta_update">';
137
+		$out .= '</div>';
138 138
 
139 139
 	$out .= '</form>';
140 140
 	
@@ -192,31 +192,31 @@  discard block
 block discarded – undo
192 192
 *	@since 0.9.5
193 193
 *	@subpackage lasso_modal_addons_content
194 194
 */
195
-function lasso_option_fields( $name = '', $options = array() ){
195
+function lasso_option_fields($name = '', $options = array()) {
196 196
 
197
-	$out 	= '';
197
+	$out = '';
198 198
 	$before = '<div class="lasso--postsettings__option">';
199 199
 	$after 	= '</div>';
200 200
 
201
-	if ( empty( $name ) || empty( $options ) )
201
+	if (empty($name) || empty($options))
202 202
 		return;
203 203
 
204
-	foreach ( (array) $options as $option ) {
204
+	foreach ((array) $options as $option) {
205 205
 
206
-		$type = isset( $option['type'] ) ? $option['type'] : 'text';
206
+		$type = isset($option['type']) ? $option['type'] : 'text';
207 207
 
208
-		switch ( $type ) {
208
+		switch ($type) {
209 209
 			case 'text':
210
-				$out .= sprintf('%s%s%s', $before, lasso_option_engine_option( $name, $option,'text' ), $after );
210
+				$out .= sprintf('%s%s%s', $before, lasso_option_engine_option($name, $option, 'text'), $after);
211 211
 				break;
212 212
 			case 'textarea':
213
-				$out .= sprintf('%s%s%s', $before, lasso_option_engine_option( $name, $option,'textarea' ), $after );
213
+				$out .= sprintf('%s%s%s', $before, lasso_option_engine_option($name, $option, 'textarea'), $after);
214 214
 				break;
215 215
 			case 'imgurl':
216
-				$out .= sprintf('%s%s%s', $before, lasso_option_engine_option( $name, $option,'imgurl' ), $after );
216
+				$out .= sprintf('%s%s%s', $before, lasso_option_engine_option($name, $option, 'imgurl'), $after);
217 217
 				break;
218 218
 			case 'checkbox':
219
-				$out .= sprintf('%s%s%s', $before, lasso_option_engine_option( $name, $option,'checkbox' ), $after );
219
+				$out .= sprintf('%s%s%s', $before, lasso_option_engine_option($name, $option, 'checkbox'), $after);
220 220
 				break;
221 221
 		}
222 222
 
@@ -236,30 +236,30 @@  discard block
 block discarded – undo
236 236
 *	@param $type string text, textarea, checkbox, color
237 237
 *	@since 5.0
238 238
 */
239
-function lasso_option_engine_option( $name = '', $option = '', $type = '') {
239
+function lasso_option_engine_option($name = '', $option = '', $type = '') {
240 240
 
241
-	if ( empty( $type ) || empty( $option ) )
241
+	if (empty($type) || empty($option))
242 242
 		return;
243 243
 
244
-	$id = isset( $option['id'] ) ? $option['id'] : false;
245
-	$id = $id ? lasso_clean_string( $id ) : false;
244
+	$id = isset($option['id']) ? $option['id'] : false;
245
+	$id = $id ? lasso_clean_string($id) : false;
246 246
 
247
-	$desc = isset( $option['desc'] ) ? $option['desc'] : false;
247
+	$desc = isset($option['desc']) ? $option['desc'] : false;
248 248
 
249
-	$value = get_post_meta( get_the_id(), $option[ 'id' ], true );
249
+	$value = get_post_meta(get_the_id(), $option['id'], true);
250 250
 
251
-	switch ( $type ) {
251
+	switch ($type) {
252 252
 		case 'text':
253
-			$out = sprintf('<label for="lasso--post-option-%s">%s</label><input id="lasso--post-option-%s" class="editus-custom-field-text" name="%s" type="text" value="%s">',$id, esc_html( $desc ), $id, $id, $value );
253
+			$out = sprintf('<label for="lasso--post-option-%s">%s</label><input id="lasso--post-option-%s" class="editus-custom-field-text" name="%s" type="text" value="%s">', $id, esc_html($desc), $id, $id, $value);
254 254
 			break;
255 255
 		case 'textarea':
256
-			$out = sprintf('<label for="lasso--post-option-%s">%s</label><textarea id="lasso--post-option-%s" name="%s">%s</textarea>',$id, esc_html( $desc ), $id, $id, $value );
256
+			$out = sprintf('<label for="lasso--post-option-%s">%s</label><textarea id="lasso--post-option-%s" name="%s">%s</textarea>', $id, esc_html($desc), $id, $id, $value);
257 257
 			break;
258 258
 		case 'imgurl':
259
-			$out = sprintf('<label for="lasso--post-option-%s">%s</label><img src="%s" style="height:80px;"><input id="lasso--post-option-%s" class="editus-custom-field-text" name="%s" type="text" value="%s" style="display:none;"><div title="Replace Image"  class="editus-customtab-image-control" style="float:left;"><i class="lasso-icon-image" style="font-size:20px;padding:5px;"></i></div><div title="Remove Image"  class="editus-customtab-image-remove" style="float:left;"><i class="lasso-icon-bin2" style="font-size:20px;padding:5px;"></i></div>',$id, esc_html( $desc ), $value, $id, $id,  $value );
259
+			$out = sprintf('<label for="lasso--post-option-%s">%s</label><img src="%s" style="height:80px;"><input id="lasso--post-option-%s" class="editus-custom-field-text" name="%s" type="text" value="%s" style="display:none;"><div title="Replace Image"  class="editus-customtab-image-control" style="float:left;"><i class="lasso-icon-image" style="font-size:20px;padding:5px;"></i></div><div title="Remove Image"  class="editus-customtab-image-remove" style="float:left;"><i class="lasso-icon-bin2" style="font-size:20px;padding:5px;"></i></div>', $id, esc_html($desc), $value, $id, $id, $value);
260 260
 			break;
261 261
 		case 'checkbox':
262
-			$out = sprintf('<label for="lasso--post-option-%s" class="checkbox-control checkbox"><input id="lasso--post-option-%s" type="checkbox" name="%s" class="checkbox"><span class="control-indicator"></span>%s',$id, $id, $id ,esc_html( $desc ) );
262
+			$out = sprintf('<label for="lasso--post-option-%s" class="checkbox-control checkbox"><input id="lasso--post-option-%s" type="checkbox" name="%s" class="checkbox"><span class="control-indicator"></span>%s', $id, $id, $id, esc_html($desc));
263 263
 			break;
264 264
 	}
265 265
 
Please login to merge, or discard this patch.
public/includes/assets.php 1 patch
Spacing   +92 added lines, -92 removed lines patch added patch discarded remove patch
@@ -10,24 +10,24 @@  discard block
 block discarded – undo
10 10
 
11 11
 class assets {
12 12
 
13
-	public function __construct(){
13
+	public function __construct() {
14 14
 
15
-		add_action('wp_enqueue_scripts', array($this,'scripts'));
15
+		add_action('wp_enqueue_scripts', array($this, 'scripts'));
16 16
 	}
17 17
 
18
-	public function scripts(){
18
+	public function scripts() {
19 19
 
20 20
 	
21 21
 		global $post;
22
-		if ( lasso_user_can('edit_posts') && 
23
-		     !( function_exists( 'is_gutenberg_page' ) && has_blocks( $post->post_content) )) {// bail if the post has Gutenberg bloc
22
+		if (lasso_user_can('edit_posts') && 
23
+		     !(function_exists('is_gutenberg_page') && has_blocks($post->post_content))) {// bail if the post has Gutenberg bloc
24 24
 			
25 25
 			/**    Returns the time offset from UTC
26 26
 			*/
27 27
 			function get_UTC_offset() {
28
-				$timezone_string = get_option( 'timezone_string' );
29
-				if (empty( $timezone_string ) ) {
30
-					return get_option('gmt_offset')*3600;
28
+				$timezone_string = get_option('timezone_string');
29
+				if (empty($timezone_string)) {
30
+					return get_option('gmt_offset') * 3600;
31 31
 				}
32 32
 				
33 33
 				$origin_dtz = new \DateTimeZone($timezone_string);				
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
 			wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true);
40 40
 
41 41
             //don't load autocomplete if it's a stockholm theme
42
-			$themename  	= wp_get_theme()->get('Name');
43
-			if ($themename !='Stockholm' ) {
42
+			$themename = wp_get_theme()->get('Name');
43
+			if ($themename != 'Stockholm') {
44 44
 				wp_enqueue_script('jquery-ui-autocomplete');
45 45
 			}
46 46
 			wp_enqueue_script('jquery-ui-draggable');
@@ -53,28 +53,28 @@  discard block
 block discarded – undo
53 53
 			// url for json api
54 54
 			$home_url = function_exists('json_get_url_prefix') ? json_get_url_prefix() : false;
55 55
 
56
-			$article_object 	= lasso_editor_get_option('article_class','lasso_editor');
56
+			$article_object 	= lasso_editor_get_option('article_class', 'lasso_editor');
57 57
 
58
-			$article_object 	= empty( $article_object ) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object;
58
+			$article_object 	= empty($article_object) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object;
59 59
 
60
-			$featImgClass 		= lasso_editor_get_option('featimg_class','lasso_editor');
61
-			if (empty( $featImgClass )) {
60
+			$featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor');
61
+			if (empty($featImgClass)) {
62 62
 				$featImgClass = lasso_get_supported_theme_featured_image_class();
63 63
 			}
64
-			$titleClass 		= lasso_editor_get_option('title_class','lasso_editor');
65
-			if (empty( $titleClass )) {
64
+			$titleClass = lasso_editor_get_option('title_class', 'lasso_editor');
65
+			if (empty($titleClass)) {
66 66
 				$titleClass = lasso_get_supported_theme_title_class();
67 67
 			}
68
-			$toolbar_headings  	= lasso_editor_get_option('toolbar_headings', 'lasso_editor');
69
-			$toolbar_headings_h4  	= lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
68
+			$toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor');
69
+			$toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
70 70
 			$objectsNoSave  	= lasso_editor_get_option('dont_save', 'lasso_editor');
71
-			$objectsNonEditable  	= lasso_editor_get_option('non_editable', 'lasso_editor');
71
+			$objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor');
72 72
 			$disableRESTSave = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor');
73
-			$save_to_post_disabled  = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' );
74
-			$edit_post_disabled  = lasso_editor_get_option( 'post_edit_disabled', 'lasso_editor' );
73
+			$save_to_post_disabled = lasso_editor_get_option('post_save_disabled', 'lasso_editor');
74
+			$edit_post_disabled = lasso_editor_get_option('post_edit_disabled', 'lasso_editor');
75 75
 			
76
-			$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor','b');
77
-			$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor','i');
76
+			$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor', 'b');
77
+			$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor', 'i');
78 78
 
79 79
 			
80 80
 			//text alignement
@@ -91,8 +91,8 @@  discard block
 block discarded – undo
91 91
 			
92 92
 			if ($show_color) {
93 93
 				//color picker
94
-				wp_enqueue_style( 'wp-color-picker' );
95
-				wp_enqueue_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 );
94
+				wp_enqueue_style('wp-color-picker');
95
+				wp_enqueue_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), false, 1);
96 96
 			}
97 97
 			
98 98
 			// click to insert components, not drag and drop
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 			
105 105
 			// custom fields
106 106
 			
107
-			$custom_fields = apply_filters( 'editus_custom_fields', null ); //array('testFieldName' => '#field1');
107
+			$custom_fields = apply_filters('editus_custom_fields', null); //array('testFieldName' => '#field1');
108 108
 
109 109
 
110 110
 
@@ -112,57 +112,57 @@  discard block
 block discarded – undo
112 112
 			$postid 			= get_the_ID();
113 113
 			$tz_offset = get_UTC_offset();
114 114
 			$post_date = get_the_time('U', $postid);
115
-			$time = (time()+$tz_offset);
115
+			$time = (time() + $tz_offset);
116 116
             $delta = $time - $post_date;
117 117
 
118 118
 			$strings = array(
119
-				'save' 				=> __('Save','lasso'),
120
-				'selectText'	  	=> __('Please Select Text First.','lasso'),
121
-				'cancel' 			=> __('Cancel','lasso'),
122
-				'exiteditor' 		=> __('Exit Editor','lasso'),
123
-				'saving' 			=> __('Saving...','lasso'),
124
-				'saved'				=> __('Saved!','lasso'),
125
-				'adding' 			=> __('Adding...','lasso'),
126
-				'added'				=> __('Added!','lasso'),
127
-				'loading' 			=> __('Loading...','lasso'),
128
-				'loadMore'			=> __('Load More','lasso'),
129
-				'close'			=> __('Close','lasso'),
130
-				'noPostsFound'		=> __('No more posts found','lasso'),
131
-				'fetchFail'	    	=> __('Fetching failed.','lasso'),
132
-				'galleryCreated' 	=> __('Gallery Created!','lasso'),
133
-				'galleryUpdated' 	=> __('Gallery Updated!','lasso'),
134
-				'justWrite'			=> __('Just write...','lasso'),
135
-				'chooseImage'		=> __('Choose an image','lasso'),
136
-				'updateImage'		=> __('Update Image','lasso'),
137
-				'insertImage'		=> __('Insert Image','lasso'),
138
-				'selectImage'		=> __('Select Image','lasso'),
139
-				'removeFeatImg'     => __('Remove featured image?','lasso'),
140
-				'updateSelectedImg' => __('Update Selected Image','lasso'),
141
-				'chooseImages'		=> __('Choose images','lasso'),
142
-				'editImage'			=> __('Edit Image','lasso'),
143
-				'addImages'			=> __('Add Images','lasso'),
144
-				'addNewGallery'		=> __('Add New Gallery','lasso'),
145
-				'selectGallery'		=> __('Select Editus Gallery Image','lasso'),
146
-				'useSelectedImages' => __('Use Selected Images','lasso'),
147
-				'publishPost'		=> __('Publish Post?','lasso'),
148
-				'publishYes'		=> __('Yes, publish it!','lasso'),
149
-				'deletePost'		=> __('Trash Post?','lasso'),
150
-				'deleteYes'			=> __('Yes, trash it!','lasso'),
151
-				'warning'			=> __('Oh snap!','laso'),
152
-				'cancelText'		=> __('O.K. got it!','lasso'),
153
-				'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'),
119
+				'save' 				=> __('Save', 'lasso'),
120
+				'selectText'	  	=> __('Please Select Text First.', 'lasso'),
121
+				'cancel' 			=> __('Cancel', 'lasso'),
122
+				'exiteditor' 		=> __('Exit Editor', 'lasso'),
123
+				'saving' 			=> __('Saving...', 'lasso'),
124
+				'saved'				=> __('Saved!', 'lasso'),
125
+				'adding' 			=> __('Adding...', 'lasso'),
126
+				'added'				=> __('Added!', 'lasso'),
127
+				'loading' 			=> __('Loading...', 'lasso'),
128
+				'loadMore'			=> __('Load More', 'lasso'),
129
+				'close'			=> __('Close', 'lasso'),
130
+				'noPostsFound'		=> __('No more posts found', 'lasso'),
131
+				'fetchFail'	    	=> __('Fetching failed.', 'lasso'),
132
+				'galleryCreated' 	=> __('Gallery Created!', 'lasso'),
133
+				'galleryUpdated' 	=> __('Gallery Updated!', 'lasso'),
134
+				'justWrite'			=> __('Just write...', 'lasso'),
135
+				'chooseImage'		=> __('Choose an image', 'lasso'),
136
+				'updateImage'		=> __('Update Image', 'lasso'),
137
+				'insertImage'		=> __('Insert Image', 'lasso'),
138
+				'selectImage'		=> __('Select Image', 'lasso'),
139
+				'removeFeatImg'     => __('Remove featured image?', 'lasso'),
140
+				'updateSelectedImg' => __('Update Selected Image', 'lasso'),
141
+				'chooseImages'		=> __('Choose images', 'lasso'),
142
+				'editImage'			=> __('Edit Image', 'lasso'),
143
+				'addImages'			=> __('Add Images', 'lasso'),
144
+				'addNewGallery'		=> __('Add New Gallery', 'lasso'),
145
+				'selectGallery'		=> __('Select Editus Gallery Image', 'lasso'),
146
+				'useSelectedImages' => __('Use Selected Images', 'lasso'),
147
+				'publishPost'		=> __('Publish Post?', 'lasso'),
148
+				'publishYes'		=> __('Yes, publish it!', 'lasso'),
149
+				'deletePost'		=> __('Trash Post?', 'lasso'),
150
+				'deleteYes'			=> __('Yes, trash it!', 'lasso'),
151
+				'warning'			=> __('Oh snap!', 'laso'),
152
+				'cancelText'		=> __('O.K. got it!', 'lasso'),
153
+				'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'),
154 154
 				'missingConfirm'	=> __('Update Settings', 'lasso'),
155
-				'helperText'		=> __('one more letter','lasso'),
155
+				'helperText'		=> __('one more letter', 'lasso'),
156 156
 				'editingBackup'  	=> __('You are currently editing a backup copy of this post.'),
157 157
 				
158 158
 				
159 159
 			);
160 160
 
161
-			$api_url = trailingslashit( home_url() ) . 'lasso-internal-api';
161
+			$api_url = trailingslashit(home_url()).'lasso-internal-api';
162 162
 
163 163
 			$gallery_class = new gallery();
164 164
 			$gallery_nonce_action = $gallery_class->nonce_action;
165
-			$gallery_nonce = wp_create_nonce( $gallery_nonce_action );
165
+			$gallery_nonce = wp_create_nonce($gallery_nonce_action);
166 166
 			
167 167
 			
168 168
             if ($allow_change_date) {
@@ -177,13 +177,13 @@  discard block
 block discarded – undo
177 177
 			  
178 178
 			if (function_exists('rest_url')) {
179 179
 				//$rest_root = esc_url_raw( rest_url());
180
-				$rest_nonce = wp_create_nonce( 'wp_rest' );
181
-				$settings = array( 'root' => $rest_root, 'nonce' => $rest_nonce );
182
-				wp_enqueue_script( 'wp-api', '', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
183
-				wp_localize_script( 'wp-api', 'wpApiSettings', $settings );
184
-				wp_localize_script( 'wp-api', 'WP_API_Settings', $settings );
180
+				$rest_nonce = wp_create_nonce('wp_rest');
181
+				$settings = array('root' => $rest_root, 'nonce' => $rest_nonce);
182
+				wp_enqueue_script('wp-api', '', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true);
183
+				wp_localize_script('wp-api', 'wpApiSettings', $settings);
184
+				wp_localize_script('wp-api', 'WP_API_Settings', $settings);
185 185
 				
186
-				if ( class_exists( 'WP_REST_Controller' )) {
186
+				if (class_exists('WP_REST_Controller')) {
187 187
 					// we are using REST API V2
188 188
 					$using_restapiv2 = true;
189 189
 				}
@@ -191,8 +191,8 @@  discard block
 block discarded – undo
191 191
 
192 192
 			// localized objects
193 193
 			$objects = array(
194
-				'ajaxurl' 			=> esc_url( $api_url ),
195
-				'ajaxurl2' 			=> esc_url( admin_url( 'admin-ajax.php' )),
194
+				'ajaxurl' 			=> esc_url($api_url),
195
+				'ajaxurl2' 			=> esc_url(admin_url('admin-ajax.php')),
196 196
 				'siteUrl'           => site_url(),
197 197
 				'rest_root'         => $rest_root,
198 198
 				'rest_nonce'        => $rest_nonce,
@@ -201,13 +201,13 @@  discard block
 block discarded – undo
201 201
 				'featImgClass'		=> $featImgClass,
202 202
 				'titleClass'		=> $titleClass,
203 203
 				'strings'			=> $strings,
204
-				'settingsLink'		=> function_exists('is_multisite') && is_multisite() ? network_admin_url( 'settings.php?page=lasso-editor' ) : admin_url( 'admin.php?page=lasso-editor-settings' ),
205
-				'post_status'		=> get_post_status( $postid ),
204
+				'settingsLink'		=> function_exists('is_multisite') && is_multisite() ? network_admin_url('settings.php?page=lasso-editor') : admin_url('admin.php?page=lasso-editor-settings'),
205
+				'post_status'		=> get_post_status($postid),
206 206
 				'postid'			=> $postid,
207 207
 				'permalink'			=> $permalink,
208 208
 				'edit_others_pages'	=> current_user_can('edit_others_pages') ? true : false,
209 209
 				'edit_others_posts'	=> current_user_can('edit_others_posts') ? true : false,
210
-				'userCanEdit'		=> current_user_can('edit_post', $postid ),
210
+				'userCanEdit'		=> current_user_can('edit_post', $postid),
211 211
 				'can_publish'		=> is_page() ? current_user_can('publish_pages') : current_user_can('publish_posts'),
212 212
 				//'can_publish_posts'	=> current_user_can('publish_posts'),
213 213
 				//'can_publish_pages'	=> current_user_can('publish_pages'),
@@ -243,28 +243,28 @@  discard block
 block discarded – undo
243 243
 				'postTags'    		=> lasso_get_objects('tag'),
244 244
 				'noResultsDiv'		=> lasso_editor_empty_results(),
245 245
 				'noRevisionsDiv'	=> lasso_editor_empty_results('revision'),
246
-				'mapTileProvider'   => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider( $postid ) : false,
247
-				'mapLocations'		=> get_post_meta( $postid, 'ase_map_component_locations' ),
248
-				'mapStart'			=> get_post_meta( $postid, 'ase_map_component_start_point', true ),
249
-				'mapZoom'			=> get_post_meta( $postid, 'ase_map_component_zoom', true ),
246
+				'mapTileProvider'   => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider($postid) : false,
247
+				'mapLocations'		=> get_post_meta($postid, 'ase_map_component_locations'),
248
+				'mapStart'			=> get_post_meta($postid, 'ase_map_component_start_point', true),
249
+				'mapZoom'			=> get_post_meta($postid, 'ase_map_component_zoom', true),
250 250
 				'revisionModal' 	=> lasso_editor_revision_modal(),
251 251
 				'isMobile'          => wp_is_mobile(),
252
-				'enableAutoSave'    => lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ),
252
+				'enableAutoSave'    => lasso_editor_get_option('enable_autosave', 'lasso_editor'),
253 253
 				'showColor'         => $show_color,
254 254
 				'showAlignment'     => $show_align,
255 255
 				'showIgnoredItems'  => lasso_editor_get_option('show_ignored_items', 'lasso_editor'),
256 256
 				'restapi2'          => $using_restapiv2,
257 257
 				'saveusingrest'     => $using_restapiv2 && !$disableRESTSave,
258
-				'newObjectContent'  => '<p>'.apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso') ).'</p>',
258
+				'newObjectContent'  => '<p>'.apply_filters('lasso_new_object_content', __('Once upon a time...', 'lasso')).'</p>',
259 259
 				'disableSavePost'   => $save_to_post_disabled,
260 260
 				'disableEditPost'   => $edit_post_disabled,
261 261
 				'boldTag'           => $bold_tag,
262 262
 				'iTag'           	=> $i_tag,
263 263
 				'customFields'      => $custom_fields,
264
-				'clickToInsert'     => ($insert_comp_ui =='click'),
265
-				'buttonOnEmptyP'     => ($insert_comp_ui =='mediumcom'),      // auto show a button to insert components on an empty paragraph      
264
+				'clickToInsert'     => ($insert_comp_ui == 'click'),
265
+				'buttonOnEmptyP'     => ($insert_comp_ui == 'mediumcom'), // auto show a button to insert components on an empty paragraph      
266 266
                 'rtl'               => is_rtl(),				
267
-				'skipToEdit'        =>( $delta < 10 && $delta >=0 ), // if it's a new post, skip to edit mode
267
+				'skipToEdit'        =>($delta < 10 && $delta >= 0), // if it's a new post, skip to edit mode
268 268
 				'linksEditable'    => $links_editable,
269 269
 				'supportPendingStatus' => !$no_pending_status
270 270
 			);
@@ -275,9 +275,9 @@  discard block
 block discarded – undo
275 275
 			
276 276
 			if (!$using_restapiv2) {
277 277
                // enqueue REST API V1
278
-			   wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
279
-			   $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) );
280
-			   wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings );
278
+			   wp_enqueue_script('wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true);
279
+			   $settings = array('root' => home_url($home_url), 'nonce' => wp_create_nonce('wp_json'));
280
+			   wp_localize_script('wp-api-js', 'WP_API_Settings', $settings);
281 281
 			}
282 282
 			
283 283
 			if ($allow_change_date) {
@@ -286,13 +286,13 @@  discard block
 block discarded – undo
286 286
 				wp_enqueue_style('jquery-ui');
287 287
 			}
288 288
 
289
-			$postfix = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? '' : '.min';
289
+			$postfix = (defined('SCRIPT_DEBUG') && true === SCRIPT_DEBUG) ? '' : '.min';
290 290
 			if ($show_color) {
291
-				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true);
291
+				wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api', 'iris'), LASSO_VERSION, true);
292 292
 			} else {
293
-			    wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
293
+			    wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
294 294
 			}
295
-			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) );
295
+			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects));
296 296
 
297 297
 
298 298
 		}
Please login to merge, or discard this patch.
public/includes/helpers.php 1 patch
Spacing   +84 added lines, -84 removed lines patch added patch discarded remove patch
@@ -12,24 +12,24 @@  discard block
 block discarded – undo
12 12
  * @return the option value
13 13
  * @since 1.0
14 14
  */
15
-if( !function_exists('lasso_editor_get_option')):
16
-	function lasso_editor_get_option( $option, $section, $default = '' ) {
15
+if (!function_exists('lasso_editor_get_option')):
16
+	function lasso_editor_get_option($option, $section, $default = '') {
17 17
 
18
-		if ( empty( $option ) )
18
+		if (empty($option))
19 19
 			return;
20 20
 
21
-		if ( function_exists( 'is_multisite' ) && is_multisite() ) {
21
+		if (function_exists('is_multisite') && is_multisite()) {
22 22
 
23
-			$options = get_site_option( $section );
23
+			$options = get_site_option($section);
24 24
 
25 25
 		} else {
26 26
 
27
-			$options = get_option( $section );
27
+			$options = get_option($section);
28 28
 		}
29 29
 		
30
-		$options = apply_filters( 'editus_filter_options', $options );
30
+		$options = apply_filters('editus_filter_options', $options);
31 31
 
32
-		if ( isset( $options[$option] ) ) {
32
+		if (isset($options[$option])) {
33 33
 			return $options[$option];
34 34
 		}
35 35
 
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
  */
45 45
 function lasso_editor_galleries_exist() {
46 46
 
47
-	$q = new wp_query( array( 'post_type' => 'ai_galleries', 'post_status' => 'publish' ) );
47
+	$q = new wp_query(array('post_type' => 'ai_galleries', 'post_status' => 'publish'));
48 48
 
49
-	if ( $q->have_posts() )
49
+	if ($q->have_posts())
50 50
 		return true;
51 51
 	else
52 52
 		return false;
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
 function lasso_get_supported_theme_class() {
62 62
 
63 63
 	$name  	= wp_get_theme()->get('Name');
64
-	$slug  	= lasso_clean_string( $name );
64
+	$slug  	= lasso_clean_string($name);
65 65
 
66
-	switch ( $slug ) {
66
+	switch ($slug) {
67 67
 		case 'aesop-story-theme': // aesop
68 68
 			$out = '.aesop-entry-content';
69 69
 			break;
@@ -112,16 +112,16 @@  discard block
 block discarded – undo
112 112
 
113 113
 	}
114 114
 
115
-	return apply_filters('lasso_content_class', !empty( $out ) ? $out : false);
115
+	return apply_filters('lasso_content_class', !empty($out) ? $out : false);
116 116
 	//return !empty( $out ) ? $out : false;
117 117
 }
118 118
 
119 119
 function lasso_get_supported_theme_title_class() {
120 120
 
121 121
 	$name  	= wp_get_theme()->get('Name');
122
-	$slug  	= lasso_clean_string( $name );
122
+	$slug  	= lasso_clean_string($name);
123 123
 
124
-	switch ( $slug ) {
124
+	switch ($slug) {
125 125
 
126 126
 		case 'aesop-story-theme': // aesop
127 127
 			$out = '.aesop-entry-title';
@@ -149,16 +149,16 @@  discard block
 block discarded – undo
149 149
 			break;
150 150
 	}
151 151
 
152
-	return apply_filters('lasso_title_class', !empty( $out ) ? $out : false);
152
+	return apply_filters('lasso_title_class', !empty($out) ? $out : false);
153 153
 }
154 154
 
155 155
 //since 0.9.9.6
156 156
 function lasso_get_supported_theme_featured_image_class() {
157 157
 
158 158
 	$name  	= wp_get_theme()->get('Name');
159
-	$slug  	= lasso_clean_string( $name );
159
+	$slug  	= lasso_clean_string($name);
160 160
 
161
-	return apply_filters('lasso_featured_image_class', !empty( $out ) ? $out : false);
161
+	return apply_filters('lasso_featured_image_class', !empty($out) ? $out : false);
162 162
 }
163 163
 
164 164
 
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 *	@since 0.8.7
170 170
 *	@return string of comma separated classes
171 171
 */
172
-function lasso_supported_no_save(){
172
+function lasso_supported_no_save() {
173 173
 
174 174
 	return apply_filters('lasso_dont_save', '.lasso--ignore,.sharedaddy,.us_wrapper,.meta,.edit-link,.ssba,.addtoany_share_save_container,.mashsb-container,.heateor_sss_sharing_container,.nc_socialPanel,.jp-relatedposts,.fb-comments,.adsbygoogle,.swp_social_panel');
175 175
 }
@@ -183,8 +183,8 @@  discard block
 block discarded – undo
183 183
  *
184 184
  * @return array|mixed|object|string|void
185 185
  */
186
-function lasso_sanitize_data( $data ) {
187
-	return \lasso\sanatize::do_sanitize( $data );
186
+function lasso_sanitize_data($data) {
187
+	return \lasso\sanatize::do_sanitize($data);
188 188
 
189 189
 }
190 190
 
@@ -194,18 +194,18 @@  discard block
 block discarded – undo
194 194
  *	@since 0.9.3
195 195
  *	@return string of comma delimited category slugs
196 196
 */
197
-function lasso_get_post_objects( $postid = '', $taxonomy = 'category') {
197
+function lasso_get_post_objects($postid = '', $taxonomy = 'category') {
198 198
 
199
-	if ( empty( $postid ) )
199
+	if (empty($postid))
200 200
 		$postid = get_the_ID();
201 201
 
202
-	$objects = 'category' == $taxonomy ? get_the_category( $postid ) : get_the_tags( $postid );
202
+	$objects = 'category' == $taxonomy ? get_the_category($postid) : get_the_tags($postid);
203 203
 
204
-	if ( empty( $objects) )
204
+	if (empty($objects))
205 205
 		return;
206 206
 
207 207
 	$out = '';
208
-	foreach( $objects as $object ) {
208
+	foreach ($objects as $object) {
209 209
 		//$out .= $object->slug.', ';
210 210
 		$out .= $object->name.',';
211 211
 	}
@@ -220,15 +220,15 @@  discard block
 block discarded – undo
220 220
  *	@since 0.9.3
221 221
  *	@return array all categoiries
222 222
 */
223
-function lasso_get_objects( $taxonomy = 'category' ) {
223
+function lasso_get_objects($taxonomy = 'category') {
224 224
 
225 225
 	$objects = 'category' == $taxonomy ? get_categories(array('hide_empty' => 0)) : get_tags(array('hide_empty' => 0));
226 226
 
227
-	if ( empty( $objects) )
227
+	if (empty($objects))
228 228
 		return;
229 229
 
230 230
 	$out = "";
231
-	foreach( $objects as $object ) {
231
+	foreach ($objects as $object) {
232 232
 		$out .= $object->name.',';
233 233
 	}
234 234
 
@@ -243,11 +243,11 @@  discard block
 block discarded – undo
243 243
  * @since 0.9.4
244 244
  */
245 245
 function lasso_post_types_names() {
246
-	$post_types = get_post_types( array(
246
+	$post_types = get_post_types(array(
247 247
 		'public' => true,
248
-	), 'objects' );
249
-	$post_types = array_combine( array_keys( $post_types ), wp_list_pluck( $post_types, 'label' ) );
250
-    unset( $post_types[ 'attachment' ] );
248
+	), 'objects');
249
+	$post_types = array_combine(array_keys($post_types), wp_list_pluck($post_types, 'label'));
250
+    unset($post_types['attachment']);
251 251
 
252 252
 	/**
253 253
 	 * Set which post types are allowed
@@ -256,14 +256,14 @@  discard block
 block discarded – undo
256 256
 	 *
257 257
 	 * @param array $allowed_post_types Array of names (not labels) of allowed post types. Must be registered.
258 258
 	 */
259
-	$allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( 'post', 'page') );
260
-	$allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
259
+	$allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array('post', 'page'));
260
+	$allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types);
261 261
 	if (!current_user_can('edit_pages')) {
262
-		$allowed_post_types = array_diff($allowed_post_types,array('page'));
262
+		$allowed_post_types = array_diff($allowed_post_types, array('page'));
263 263
 	}
264
-	foreach( $post_types as $name => $label ) {
265
-		if ( ! in_array( $name, $allowed_post_types ) ) {
266
-			unset( $post_types[ $name ] );
264
+	foreach ($post_types as $name => $label) {
265
+		if (!in_array($name, $allowed_post_types)) {
266
+			unset($post_types[$name]);
267 267
 		}
268 268
 	}
269 269
 	return $post_types;
@@ -271,10 +271,10 @@  discard block
 block discarded – undo
271 271
 
272 272
 
273 273
 function lasso_post_types() {
274
-	$post_types = get_post_types( array(
274
+	$post_types = get_post_types(array(
275 275
 		'public' => true,
276
-	), 'names' );
277
-    unset( $post_types[ 'attachment' ] );
276
+	), 'names');
277
+    unset($post_types['attachment']);
278 278
 
279 279
 	/**
280 280
 	 * Set which post types are allowed
@@ -283,11 +283,11 @@  discard block
 block discarded – undo
283 283
 	 *
284 284
 	 * @param array $allowed_post_types Array of names (not labels) of allowed post types. Must be registered.
285 285
 	 */
286
-	$allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( 'post') );
287
-	$allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
288
-	foreach( $post_types as $name => $label ) {
289
-		if ( ! in_array( $name, $allowed_post_types ) ) {
290
-			unset( $post_types[ $name ] );
286
+	$allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array('post'));
287
+	$allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types);
288
+	foreach ($post_types as $name => $label) {
289
+		if (!in_array($name, $allowed_post_types)) {
290
+			unset($post_types[$name]);
291 291
 		}
292 292
 	}
293 293
 	return $post_types;
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 	global $wp_post_types;
298 298
 	$post_types = lasso_post_types();
299 299
 	$rest_base = array();
300
-	foreach ( $post_types as $post_type) {
300
+	foreach ($post_types as $post_type) {
301 301
 		$rest_base[$post_type] = $wp_post_types[$post_type]->rest_base;
302 302
 	}
303 303
     
@@ -315,22 +315,22 @@  discard block
 block discarded – undo
315 315
 *	@uses lasso_modal_addons()
316 316
 *	@since 0.9.4
317 317
 */
318
-function lasso_modal_addons_content( $tab = '', $type ){
318
+function lasso_modal_addons_content($tab = '', $type) {
319 319
 
320
-	$name = lasso_clean_string( $tab['name'] );
320
+	$name = lasso_clean_string($tab['name']);
321 321
 
322
-	if ( 'tab' == $type ) {
322
+	if ('tab' == $type) {
323 323
 
324
-		$out = sprintf( '<li data-addon-name="%s">%s</li>', $name, $tab['name'] );
324
+		$out = sprintf('<li data-addon-name="%s">%s</li>', $name, $tab['name']);
325 325
 
326
-	} else if ( 'content' == $type ){
326
+	} else if ('content' == $type) {
327 327
 
328
-		$content = isset( $tab['content'] ) && is_callable( $tab['content'] ) ? call_user_func( $tab['content'] ) : false;
329
-		$options = isset( $tab['options'] ) && is_callable( $tab['options'] ) ? call_user_func( $tab['options'] ) : false;
328
+		$content = isset($tab['content']) && is_callable($tab['content']) ? call_user_func($tab['content']) : false;
329
+		$options = isset($tab['options']) && is_callable($tab['options']) ? call_user_func($tab['options']) : false;
330 330
 
331
-		$out = sprintf( '<div class="lasso--modal__content not-visible" data-addon-content="%s">
331
+		$out = sprintf('<div class="lasso--modal__content not-visible" data-addon-content="%s">
332 332
 			%s%s
333
-			</div>', $name, $content, lasso_option_form( $name, $options ) );
333
+			</div>', $name, $content, lasso_option_form($name, $options));
334 334
 
335 335
 	}
336 336
 
@@ -345,12 +345,12 @@  discard block
 block discarded – undo
345 345
 *
346 346
 * @return void|string
347 347
 */
348
-function lasso_clean_string( $string = '' ) {
348
+function lasso_clean_string($string = '') {
349 349
 
350
-	if ( empty( $string ) )
350
+	if (empty($string))
351 351
 		return;
352 352
 
353
-	return sanitize_text_field( strtolower( preg_replace('/[\s_]/', '-', $string ) ) );
353
+	return sanitize_text_field(strtolower(preg_replace('/[\s_]/', '-', $string)));
354 354
 }
355 355
 
356 356
 /**
@@ -363,13 +363,13 @@  discard block
 block discarded – undo
363 363
  *
364 364
  * @return void|string
365 365
  */
366
-function lasso_unclean_string( $string = '' ) {
366
+function lasso_unclean_string($string = '') {
367 367
 
368
-	if ( empty( $string ) ) {
368
+	if (empty($string)) {
369 369
 		return;
370 370
 	}
371 371
 
372
-	return sanitize_text_field( strtolower( str_replace( '-', '_', $string ) ) );
372
+	return sanitize_text_field(strtolower(str_replace('-', '_', $string)));
373 373
 }
374 374
 
375 375
 
@@ -384,40 +384,40 @@  discard block
 block discarded – undo
384 384
  * @param unknown $postid int the id of the post object to check against
385 385
  * @since 0.9.9.7 added filter 'lasso_user_can_filter'
386 386
  */
387
-if ( !function_exists( 'lasso_user_can' ) ):
388
-	function lasso_user_can( $action = '', $postid = 0 ) {
387
+if (!function_exists('lasso_user_can')):
388
+	function lasso_user_can($action = '', $postid = 0) {
389 389
         $result = false;
390
-		if ( empty( $action ) )
390
+		if (empty($action))
391 391
 			$action = 'edit_posts';
392 392
 
393
-		if ( empty( $postid ) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts')
393
+		if (empty($postid) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts')
394 394
 			$postid = get_the_ID();
395 395
 
396
-		if ( is_user_logged_in() && current_user_can( $action, $postid ) ) {
396
+		if (is_user_logged_in() && current_user_can($action, $postid)) {
397 397
 			// check against post types:
398
-			$allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( 'post', 'page') );
398
+			$allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array('post', 'page'));
399 399
 			
400 400
 			if (!current_user_can('edit_pages')) {
401
-				$allowed_post_types = array_diff($allowed_post_types,array('page'));
401
+				$allowed_post_types = array_diff($allowed_post_types, array('page'));
402 402
 			}
403 403
 			
404 404
             if (!empty($allowed_post_types) && !empty($postid)) {
405
-				$type = get_post_type( $postid );
406
-                $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
405
+				$type = get_post_type($postid);
406
+                $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types);
407 407
 				
408
-                if ( in_array( $type, $allowed_post_types ) ) {
409
-				   $result =  true;
408
+                if (in_array($type, $allowed_post_types)) {
409
+				   $result = true;
410 410
 			    }
411 411
             } else {
412 412
                 //we are not checking against a post, return true
413
-				$result =  true;
413
+				$result = true;
414 414
         	}
415 415
 		} else {
416 416
 			$result = false;
417 417
 		}
418 418
 		//if ( function_exists( 'is_gutenberg_page' ) && has_blocks() ) return false;
419 419
 		
420
-		return apply_filters( 'lasso_user_can_filter', $result,  $action, $postid);
420
+		return apply_filters('lasso_user_can_filter', $result, $action, $postid);
421 421
 	}
422 422
 endif;
423 423
 
@@ -426,25 +426,25 @@  discard block
 block discarded – undo
426 426
 *
427 427
 *	@since 0.9.5
428 428
 */
429
-if ( !function_exists('lasso_editor_empty_results') ):
429
+if (!function_exists('lasso_editor_empty_results')):
430 430
 
431
-	function lasso_editor_empty_results( $type = 'posts' ){
431
+	function lasso_editor_empty_results($type = 'posts') {
432 432
 
433
-		if ( 'posts' == $type ) {
433
+		if ('posts' == $type) {
434 434
 
435
-			$string = apply_filters('lasso_empty_state_message', __('No posts to show', 'lasso') );
435
+			$string = apply_filters('lasso_empty_state_message', __('No posts to show', 'lasso'));
436 436
 			$icon = 'lasso-icon-file-text2';
437 437
 			$button = false;
438 438
 
439
-		} elseif ( 'revision' == $type ) {
439
+		} elseif ('revision' == $type) {
440 440
 
441
-			$string = apply_filters('lasso_empty_state_message', __('No revisions found', 'lasso') );
441
+			$string = apply_filters('lasso_empty_state_message', __('No revisions found', 'lasso'));
442 442
 			$icon = 'lasso-icon-history';
443
-			$button = sprintf('<a href="#" class="lasso--btn-secondary" id="lasso--close-modal">%s</a>', __('Close','lasso') );
443
+			$button = sprintf('<a href="#" class="lasso--btn-secondary" id="lasso--close-modal">%s</a>', __('Close', 'lasso'));
444 444
 
445 445
 		}
446 446
 
447
-		return sprintf('<div id="lasso--empty-state" class="lasso--empty-state"><i class="lasso--empty-state-icon lasso-icon %s"></i><p>%s</p>%s</div>', $icon, $string, $button );
447
+		return sprintf('<div id="lasso--empty-state" class="lasso--empty-state"><i class="lasso--empty-state-icon lasso-icon %s"></i><p>%s</p>%s</div>', $icon, $string, $button);
448 448
 	}
449 449
 
450 450
 endif;
Please login to merge, or discard this patch.
public/includes/lasso.php 1 patch
Spacing   +113 added lines, -113 removed lines patch added patch discarded remove patch
@@ -52,21 +52,21 @@  discard block
 block discarded – undo
52 52
 		require_once LASSO_DIR.'/public/includes/wrap-shortcodes.php';
53 53
 
54 54
 		// Activate plugin when new blog is added
55
-		add_action( 'wpmu_new_blog', array( $this, 'activate_new_site' ) );
55
+		add_action('wpmu_new_blog', array($this, 'activate_new_site'));
56 56
 
57 57
 		// Load plugin text domain
58
-		add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
58
+		add_action('init', array($this, 'load_plugin_textdomain'));
59 59
 		
60
-		add_action( 'wp_ajax_get_aesop_component',     array( $this, 'get_aesop_component' ) );
61
-		add_action( 'wp_ajax_editus_do_shortcode',     array( $this, 'editus_do_shortcode' ) );
62
-		add_action( 'wp_ajax_editus_lock_post',     array( $this, 'editus_lock_post' ) );
63
-		add_action( 'wp_ajax_editus_unlock_post',     array( $this, 'editus_unlock_post' ) );
64
-		add_action( 'wp_ajax_editus_hide_tour',     array( $this, 'editus_hide_tour' ) );
65
-		add_action( 'wp_ajax_editus_set_post_setting',     array( $this, 'editus_set_post_setting' ) );
66
-		add_action( 'wp_ajax_editus_get_ase_options',     array( $this, 'get_ase_options' ) );
67
-		add_action( 'wp_ajax_editus_delete_post',     array( $this, 'delete_post' ) );
68
-		add_action( 'wp_ajax_editus_featured_img',     array( $this, 'set_featured_img' ) );
69
-		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_lock_post', array($this, 'editus_lock_post'));
63
+		add_action('wp_ajax_editus_unlock_post', array($this, 'editus_unlock_post'));
64
+		add_action('wp_ajax_editus_hide_tour', array($this, 'editus_hide_tour'));
65
+		add_action('wp_ajax_editus_set_post_setting', array($this, 'editus_set_post_setting'));
66
+		add_action('wp_ajax_editus_get_ase_options', array($this, 'get_ase_options'));
67
+		add_action('wp_ajax_editus_delete_post', array($this, 'delete_post'));
68
+		add_action('wp_ajax_editus_featured_img', array($this, 'set_featured_img'));
69
+		add_action('wp_ajax_editus_del_featured_img', array($this, 'del_featured_img'));
70 70
 
71 71
 		// enable saving custom fields through REST API
72 72
 		self::enable_metasave('post');
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 	public static function get_instance() {
98 98
 
99 99
 		// If the single instance hasn't been set, set it now.
100
-		if ( null == self::$instance ) {
100
+		if (null == self::$instance) {
101 101
 			self::$instance = new self;
102 102
 		}
103 103
 
@@ -114,18 +114,18 @@  discard block
 block discarded – undo
114 114
 	 *                                       WPMU is disabled or plugin is
115 115
 	 *                                       activated on an individual blog.
116 116
 	 */
117
-	public static function activate( $network_wide ) {
117
+	public static function activate($network_wide) {
118 118
 
119
-		if ( function_exists( 'is_multisite' ) && is_multisite() ) {
119
+		if (function_exists('is_multisite') && is_multisite()) {
120 120
 
121
-			if ( $network_wide  ) {
121
+			if ($network_wide) {
122 122
 
123 123
 				// Get all blog ids
124 124
 				$blog_ids = self::get_blog_ids();
125 125
 
126
-				foreach ( $blog_ids as $blog_id ) {
126
+				foreach ($blog_ids as $blog_id) {
127 127
 
128
-					switch_to_blog( $blog_id );
128
+					switch_to_blog($blog_id);
129 129
 					self::single_activate();
130 130
 				}
131 131
 
@@ -151,18 +151,18 @@  discard block
 block discarded – undo
151 151
 	 *                                       WPMU is disabled or plugin is
152 152
 	 *                                       deactivated on an individual blog.
153 153
 	 */
154
-	public static function deactivate( $network_wide ) {
154
+	public static function deactivate($network_wide) {
155 155
 
156
-		if ( function_exists( 'is_multisite' ) && is_multisite() ) {
156
+		if (function_exists('is_multisite') && is_multisite()) {
157 157
 
158
-			if ( $network_wide ) {
158
+			if ($network_wide) {
159 159
 
160 160
 				// Get all blog ids
161 161
 				$blog_ids = self::get_blog_ids();
162 162
 
163
-				foreach ( $blog_ids as $blog_id ) {
163
+				foreach ($blog_ids as $blog_id) {
164 164
 
165
-					switch_to_blog( $blog_id );
165
+					switch_to_blog($blog_id);
166 166
 					self::single_deactivate();
167 167
 
168 168
 				}
@@ -186,13 +186,13 @@  discard block
 block discarded – undo
186 186
 	 *
187 187
 	 * @param int     $blog_id ID of the new blog.
188 188
 	 */
189
-	public function activate_new_site( $blog_id ) {
189
+	public function activate_new_site($blog_id) {
190 190
 
191
-		if ( 1 !== did_action( 'wpmu_new_blog' ) ) {
191
+		if (1 !== did_action('wpmu_new_blog')) {
192 192
 			return;
193 193
 		}
194 194
 
195
-		switch_to_blog( $blog_id );
195
+		switch_to_blog($blog_id);
196 196
 		self::single_activate();
197 197
 		restore_current_blog();
198 198
 
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 			WHERE archived = '0' AND spam = '0'
218 218
 			AND deleted = '0'";
219 219
 
220
-		return $wpdb->get_col( $sql );
220
+		return $wpdb->get_col($sql);
221 221
 
222 222
 	}
223 223
 
@@ -228,18 +228,18 @@  discard block
 block discarded – undo
228 228
 	 */
229 229
 	private static function single_activate() {
230 230
 
231
-		$curr_version = get_option( 'lasso_version' );
231
+		$curr_version = get_option('lasso_version');
232 232
 
233 233
 		// update upgraded from
234
-		if ( $curr_version ) {
235
-			update_option( 'lasso_updated_from', $curr_version );
234
+		if ($curr_version) {
235
+			update_option('lasso_updated_from', $curr_version);
236 236
 		}
237 237
 
238 238
 		// update lasso version option
239
-		update_option( 'lasso_version', LASSO_VERSION );
239
+		update_option('lasso_version', LASSO_VERSION);
240 240
 
241 241
 		// set transietn for activation welcome
242
-		set_transient( '_lasso_welcome_redirect', true, 30 );
242
+		set_transient('_lasso_welcome_redirect', true, 30);
243 243
 
244 244
 
245 245
 	}
@@ -261,15 +261,15 @@  discard block
 block discarded – undo
261 261
 	public function load_plugin_textdomain() {
262 262
 
263 263
 		$domain = $this->plugin_slug;
264
-		$locale = apply_filters( 'plugin_locale', get_locale(), $domain );
264
+		$locale = apply_filters('plugin_locale', get_locale(), $domain);
265 265
 
266
-		$out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' );
266
+		$out = load_textdomain($domain, trailingslashit(LASSO_DIR).'languages/'.$domain.'-'.$locale.'.mo');
267 267
 	}
268 268
 	
269 269
     // new ajax function to lock post for editing
270 270
 	public function editus_lock_post()
271 271
 	{
272
-		$post_id= $_POST["postid"];
272
+		$post_id = $_POST["postid"];
273 273
 		$locked = wp_check_post_lock($post_id);
274 274
 		
275 275
 		if (!$locked) {
@@ -277,16 +277,16 @@  discard block
 block discarded – undo
277 277
 			echo "true";
278 278
 		} else {
279 279
 			$user_info = get_userdata($locked);
280
-			echo "Post opened by ".$user_info->first_name .  " " . $user_info->last_name;
280
+			echo "Post opened by ".$user_info->first_name." ".$user_info->last_name;
281 281
 		}
282 282
 		exit;
283 283
 	}
284 284
 	
285 285
 	public function editus_unlock_post()
286 286
 	{
287
-		$post_id= $_POST["postid"];
287
+		$post_id = $_POST["postid"];
288 288
 		$locked = wp_check_post_lock($post_id);
289
-		delete_post_meta( $post_id, '_edit_lock');
289
+		delete_post_meta($post_id, '_edit_lock');
290 290
 		echo "true";
291 291
 		
292 292
 		exit;
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 	{
298 298
 		$user_id = get_current_user_ID();
299 299
 				
300
-		update_user_meta( $user_id, 'lasso_hide_tour', true );
300
+		update_user_meta($user_id, 'lasso_hide_tour', true);
301 301
 		exit;
302 302
 	}
303 303
 	
@@ -308,14 +308,14 @@  discard block
 block discarded – undo
308 308
 		$data = array();
309 309
 		parse_str($_POST['data'], $data);
310 310
 		
311
-		if (!wp_verify_nonce( $data[ 'nonce' ], 'lasso-update-post-settings' )) {
311
+		if (!wp_verify_nonce($data['nonce'], 'lasso-update-post-settings')) {
312 312
 			wp_send_json_error();
313 313
 			exit;
314 314
 		}
315 315
 		
316
-		$status = isset( $data['status'] ) ? $data['status'] : false;
317
-		$postid = isset( $data['postid'] ) ? $data['postid'] : false;
318
-		$slug   = isset( $data['story_slug'] ) ? $data['story_slug'] : false;
316
+		$status = isset($data['status']) ? $data['status'] : false;
317
+		$postid = isset($data['postid']) ? $data['postid'] : false;
318
+		$slug   = isset($data['story_slug']) ? $data['story_slug'] : false;
319 319
 	
320 320
 
321 321
 		$args = array(
@@ -326,24 +326,24 @@  discard block
 block discarded – undo
326 326
 		
327 327
 		
328 328
 
329
-		wp_update_post( apply_filters( 'lasso_object_status_update_args', $args ) );
329
+		wp_update_post(apply_filters('lasso_object_status_update_args', $args));
330 330
 		
331 331
 		// update categories
332
-		$cats  = isset( $data['story_cats'] ) ? $data['story_cats'] : false;
332
+		$cats = isset($data['story_cats']) ? $data['story_cats'] : false;
333 333
 		
334
-		self::set_post_terms( $postid, $cats, 'category' );
334
+		self::set_post_terms($postid, $cats, 'category');
335 335
 		
336 336
 		// update tags
337
-		$tags = isset( $data['story_tags'] ) ? $data['story_tags'] : false;
338
-		self::set_post_terms( $postid, $tags, 'post_tag' );
337
+		$tags = isset($data['story_tags']) ? $data['story_tags'] : false;
338
+		self::set_post_terms($postid, $tags, 'post_tag');
339 339
 		
340 340
 		//update date
341
-		$date  = isset( $data['post_date'] ) ? $data['post_date'] : false;
342
-		self::set_date( $postid, $date );
341
+		$date = isset($data['post_date']) ? $data['post_date'] : false;
342
+		self::set_date($postid, $date);
343 343
 		
344
-		do_action( 'lasso_post_updated', $postid, $slug, $status, get_current_user_ID() );
345
-		$response= array(
346
-			'link'   => get_permalink($postid). (($status=='publish') ? '' : '&preview=true')
344
+		do_action('lasso_post_updated', $postid, $slug, $status, get_current_user_ID());
345
+		$response = array(
346
+			'link'   => get_permalink($postid).(($status == 'publish') ? '' : '&preview=true')
347 347
 		);
348 348
 		wp_send_json_success($response);
349 349
 		exit;
@@ -351,11 +351,11 @@  discard block
 block discarded – undo
351 351
 	
352 352
 	public static function enable_metasave($type)
353 353
 	{
354
-		register_rest_field( $type, 'metadata', array(
355
-			'get_callback' => function ( $data ) {
356
-				return get_post_meta( $data['id']);//, '', '' );
354
+		register_rest_field($type, 'metadata', array(
355
+			'get_callback' => function($data) {
356
+				return get_post_meta($data['id']); //, '', '' );
357 357
 			}, 
358
-			'update_callback' => function( $data, $post ) {
358
+			'update_callback' => function($data, $post) {
359 359
 				foreach ($data as $key => $value) {
360 360
 					update_post_meta($post->ID, $key, $value);
361 361
 				}
@@ -367,13 +367,13 @@  discard block
 block discarded – undo
367 367
 	public function editus_do_shortcode()
368 368
 	{
369 369
 		
370
-		$code= $_POST["code"];
370
+		$code = $_POST["code"];
371 371
 		$code = str_replace('\"', '"', $code);
372 372
 		
373
-		$code_wrapped = lasso_wrap_shortcodes( $code);
374
-		$out =  do_shortcode($code);
373
+		$code_wrapped = lasso_wrap_shortcodes($code);
374
+		$out = do_shortcode($code);
375 375
 		if ($out != '') {
376
-			$out =  do_shortcode($code_wrapped);
376
+			$out = do_shortcode($code_wrapped);
377 377
 			echo $out;
378 378
 			exit;
379 379
 		}
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 		/** @var \WP_Embed $wp_embed */
384 384
 		global $wp_embed;
385 385
 		$wp_embed->post_ID = $_POST["ID"];
386
-		$out =$wp_embed->run_shortcode( $code_wrapped );
386
+		$out = $wp_embed->run_shortcode($code_wrapped);
387 387
 		
388 388
 		echo $out;
389 389
 		exit;
@@ -393,53 +393,53 @@  discard block
 block discarded – undo
393 393
 	{
394 394
 		
395 395
 		
396
-		$code= $_POST["code"];
396
+		$code = $_POST["code"];
397 397
 		$atts = array(
398 398
 		 );
399 399
 		foreach ($_POST as $key => $value) {
400
-			if ($key !="code" && $key !="action") {
400
+			if ($key != "code" && $key != "action") {
401 401
 			    //$shortcode = $shortcode.$key.'="'.$value.'" ';
402 402
 				$atts[$key] = $value;
403 403
 			}
404 404
 		}
405 405
 		if ($code == "aesop_video") {
406
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
406
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
407 407
 		    echo aesop_video_shortcode($atts);
408 408
 		}
409 409
 		else if ($code == "aesop_image") {
410
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
410
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
411 411
 		    echo aesop_image_shortcode($atts);
412 412
 		}
413 413
 		else if ($code == "aesop_quote") {
414
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
414
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
415 415
 		    echo aesop_quote_shortcode($atts);
416 416
 		}
417 417
 		else if ($code == "aesop_parallax") {
418
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
418
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
419 419
 		    echo aesop_parallax_shortcode($atts);
420 420
 		}
421 421
 		else if ($code == "aesop_character") {
422
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
422
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
423 423
 		    echo aesop_character_shortcode($atts);
424 424
 		}
425 425
 		else if ($code == "aesop_collection") {
426
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
426
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
427 427
 		    echo aesop_collection_shortcode($atts);
428 428
 		}
429 429
 		else if ($code == "aesop_chapter") {
430
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
430
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
431 431
 		    echo aesop_chapter_shortcode($atts);
432 432
 		}
433 433
 		else if ($code == "aesop_content") {
434
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
434
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
435 435
 		    echo aesop_content_shortcode($atts, $atts['content_data']);
436 436
 		}
437 437
 		else if ($code == "aesop_gallery") {
438
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
439
-		    echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
438
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
439
+		    echo do_shortcode('[aesop_gallery id="'.$atts["id"].'"]');
440 440
 		}
441 441
 		else if ($code == "aesop_audio") {
442
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
442
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
443 443
 		    echo aesop_audio_shortcode($atts);
444 444
 		}
445 445
 		else {
@@ -460,20 +460,20 @@  discard block
 block discarded – undo
460 460
 	public function get_ase_options()
461 461
 	{
462 462
 		$blob = lasso_editor_options_blob();
463
-		$code= $_POST["component"];
463
+		$code = $_POST["component"];
464 464
 		echo $blob[$code];
465 465
 		exit; 
466 466
 	}
467 467
 	
468 468
 	public function delete_post( ) {
469 469
 
470
-		$postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
470
+		$postid = isset($_POST['postid']) ? $_POST['postid'] : false;
471 471
 
472 472
 		// bail out if teh current user can't publish posts
473
-		if ( !lasso_user_can( 'delete_post', $postid ) )
473
+		if (!lasso_user_can('delete_post', $postid))
474 474
 			return;
475 475
 		
476
-		if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_delete_post' )) {
476
+		if (!wp_verify_nonce($_POST['nonce'], 'lasso_delete_post')) {
477 477
 			wp_send_json_error();
478 478
 			exit;
479 479
 		}
@@ -483,40 +483,40 @@  discard block
 block discarded – undo
483 483
 			'post_status' 	=> 'trash'
484 484
 		);
485 485
 
486
-		wp_update_post( apply_filters( 'lasso_object_deleted_args', $args ) );
486
+		wp_update_post(apply_filters('lasso_object_deleted_args', $args));
487 487
 
488
-		do_action( 'lasso_object_deleted', $postid, get_current_user_ID() );
488
+		do_action('lasso_object_deleted', $postid, get_current_user_ID());
489 489
 
490 490
 		exit;
491 491
 	}
492 492
 	
493 493
 	public function set_featured_img( ) {
494 494
 
495
-		$postid  	= isset( $_POST['postid'] ) ? $_POST['postid'] : false;
496
-		$image_id  	= isset( $_POST['image_id'] ) ? absint( $_POST['image_id'] ) : false;
497
-		if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_gallery' )) {
495
+		$postid = isset($_POST['postid']) ? $_POST['postid'] : false;
496
+		$image_id = isset($_POST['image_id']) ? absint($_POST['image_id']) : false;
497
+		if (!wp_verify_nonce($_POST['nonce'], 'lasso_gallery')) {
498 498
 			wp_send_json_error();
499 499
 			exit;
500 500
 		}	
501 501
 
502
-		set_post_thumbnail( $postid, $image_id );
502
+		set_post_thumbnail($postid, $image_id);
503 503
 
504
-		do_action( 'lasso_featured_image_set', $postid, $image_id, get_current_user_ID() );
504
+		do_action('lasso_featured_image_set', $postid, $image_id, get_current_user_ID());
505 505
 
506 506
 		exit;
507 507
 	}
508 508
 	
509 509
 	public function del_featured_img( ) {
510 510
 
511
-		$postid  = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
512
-		if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_gallery' )) {
511
+		$postid = isset($_POST['postid']) ? $_POST['postid'] : false;
512
+		if (!wp_verify_nonce($_POST['nonce'], 'lasso_gallery')) {
513 513
 			wp_send_json_error();
514 514
 			exit;
515 515
 		}	
516 516
 
517
-		delete_post_thumbnail( $postid );
517
+		delete_post_thumbnail($postid);
518 518
 
519
-		do_action( 'lasso_featured_image_deleted', $postid, get_current_user_ID() );
519
+		do_action('lasso_featured_image_deleted', $postid, get_current_user_ID());
520 520
 
521 521
 		exit;
522 522
 	}
@@ -537,17 +537,17 @@  discard block
 block discarded – undo
537 537
 		return self::$revisions;
538 538
 	}*/
539 539
 	
540
-	public function set_post_terms( $postid, $value, $taxonomy ) {
541
-		if( $value ) {
542
-			$value = explode( ',', $value );
543
-			$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
540
+	public function set_post_terms($postid, $value, $taxonomy) {
541
+		if ($value) {
542
+			$value = explode(',', $value);
543
+			$allow_new_category = lasso_editor_get_option('allow_new_category', 'lasso_editor');
544 544
 			
545
-			if ($taxonomy =='category') {
545
+			if ($taxonomy == 'category') {
546 546
                 // convert from names to category ids
547 547
 				$cats = array();
548 548
 				foreach ($value as $cat) {
549 549
 					$cat_id = get_cat_ID($cat);
550
-					if ($cat_id !=0) {
550
+					if ($cat_id != 0) {
551 551
 						$cats [] = $cat_id;
552 552
 					} else if ($allow_new_category) {
553 553
 					    $cats [] = wp_create_category($cat);
@@ -556,47 +556,47 @@  discard block
 block discarded – undo
556 556
 				$value = $cats;
557 557
 			}
558 558
 	
559
-			$result = wp_set_object_terms( $postid, $value, $taxonomy );
559
+			$result = wp_set_object_terms($postid, $value, $taxonomy);
560 560
 		}
561
-		else  {
561
+		else {
562 562
 			//remove all terms from post
563
-			$result = wp_set_object_terms( $postid, null, $taxonomy );
563
+			$result = wp_set_object_terms($postid, null, $taxonomy);
564 564
 		}
565 565
 
566
-		if ( ! is_wp_error( $result ) ) {
566
+		if (!is_wp_error($result)) {
567 567
 			return true;
568
-		}else{
568
+		} else {
569 569
 			return false;
570 570
 		}
571 571
 	}
572 572
 	
573
-	function getEnglishMonthName($foreignMonthName){
573
+	function getEnglishMonthName($foreignMonthName) {
574 574
 
575 575
 		  setlocale(LC_ALL, 'en_US');
576 576
 
577
-		  $month_numbers = range(1,12);
577
+		  $month_numbers = range(1, 12);
578 578
 
579
-		  foreach($month_numbers as $month)
580
-			$english_months[] = strftime('%B',mktime(0,0,0,$month,1,2011));
579
+		  foreach ($month_numbers as $month)
580
+			$english_months[] = strftime('%B', mktime(0, 0, 0, $month, 1, 2011));
581 581
 
582 582
 		  setlocale(LC_ALL, get_locale());
583 583
 
584
-		  foreach($month_numbers as $month)
585
-			$foreign_months[] = utf8_encode(strftime('%B',mktime(0,0,0,$month,1,2011)));
584
+		  foreach ($month_numbers as $month)
585
+			$foreign_months[] = utf8_encode(strftime('%B', mktime(0, 0, 0, $month, 1, 2011)));
586 586
 
587 587
 		  return str_replace($foreign_months, $english_months, $foreignMonthName);
588 588
 	}
589 589
 
590 590
 
591 591
 	
592
-	public function set_date( $postid, $value) {
593
-		if( $value ) {
594
-			$value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time( 'timestamp', 1 ));
592
+	public function set_date($postid, $value) {
593
+		if ($value) {
594
+			$value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time('timestamp', 1));
595 595
             wp_update_post(
596
-				array (
596
+				array(
597 597
 					'ID'            => $postid, // ID of the post to update
598
-					'post_date'     => date( 'Y-m-d H:i:s',  strtotime($value) ),
599
-					'post_date_gmt'     => gmdate( 'Y-m-d H:i:s',  strtotime($value) ),
598
+					'post_date'     => date('Y-m-d H:i:s', strtotime($value)),
599
+					'post_date_gmt'     => gmdate('Y-m-d H:i:s', strtotime($value)),
600 600
 				)
601 601
 			);
602 602
 		}
Please login to merge, or discard this patch.
admin/includes/menus/settings.php 1 patch
Spacing   +149 added lines, -149 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,41 +95,41 @@  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_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
111
-		$shortcodify_disabled  = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' );
112
-		$enable_autosave  = lasso_editor_get_option( 'enable_autosave', 'lasso_editor' );
113
-
114
-		$use_old_ui      = lasso_editor_get_option( 'use_old_ui', 'lasso_editor' );
115
-		$toolbar_headings      = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' );
116
-		$toolbar_headings_h4      = lasso_editor_get_option( 'toolbar_headings_h4', 'lasso_editor' );
117
-		$toolbar_list      = lasso_editor_get_option( 'toolbar_list', 'lasso_editor' );
118
-		$toolbar_show_color      = lasso_editor_get_option( 'toolbar_show_color', 'lasso_editor' );
119
-		$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_new_category = lasso_editor_get_option('allow_new_category', 'lasso_editor');
111
+		$shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor');
112
+		$enable_autosave = lasso_editor_get_option('enable_autosave', 'lasso_editor');
113
+
114
+		$use_old_ui = lasso_editor_get_option('use_old_ui', 'lasso_editor');
115
+		$toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor');
116
+		$toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
117
+		$toolbar_list = lasso_editor_get_option('toolbar_list', 'lasso_editor');
118
+		$toolbar_show_color      = lasso_editor_get_option('toolbar_show_color', 'lasso_editor');
119
+		$toolbar_show_alignment  = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor');
120 120
 		
121
-		$objectsNoSave  	= lasso_editor_get_option('dont_save', 'lasso_editor');
122
-		$objectsNonEditable  	= lasso_editor_get_option('non_editable', 'lasso_editor');
121
+		$objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor');
122
+		$objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor');
123 123
 		$disable_tour = lasso_editor_get_option('disable_tour', 'lasso_editor');
124 124
 		$show_ignored_items = lasso_editor_get_option('show_ignored_items', 'lasso_editor');
125 125
 		$save_using_rest_disabled = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor');
126 126
 		
127
-		$default_post_types = apply_filters( 'lasso_allowed_post_types', array( 'post', 'page'));
128
-		$allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor',  $default_post_types);
127
+		$default_post_types = apply_filters('lasso_allowed_post_types', array('post', 'page'));
128
+		$allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', $default_post_types);
129 129
 		
130 130
 		$links_editable = lasso_editor_get_option('links_editable', 'lasso_editor', false);
131
-		$bold_tag = lasso_editor_get_option( 'bold_tag', 'lasso_editor',  "b");
132
-		$i_tag = lasso_editor_get_option( 'i_tag', 'lasso_editor',  "i");
131
+		$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor', "b");
132
+		$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor', "i");
133 133
 		
134 134
 		// do we support pending status
135 135
 		$no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor');
@@ -144,31 +144,31 @@  discard block
 block discarded – undo
144 144
 ?>
145 145
 		<div class="wrap">
146 146
 
147
-	    	<h2><?php _e( 'Editus Settings', 'lasso' );?></h2>
147
+	    	<h2><?php _e('Editus Settings', 'lasso'); ?></h2>
148 148
 
149 149
 			<form id="lasso-editor-settings-form" class="lasso--form-settings" method="post" enctype="multipart/form-data">
150 150
 
151
-				<?php do_action('lasso_settings_before');?>
151
+				<?php do_action('lasso_settings_before'); ?>
152 152
 				
153 153
 				
154 154
 				
155
-				<h3><?php _e( 'Enable for:', 'lasso' );?></h3>
155
+				<h3><?php _e('Enable for:', 'lasso'); ?></h3>
156 156
 				<div class="lasso-editor-settings--option-wrap">
157 157
 					<div class="lasso-editor-settings--option-inner">
158 158
 						
159
-						<span class="lasso--setting-description"><?php _e( 'Enable Editus for the following post types.', 'lasso' );?></span>
159
+						<span class="lasso--setting-description"><?php _e('Enable Editus for the following post types.', 'lasso'); ?></span>
160 160
 						<?php
161 161
 						$args = array(
162 162
 							'public'   => true
163 163
 						);
164 164
 						 
165
-						$allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
166
-						$post_types = get_post_types( $args, 'objects' );
165
+						$allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types);
166
+						$post_types = get_post_types($args, 'objects');
167 167
 						 
168
-						foreach ( $post_types  as $post_type ) {
168
+						foreach ($post_types  as $post_type) {
169 169
 						   if ($post_type->name == 'attachment') continue;
170
-						   $checked ="";
171
-						   if (  in_array( $post_type->name, $allowed_post_types )  ) {
170
+						   $checked = "";
171
+						   if (in_array($post_type->name, $allowed_post_types)) {
172 172
 								$checked = 'checked="checked"';
173 173
 						   }
174 174
 						   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>';
@@ -178,111 +178,111 @@  discard block
 block discarded – undo
178 178
 				</div>
179 179
 				
180 180
 
181
-				<h3><?php _e( 'Internal Settings', 'lasso' );?></h3>
181
+				<h3><?php _e('Internal Settings', 'lasso'); ?></h3>
182 182
 				<div class="lasso-editor-settings--option-wrap">
183 183
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
184
-						<label><?php _e( 'Article Class', 'lasso' );?></label>
185
-						<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>
186
-						<input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr( $article_object );?>" placeholder=".entry-content">
184
+						<label><?php _e('Article Class', 'lasso'); ?></label>
185
+						<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>
186
+						<input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr($article_object); ?>" placeholder=".entry-content">
187 187
 					</div>
188 188
 				
189 189
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
190
-						<label><?php _e( 'Featured Image Class', 'lasso' );?></label>
191
-						<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>
192
-						<input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr( $featImgClass );?>" placeholder=".entry-content">
190
+						<label><?php _e('Featured Image Class', 'lasso'); ?></label>
191
+						<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>
192
+						<input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr($featImgClass); ?>" placeholder=".entry-content">
193 193
 					</div>
194 194
 				
195 195
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
196
-						<label><?php _e( 'Article Title Class', 'lasso' );?></label>
197
-						<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>
198
-						<input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr( $titleClass );?>" placeholder=".entry-content">
196
+						<label><?php _e('Article Title Class', 'lasso'); ?></label>
197
+						<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>
198
+						<input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr($titleClass); ?>" placeholder=".entry-content">
199 199
 					</div>
200 200
 				
201 201
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
202
-						<label><?php _e( 'Ignored Items to Save', 'lasso' );?></label>
203
-						<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>
204
-						<textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNoSave );?></textarea>
202
+						<label><?php _e('Ignored Items to Save', 'lasso'); ?></label>
203
+						<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>
204
+						<textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr($objectsNoSave); ?></textarea>
205 205
 					</div>
206 206
 				
207 207
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
208
-						<label><?php _e( 'Read Only Items', 'lasso' );?></label>
209
-						<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>
210
-						<textarea name="lasso_editor[non_editable]" id="lasso_editor[non_editable]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNonEditable );?></textarea>
208
+						<label><?php _e('Read Only Items', 'lasso'); ?></label>
209
+						<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>
210
+						<textarea name="lasso_editor[non_editable]" id="lasso_editor[non_editable]" placeholder=".classname, .another-class"><?php echo esc_attr($objectsNonEditable); ?></textarea>
211 211
 					</div>
212 212
 				
213 213
 					<div class="lasso-editor-settings--option-inner" >
214
-						<input type="checkbox" class="checkbox" name="lasso_editor[show_ignored_items]" id="lasso_editor[show_ignored_items]" <?php echo checked( $show_ignored_items, 'on' );?> >
215
-						<label for="lasso_editor[show_ignored_items]"> <?php _e( 'Show Ignored Items', 'lasso' );?></label>
216
-						<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>
214
+						<input type="checkbox" class="checkbox" name="lasso_editor[show_ignored_items]" id="lasso_editor[show_ignored_items]" <?php echo checked($show_ignored_items, 'on'); ?> >
215
+						<label for="lasso_editor[show_ignored_items]"> <?php _e('Show Ignored Items', 'lasso'); ?></label>
216
+						<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 217
 					</div>
218 218
 				</div>
219 219
 
220
-				<h3><?php _e( 'Editor UI', 'lasso' );?></h3>
220
+				<h3><?php _e('Editor UI', 'lasso'); ?></h3>
221 221
 				<div class="lasso-editor-settings--option-wrap">
222 222
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
223
-						<input type="checkbox" class="checkbox" name="lasso_editor[use_old_ui]" id="lasso_editor_use_old_ui" <?php echo checked( $use_old_ui, 'on' );?> >
224
-						<label for="lasso_editor[use_old_ui]"><?php _e( 'Use the Old Toolbar', 'lasso' );?></label>
225
-						<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>
223
+						<input type="checkbox" class="checkbox" name="lasso_editor[use_old_ui]" id="lasso_editor_use_old_ui" <?php echo checked($use_old_ui, 'on'); ?> >
224
+						<label for="lasso_editor[use_old_ui]"><?php _e('Use the Old Toolbar', 'lasso'); ?></label>
225
+						<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 226
 					</div>
227 227
 				    <div id="lasso-editor-settings--colors">
228 228
 					<?php
229
-					self::create_section_for_color_picker('button-color1', _e( 'Editor Bar Color Top', 'lasso' ), '#0000ff');
230
-					self::create_section_for_color_picker('button-color2', _e( 'Editor Bar Color Bottom', 'lasso' ), '#000030');
231
-					self::create_section_for_color_picker('dialog-color', _e( 'Dialog Color', 'lasso' ), '#000055');
232
-					self::create_section_for_color_picker('text-color', _e( 'Icon/Text Color', 'lasso' ), '#ffffff');
229
+					self::create_section_for_color_picker('button-color1', _e('Editor Bar Color Top', 'lasso'), '#0000ff');
230
+					self::create_section_for_color_picker('button-color2', _e('Editor Bar Color Bottom', 'lasso'), '#000030');
231
+					self::create_section_for_color_picker('dialog-color', _e('Dialog Color', 'lasso'), '#000055');
232
+					self::create_section_for_color_picker('text-color', _e('Icon/Text Color', 'lasso'), '#ffffff');
233 233
 					?>
234
-					<button type="button" id="lasso-editor-settings--default-colors" ><?php _e( 'Default Colors', 'lasso' );?></button>
234
+					<button type="button" id="lasso-editor-settings--default-colors" ><?php _e('Default Colors', 'lasso'); ?></button>
235 235
 				    <div style="height:50px;"></div>
236 236
 					</div>
237 237
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
238
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked( $toolbar_headings, 'on' );?> >
239
-						<label for="lasso_editor[toolbar_headings]"><?php _e( 'Enable H2 and H3 Buttons', 'lasso' );?></label>
240
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set H2 and H3 settings.', 'lasso' );?></span>
238
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked($toolbar_headings, 'on'); ?> >
239
+						<label for="lasso_editor[toolbar_headings]"><?php _e('Enable H2 and H3 Buttons', 'lasso'); ?></label>
240
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set H2 and H3 settings.', 'lasso'); ?></span>
241 241
 
242 242
 					</div>
243 243
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
244
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings_h4]" id="lasso_editor[toolbar_headings_h4]" <?php echo checked( $toolbar_headings_h4, 'on' );?> >
245
-						<label for="lasso_editor[toolbar_headings_h4]"><?php _e( 'Enable H4/H5/H6 Buttons', 'lasso' );?></label>
246
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set H4/H5/H6 settings.', 'lasso' );?></span>
244
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings_h4]" id="lasso_editor[toolbar_headings_h4]" <?php echo checked($toolbar_headings_h4, 'on'); ?> >
245
+						<label for="lasso_editor[toolbar_headings_h4]"><?php _e('Enable H4/H5/H6 Buttons', 'lasso'); ?></label>
246
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set H4/H5/H6 settings.', 'lasso'); ?></span>
247 247
 
248 248
 					</div>
249 249
 					
250 250
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
251
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_list]" id="lasso_editor[toolbar_list]" <?php echo checked( $toolbar_list, 'on' );?> >
252
-						<label for="lasso_editor[toolbar_list]"><?php _e( 'Enabled OL/UL Buttons', 'lasso' );?></label>
253
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to create Ordered and Unordered Lists from text selection.', 'lasso' );?></span>
251
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_list]" id="lasso_editor[toolbar_list]" <?php echo checked($toolbar_list, 'on'); ?> >
252
+						<label for="lasso_editor[toolbar_list]"><?php _e('Enabled OL/UL Buttons', 'lasso'); ?></label>
253
+						<span class="lasso--setting-description"><?php _e('Show the buttons to create Ordered and Unordered Lists from text selection.', 'lasso'); ?></span>
254 254
 					</div>
255 255
 					
256 256
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
257
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_color]" id="lasso_editor[toolbar_show_color]" <?php echo checked( $toolbar_show_color, 'on' );?> >
258
-						<label for="lasso_editor[toolbar_show_color]"><?php _e( 'Enable Text Color Buttons', 'lasso' );?></label>
259
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set text colors.', 'lasso' );?></span>
257
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_color]" id="lasso_editor[toolbar_show_color]" <?php echo checked($toolbar_show_color, 'on'); ?> >
258
+						<label for="lasso_editor[toolbar_show_color]"><?php _e('Enable Text Color Buttons', 'lasso'); ?></label>
259
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set text colors.', 'lasso'); ?></span>
260 260
 
261 261
 					</div>
262 262
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
263
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_alignment]" id="lasso_editor[toolbar_show_alignment]" <?php echo checked( $toolbar_show_alignment, 'on' );?> >
264
-						<label for="lasso_editor[toolbar_show_alignment]"><?php _e( 'Enable Text Align Buttons', 'lasso' );?></label>
265
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set text alignment.', 'lasso' );?></span>
263
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_alignment]" id="lasso_editor[toolbar_show_alignment]" <?php echo checked($toolbar_show_alignment, 'on'); ?> >
264
+						<label for="lasso_editor[toolbar_show_alignment]"><?php _e('Enable Text Align Buttons', 'lasso'); ?></label>
265
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set text alignment.', 'lasso'); ?></span>
266 266
 
267 267
 					</div>
268 268
 					
269 269
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
270
-						<input type="checkbox" class="checkbox" name="lasso_editor[links_editable]" id="lasso_editor[links_editable]" <?php echo checked( $links_editable, 'on' );?> >
271
-						<label for="lasso_editor[links_editable]"><?php _e( 'Make links editable under the Editing Mode', 'lasso' );?></label>
272
-						<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>
270
+						<input type="checkbox" class="checkbox" name="lasso_editor[links_editable]" id="lasso_editor[links_editable]" <?php echo checked($links_editable, 'on'); ?> >
271
+						<label for="lasso_editor[links_editable]"><?php _e('Make links editable under the Editing Mode', 'lasso'); ?></label>
272
+						<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 273
 
274 274
 					</div>
275 275
 					<div class="lasso-editor-settings--option-inner">
276
-					    <label for="lasso_editor[insert_comp_ui]"> <?php _e( 'Insert Component UI', 'lasso' );?></label>
277
-						<span class="lasso--setting-description"><?php _e( 'UI mechanism to insert components', 'lasso' );?></span>
276
+					    <label for="lasso_editor[insert_comp_ui]"> <?php _e('Insert Component UI', 'lasso'); ?></label>
277
+						<span class="lasso--setting-description"><?php _e('UI mechanism to insert components', 'lasso'); ?></span>
278 278
 						<div class="lasso-editor-settings--option-inner" style="border:none;">
279
-					       <input type="radio" name="lasso_editor[insert_comp_ui]" value='drag' <?php echo checked( $insert_comp_ui, 'drag' );?>> <?php _e( 'Drag and Drop', 'lasso' );?>
279
+					       <input type="radio" name="lasso_editor[insert_comp_ui]" value='drag' <?php echo checked($insert_comp_ui, 'drag'); ?>> <?php _e('Drag and Drop', 'lasso'); ?>
280 280
 						</div>
281 281
 						<div class="lasso-editor-settings--option-inner" style="border:none;">
282
-						<input type="radio" name="lasso_editor[insert_comp_ui]" value="click" <?php echo checked( $insert_comp_ui, 'click' );?>> <?php _e( 'Click', 'lasso' );?>
282
+						<input type="radio" name="lasso_editor[insert_comp_ui]" value="click" <?php echo checked($insert_comp_ui, 'click'); ?>> <?php _e('Click', '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="mediumcom" <?php echo checked( $insert_comp_ui, 'mediumcom' );?>> <?php _e( 'Auto Button on Empty Paragraph. medium.com-like UI.', 'lasso' );?>
285
+						<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'); ?>
286 286
 						</div>
287 287
 					</div>
288 288
 				</div>
@@ -291,101 +291,101 @@  discard block
 block discarded – undo
291 291
 				
292 292
 				
293 293
 
294
-				<h3><?php _e( 'Post Settings UI', 'lasso' );?></h3>
294
+				<h3><?php _e('Post Settings UI', 'lasso'); ?></h3>
295 295
 				<div class="lasso-editor-settings--option-wrap"  >
296 296
 					<div class="lasso-editor-settings--option-inner" style="border:none">
297
-						<input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked( $post_settings_disabled, 'on' );?> >
298
-						<label for="lasso_editor[post_settings_disabled]"> <?php _e( 'Disable Post Settings', 'lasso' );?></label>
299
-						<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>
297
+						<input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked($post_settings_disabled, 'on'); ?> >
298
+						<label for="lasso_editor[post_settings_disabled]"> <?php _e('Disable Post Settings', 'lasso'); ?></label>
299
+						<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>
300 300
 					</div>
301 301
 					
302 302
 					<div class="lasso-editor-settings--option-inner" style="border:none">
303
-						<input type="checkbox" class="checkbox" name="lasso_editor[allow_change_date]" id="lasso_editor[allow_change_date]" <?php echo checked( $allow_change_date, 'on' );?> >
304
-						<label for="lasso_editor[allow_change_date]"> <?php _e( 'Allow Changing Post Date', 'lasso' );?></label>
305
-						<span class="lasso--setting-description"><?php _e( 'Add the date selector to change the post\'s date to the Post Setting dialog', 'lasso' );?></span>
303
+						<input type="checkbox" class="checkbox" name="lasso_editor[allow_change_date]" id="lasso_editor[allow_change_date]" <?php echo checked($allow_change_date, 'on'); ?> >
304
+						<label for="lasso_editor[allow_change_date]"> <?php _e('Allow Changing Post Date', 'lasso'); ?></label>
305
+						<span class="lasso--setting-description"><?php _e('Add the date selector to change the post\'s date to the Post Setting dialog', 'lasso'); ?></span>
306 306
 					</div>
307 307
 					
308 308
 					<div class="lasso-editor-settings--option-inner" style="border:none">
309
-						<input type="checkbox" class="checkbox" name="lasso_editor[allow_new_category]" id="lasso_editor[allow_new_category]" <?php echo checked( $allow_new_category, 'on' );?> >
310
-						<label for="lasso_editor[allow_new_category]"> <?php _e( 'Allow Adding New Category', 'lasso' );?></label>
311
-						<span class="lasso--setting-description"><?php _e( 'Add the user to create new, previously non-existing categories for posts.', 'lasso' );?></span>
309
+						<input type="checkbox" class="checkbox" name="lasso_editor[allow_new_category]" id="lasso_editor[allow_new_category]" <?php echo checked($allow_new_category, 'on'); ?> >
310
+						<label for="lasso_editor[allow_new_category]"> <?php _e('Allow Adding New Category', 'lasso'); ?></label>
311
+						<span class="lasso--setting-description"><?php _e('Add the user to create new, previously non-existing categories for posts.', 'lasso'); ?></span>
312 312
 					</div>
313 313
 					
314 314
 					<div class="lasso-editor-settings--option-inner" style="border:none">
315
-						<input type="checkbox" class="checkbox" name="lasso_editor[no_pending_status]" id="lasso_editor[no_pending_status]" <?php echo checked( $no_pending_status, 'on' );?> >
316
-						<label for="lasso_editor[no_pending_status]"> <?php _e( 'Do Not Allow "Pending" Status', 'lasso' );?></label>
317
-						<span class="lasso--setting-description"><?php _e( 'Remove the Option to Set the Status to Pending.', 'lasso' );?></span>
315
+						<input type="checkbox" class="checkbox" name="lasso_editor[no_pending_status]" id="lasso_editor[no_pending_status]" <?php echo checked($no_pending_status, 'on'); ?> >
316
+						<label for="lasso_editor[no_pending_status]"> <?php _e('Do Not Allow "Pending" Status', 'lasso'); ?></label>
317
+						<span class="lasso--setting-description"><?php _e('Remove the Option to Set the Status to Pending.', 'lasso'); ?></span>
318 318
 					</div>
319 319
 					
320 320
 					<div class="lasso-editor-settings--option-inner" style="border:none">
321
-						<input type="checkbox" class="checkbox" name="lasso_editor[no_url_setting]" id="lasso_editor[no_slug_setting]" <?php echo checked( $no_url_setting, 'on' );?> >
322
-						<label for="lasso_editor[no_url_setting]"> <?php _e( 'Remove POST URL Option', 'lasso' );?></label>
323
-						<span class="lasso--setting-description"><?php _e( 'Remove the Option to Set the URL for the Post.', 'lasso' );?></span>
321
+						<input type="checkbox" class="checkbox" name="lasso_editor[no_url_setting]" id="lasso_editor[no_slug_setting]" <?php echo checked($no_url_setting, 'on'); ?> >
322
+						<label for="lasso_editor[no_url_setting]"> <?php _e('Remove POST URL Option', 'lasso'); ?></label>
323
+						<span class="lasso--setting-description"><?php _e('Remove the Option to Set the URL for the Post.', 'lasso'); ?></span>
324 324
 					</div>
325 325
 				
326 326
 					<div class="lasso-editor-settings--option-inner" >
327
-						<input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked( $post_new_disabled, 'on' );?> >
328
-						<label for="lasso_editor[post_adding_disabled]"><?php _e( 'Disable Post Adding', 'lasso' );?></label>
329
-						<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>
327
+						<input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked($post_new_disabled, 'on'); ?> >
328
+						<label for="lasso_editor[post_adding_disabled]"><?php _e('Disable Post Adding', 'lasso'); ?></label>
329
+						<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>
330 330
 					</div>
331 331
 					
332 332
 
333 333
 				</div>
334 334
 				
335
-				<h3><?php _e( 'Misc', 'lasso' );?></h3>
335
+				<h3><?php _e('Misc', 'lasso'); ?></h3>
336 336
 				<div class="lasso-editor-settings--option-wrap">
337 337
 					<div class="lasso-editor-settings--option-inner" style="border:none">
338
-						<input type="checkbox" class="checkbox" name="lasso_editor[disable_tour]" id="lasso_editor[disable_tour]" <?php echo checked( $disable_tour, 'on' );?> >
339
-						<label for="lasso_editor[disable_tour]"> <?php _e( 'Do Not Show Tour Dialog', 'lasso' );?></label>
340
-						<span class="lasso--setting-description"><?php _e( 'Check this box to disable the tour dialog box for all users.', 'lasso' );?></span>
338
+						<input type="checkbox" class="checkbox" name="lasso_editor[disable_tour]" id="lasso_editor[disable_tour]" <?php echo checked($disable_tour, 'on'); ?> >
339
+						<label for="lasso_editor[disable_tour]"> <?php _e('Do Not Show Tour Dialog', 'lasso'); ?></label>
340
+						<span class="lasso--setting-description"><?php _e('Check this box to disable the tour dialog box for all users.', 'lasso'); ?></span>
341 341
 					</div>
342 342
 
343 343
 					<div class="lasso-editor-settings--option-inner" style="border:none">
344
-					    <label for="lasso_editor[bold_tag]"> <?php _e( '"Bold" Tag', 'lasso' );?></label>
345
-						<span class="lasso--setting-description"><?php _e( 'Choose the HTML tag used for the "Bold" style.', 'lasso' );?></span>
346
-					    <input type="radio" name="lasso_editor[bold_tag]" value='b' <?php echo checked( $bold_tag, 'b' );?>> b
347
-						<input type="radio" name="lasso_editor[bold_tag]" value="strong" <?php echo checked( $bold_tag, 'strong' );?>> strong
344
+					    <label for="lasso_editor[bold_tag]"> <?php _e('"Bold" Tag', 'lasso'); ?></label>
345
+						<span class="lasso--setting-description"><?php _e('Choose the HTML tag used for the "Bold" style.', 'lasso'); ?></span>
346
+					    <input type="radio" name="lasso_editor[bold_tag]" value='b' <?php echo checked($bold_tag, 'b'); ?>> b
347
+						<input type="radio" name="lasso_editor[bold_tag]" value="strong" <?php echo checked($bold_tag, 'strong'); ?>> strong
348 348
 					</div>
349 349
 					<div class="lasso-editor-settings--option-inner" >
350
-					    <label for="lasso_editor[i_tag]"> <?php _e( '"Italic" Tag', 'lasso' );?></label>
351
-						<span class="lasso--setting-description"><?php _e( 'Choose the HTML tag used for the "Italic" style.', 'lasso' );?></span>
352
-					    <input type="radio" name="lasso_editor[i_tag]" value='i' <?php echo checked( $i_tag, 'i' );?>> i
353
-						<input type="radio" name="lasso_editor[i_tag]" value="em" <?php echo checked( $i_tag, 'em' );?>> em
350
+					    <label for="lasso_editor[i_tag]"> <?php _e('"Italic" Tag', 'lasso'); ?></label>
351
+						<span class="lasso--setting-description"><?php _e('Choose the HTML tag used for the "Italic" style.', 'lasso'); ?></span>
352
+					    <input type="radio" name="lasso_editor[i_tag]" value='i' <?php echo checked($i_tag, 'i'); ?>> i
353
+						<input type="radio" name="lasso_editor[i_tag]" value="em" <?php echo checked($i_tag, 'em'); ?>> em
354 354
 					</div>
355 355
 				</div>
356 356
 
357
-				<h3><?php _e( 'Advanced', 'lasso' );?></h3>
357
+				<h3><?php _e('Advanced', 'lasso'); ?></h3>
358 358
 				<div class="lasso-editor-settings--option-wrap ">
359 359
 					<div class="lasso-editor-settings--option-inner" style="border:none">
360
-						<input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked( $shortcodify_disabled, 'on' );?> >
361
-						<label for="lasso_editor[shortcodify_disabled]"><?php _e( 'Disable Aesop Component Conversion', 'lasso' );?></label>
362
-						<span class="lasso--setting-description"><?php _e( 'Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso' );?></span>
360
+						<input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked($shortcodify_disabled, 'on'); ?> >
361
+						<label for="lasso_editor[shortcodify_disabled]"><?php _e('Disable Aesop Component Conversion', 'lasso'); ?></label>
362
+						<span class="lasso--setting-description"><?php _e('Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso'); ?></span>
363 363
 					</div>
364 364
 				
365 365
 					<div class="lasso-editor-settings--option-inner" style="border:none">
366
-						<input type="checkbox" class="checkbox" name="lasso_editor[enable_autosave]" id="lasso_editor[enable_autosave]" <?php echo checked( $enable_autosave, 'on' );?> >
367
-						<label for="lasso_editor[enable_autosave]"><?php _e( 'Enable Auto Save', 'lasso' );?></label>
368
-						<span class="lasso--setting-description"><?php _e( 'Check this box to enable auto save.', 'lasso' );?></span>
366
+						<input type="checkbox" class="checkbox" name="lasso_editor[enable_autosave]" id="lasso_editor[enable_autosave]" <?php echo checked($enable_autosave, 'on'); ?> >
367
+						<label for="lasso_editor[enable_autosave]"><?php _e('Enable Auto Save', 'lasso'); ?></label>
368
+						<span class="lasso--setting-description"><?php _e('Check this box to enable auto save.', 'lasso'); ?></span>
369 369
 					</div>
370 370
 				
371 371
 					<div class="lasso-editor-settings--option-inner" style="border:none">
372
-						<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' );?> >
373
-						<label for="lasso_editor[post_save_disabled]"><?php _e( 'Disable Post Saving', 'lasso' );?></label>
374
-						<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>
372
+						<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'); ?> >
373
+						<label for="lasso_editor[post_save_disabled]"><?php _e('Disable Post Saving', 'lasso'); ?></label>
374
+						<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>
375 375
 
376 376
 					</div>
377 377
 					
378 378
 					<div class="lasso-editor-settings--option-inner" style="border:none">
379
-						<input type="checkbox" class="checkbox" name="lasso_editor[post_edit_disabled]" id="lasso_editor[post_edit_disabled]" <?php echo checked( $edit_post_disabled, 'on' );?> >
380
-						<label for="lasso_editor[post_edit_disabled]"><?php _e( 'Disable Post Editing', 'lasso' );?></label>
381
-						<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>
379
+						<input type="checkbox" class="checkbox" name="lasso_editor[post_edit_disabled]" id="lasso_editor[post_edit_disabled]" <?php echo checked($edit_post_disabled, 'on'); ?> >
380
+						<label for="lasso_editor[post_edit_disabled]"><?php _e('Disable Post Editing', 'lasso'); ?></label>
381
+						<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>
382 382
 
383 383
 					</div>
384 384
 				
385 385
 					<div class="lasso-editor-settings--option-inner">
386
-						<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' );?> >
387
-						<label for="lasso_editor[save_using_rest_disabled]"><?php _e( "Don't Use REST API to Save", 'lasso' );?></label>
388
-						<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>
386
+						<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'); ?> >
387
+						<label for="lasso_editor[save_using_rest_disabled]"><?php _e("Don't Use REST API to Save", 'lasso'); ?></label>
388
+						<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>
389 389
 
390 390
 					</div>
391 391
 				</div>
@@ -395,11 +395,11 @@  discard block
 block discarded – undo
395 395
 
396 396
 				<div class="lasso-editor-settings--submit">
397 397
 				    <input type="hidden" name="action" value="lasso-editor-settings" />
398
-				    <input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save Settings', 'lasso' );?>" />
399
-					<?php wp_nonce_field( 'nonce', 'lasso_editor_settings' ); ?>
398
+				    <input type="submit" class="button-primary" value="<?php esc_attr_e('Save Settings', 'lasso'); ?>" />
399
+					<?php wp_nonce_field('nonce', 'lasso_editor_settings'); ?>
400 400
 				</div>
401 401
 				
402
-				<?php do_action('lasso_settings_after');?>
402
+				<?php do_action('lasso_settings_after'); ?>
403 403
 			</form>
404 404
 
405 405
 		</div><?php
Please login to merge, or discard this patch.
public/includes/editor-modules.php 1 patch
Spacing   +258 added lines, -258 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';
@@ -60,29 +60,29 @@  discard block
 block discarded – undo
60 60
 		?>
61 61
 		<style>
62 62
 		.lasso-editor-controls--wrap, #lasso--post-settings2,#lasso--save,#lasso--post-delete,#lasso--exit,#lasso--publish {
63
-			background-image: -webkit-linear-gradient(top,<?php echo $button_color1;?> 0,<?php echo $button_color2;?> 100%);
64
-			background-image: -o-linear-gradient(top,<?php echo $button_color1;?> 0,<?php echo $button_color2;?> 100%);
65
-			background-image: linear-gradient(to bottom,<?php echo $button_color1;?> 0,<?php echo $button_color2;?> 100%);
66
-			color: <?php echo $text_color;?>;
63
+			background-image: -webkit-linear-gradient(top,<?php echo $button_color1; ?> 0,<?php echo $button_color2; ?> 100%);
64
+			background-image: -o-linear-gradient(top,<?php echo $button_color1; ?> 0,<?php echo $button_color2; ?> 100%);
65
+			background-image: linear-gradient(to bottom,<?php echo $button_color1; ?> 0,<?php echo $button_color2; ?> 100%);
66
+			color: <?php echo $text_color; ?>;
67 67
 		}
68 68
 		
69 69
 		.lasso--controls__right a:before, #lasso-toolbar--html__footer_desc {
70
-			color: <?php echo $text_color;?> !important;
70
+			color: <?php echo $text_color; ?> !important;
71 71
 		}
72 72
 		
73 73
 		ul.lasso-editor-controls li:hover, #lasso--exit:hover,#lasso--post-settings2:hover,#lasso--post-delete:hover,#lasso--publish:hover,#lasso--save:hover {
74
-			background-image: -webkit-linear-gradient(top,<?php echo $hover_color1;?> 0,<?php echo $hover_color2;?> 100%);
75
-			background-image: -o-linear-gradient(top,<?php echo $hover_color1;?> 0,<?php echo $hover_color2;?> 100%);
76
-			background-image: linear-gradient(to bottom,<?php echo $hover_color1;?> 0,<?php echo $hover_color2;?> 100%);
74
+			background-image: -webkit-linear-gradient(top,<?php echo $hover_color1; ?> 0,<?php echo $hover_color2; ?> 100%);
75
+			background-image: -o-linear-gradient(top,<?php echo $hover_color1; ?> 0,<?php echo $hover_color2; ?> 100%);
76
+			background-image: linear-gradient(to bottom,<?php echo $hover_color1; ?> 0,<?php echo $hover_color2; ?> 100%);
77 77
 		}
78 78
 		
79 79
 		.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,
80 80
 		#lasso-toolbar--link.link--drop-up #lasso-toolbar--link__wrap		{
81
-			background: <?php echo $dialog_color;?>;
82
-			color: <?php echo $text_color;?>;
81
+			background: <?php echo $dialog_color; ?>;
82
+			color: <?php echo $text_color; ?>;
83 83
 		}
84 84
 		.sweet-alert p,.lasso--modal__inner label,.lasso--toolbar__inner label {
85
-			color: <?php echo $text_color;?> !important;
85
+			color: <?php echo $text_color; ?> !important;
86 86
 		}
87 87
 		
88 88
 		<?php if (!$is_mobile) { ?>
@@ -112,48 +112,48 @@  discard block
 block discarded – undo
112 112
 		<?php
113 113
 		} 
114 114
 		?>
115
-		<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();?>" >
115
+		<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(); ?>" >
116 116
 
117
-			<ul class="lasso--controls__center lasso-editor-controls lasso-editor-controls--wrap <?php echo $post_access_class;?> "  <?php echo $mobile_style ?> >
117
+			<ul class="lasso--controls__center lasso-editor-controls lasso-editor-controls--wrap <?php echo $post_access_class; ?> "  <?php echo $mobile_style ?> >
118 118
 
119
-				<?php do_action( 'lasso_editor_controls_before' );
119
+				<?php do_action('lasso_editor_controls_before');
120 120
 
121
-				if ( $is_capable ) { ?>
121
+				if ($is_capable) { ?>
122 122
 
123
-					<li id="lasso--edit" title="<?php esc_attr_e( 'Edit Post', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
123
+					<li id="lasso--edit" title="<?php esc_attr_e('Edit Post', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
124 124
 
125
-					<?php if ( 'off' == $post_settings_disabled || empty( $post_settings_disabled ) ) { ?>
126
-						<li id="lasso--post-settings" title="<?php esc_attr_e( 'Post Settings', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
125
+					<?php if ('off' == $post_settings_disabled || empty($post_settings_disabled)) { ?>
126
+						<li id="lasso--post-settings" title="<?php esc_attr_e('Post Settings', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
127 127
 					<?php }
128 128
 
129 129
 				} ?>
130 130
 
131
-				<li id="lasso--post-all" title="<?php esc_attr_e( 'All Posts', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
131
+				<li id="lasso--post-all" title="<?php esc_attr_e('All Posts', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
132 132
 
133
-				<?php if ( $is_capable && wp_revisions_enabled( $post ) ) { ?>
134
-					<li id="lasso--post-revisions" title="<?php esc_attr_e( 'Revisions', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
133
+				<?php if ($is_capable && wp_revisions_enabled($post)) { ?>
134
+					<li id="lasso--post-revisions" title="<?php esc_attr_e('Revisions', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
135 135
 				<?php } ?>
136 136
 
137
-				<?php if ( ( 'off' == $post_new_disabled || empty( $post_new_disabled ) && lasso_user_can('edit_posts') ) ) { ?>
138
-					<li id="lasso--post-new" title="<?php esc_attr_e( 'Add Post', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
137
+				<?php if (('off' == $post_new_disabled || empty($post_new_disabled) && lasso_user_can('edit_posts'))) { ?>
138
+					<li id="lasso--post-new" title="<?php esc_attr_e('Add Post', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
139 139
 				<?php } ?>
140 140
 
141
-				<?php do_action( 'lasso_editor_controls_after' );?>
141
+				<?php do_action('lasso_editor_controls_after'); ?>
142 142
 
143 143
 			</ul>
144 144
 
145
-			<?php if ( is_singular() && !$is_mobile ) { ?>
145
+			<?php if (is_singular() && !$is_mobile) { ?>
146 146
 
147
-				<div class="lasso--controls__right" data-posttype="<?php echo get_post_type( get_the_ID() );?>" data-status="<?php echo $status;?>">
147
+				<div class="lasso--controls__right" data-posttype="<?php echo get_post_type(get_the_ID()); ?>" data-status="<?php echo $status; ?>">
148 148
 				
149
-					<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>
150
-					<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>
149
+					<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>
150
+					<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>
151 151
 
152 152
 
153
-					<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>
153
+					<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>
154 154
 
155
-					<?php if ( ('draft' == $status ) || ('pending' == $status && $can_publish) ) { ?>
156
-						<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>
155
+					<?php if (('draft' == $status) || ('pending' == $status && $can_publish)) { ?>
156
+						<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>
157 157
 					<?php } ?>
158 158
 					
159 159
 
@@ -179,9 +179,9 @@  discard block
 block discarded – undo
179 179
 
180 180
 
181 181
 	// let users add custom css classes
182
-	$custom_classes = apply_filters( 'lasso_sidebar_classes', '' );
182
+	$custom_classes = apply_filters('lasso_sidebar_classes', '');
183 183
 	?>
184
-	<div id="lasso--sidebar" class="<?php echo sanitize_html_class( $custom_classes );?>" >
184
+	<div id="lasso--sidebar" class="<?php echo sanitize_html_class($custom_classes); ?>" >
185 185
 		<div class="lasso--sidebar__inner">
186 186
 			<div id="lasso--component__settings"></div>
187 187
 		</div>
@@ -203,21 +203,21 @@  discard block
 block discarded – undo
203 203
 	$is_mobile = wp_is_mobile();
204 204
 
205 205
 	// check for lasso story engine and add a class doniting this
206
-	$ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active';
206
+	$ase_status = class_exists('Aesop_Core') || defined('LASSO_CUSTOM') ? 'ase-active' : 'ase-not-active';
207 207
 
208 208
 	// let users add custom css classes
209
-	$custom_classes = apply_filters( 'lasso_toolbar_classes', '' );
209
+	$custom_classes = apply_filters('lasso_toolbar_classes', '');
210 210
 
211 211
 	// are toolbar headings enabled
212
-	$toolbar_headings      = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' );
213
-	$toolbar_headings_h4      = lasso_editor_get_option( 'toolbar_headings_h4', 'lasso_editor' );
214
-	$toolbar_list      = lasso_editor_get_option( 'toolbar_list', 'lasso_editor' );
212
+	$toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor');
213
+	$toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
214
+	$toolbar_list = lasso_editor_get_option('toolbar_list', 'lasso_editor');
215 215
 
216
-	$toolbar_class  = $toolbar_headings ? 'toolbar-extended' : false;
216
+	$toolbar_class = $toolbar_headings ? 'toolbar-extended' : false;
217 217
 	
218 218
 	// mobile styles
219 219
     $mobile_class = $is_mobile ? 'lasso-mobile' : false;
220
-	$mobile_style =$is_mobile ? 'style="bottom:0px;"' : null;
220
+	$mobile_style = $is_mobile ? 'style="bottom:0px;"' : null;
221 221
 	
222 222
 	//show color
223 223
 	$show_color = lasso_editor_get_option('toolbar_show_color', 'lasso_editor');
@@ -225,125 +225,125 @@  discard block
 block discarded – undo
225 225
 	//show alignment
226 226
 	$show_align = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor');
227 227
 	
228
-	$status = get_post_status( get_the_ID() );
228
+	$status = get_post_status(get_the_ID());
229 229
 	
230
-	$shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' );
230
+	$shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor');
231 231
 	
232 232
 	$sc_saving_class = 'on' == $shortcodify_disabled ? 'shortcodify-disabled' : 'shortcodify-enabled';
233 233
 
234 234
 
235 235
 	?>
236
-	<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 ?>>
237
-		<ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"';}?>>
238
-			<?php do_action( 'lasso_toolbar_components_before' );?>
239
-		    <li id="lasso-toolbar--bold" title="<?php esc_attr_e( 'Bold', 'lasso' );?>"></li>
240
-		    <li id="lasso-toolbar--underline" title="<?php esc_attr_e( 'Underline', 'lasso' );?>"></li>
241
-		    <li id="lasso-toolbar--italic" title="<?php esc_attr_e( 'Italicize', 'lasso' );?>"></li>
242
-		    <li id="lasso-toolbar--strike" title="<?php esc_attr_e( 'Strikethrough', 'lasso' );?>"></li>
243
-			<li id="lasso-toolbar--components" title="<?php esc_attr_e( 'Insert Component', 'lasso' );?>" style="color:#ffffa0;">
236
+	<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 ?>>
237
+		<ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"'; }?>>
238
+			<?php do_action('lasso_toolbar_components_before'); ?>
239
+		    <li id="lasso-toolbar--bold" title="<?php esc_attr_e('Bold', 'lasso'); ?>"></li>
240
+		    <li id="lasso-toolbar--underline" title="<?php esc_attr_e('Underline', 'lasso'); ?>"></li>
241
+		    <li id="lasso-toolbar--italic" title="<?php esc_attr_e('Italicize', 'lasso'); ?>"></li>
242
+		    <li id="lasso-toolbar--strike" title="<?php esc_attr_e('Strikethrough', 'lasso'); ?>"></li>
243
+			<li id="lasso-toolbar--components" title="<?php esc_attr_e('Insert Component', 'lasso'); ?>" style="color:#ffffa0;">
244 244
 			    <ul id="lasso-toolbar--components__list" style="display:none;color:white;">
245
-			    	<?php if ( 'ase-active' == $ase_status ): ?>
246
-						<li data-type="image" title="<?php esc_attr_e( 'Image', 'lasso' );?>" class="lasso-toolbar--component__image"></li>
247
-						<li data-type="character" title="<?php esc_attr_e( 'Character', 'lasso' );?>" class="lasso-toolbar--component__character"></li>
248
-						<li data-type="quote" title="<?php esc_attr_e( 'Quote', 'lasso' );?>"  class="lasso-toolbar--component__quote"></li>
249
-						<li data-type="content" title="<?php esc_attr_e( 'Content', 'lasso' );?>"  class="lasso-toolbar--component__content"></li>
250
-						<li data-type="chapter" title="<?php esc_attr_e( 'Chapter', 'lasso' );?>"  class="lasso-toolbar--component__chapter"></li>
251
-						<li data-type="parallax" title="<?php esc_attr_e( 'Parallax', 'lasso' );?>"  class="lasso-toolbar--component__parallax"></li>
252
-						<li data-type="audio" title="<?php esc_attr_e( 'Audio', 'lasso' );?>"  class="lasso-toolbar--component__audio"></li>
253
-						<li data-type="video" title="<?php esc_attr_e( 'Video', 'lasso' );?>"  class="lasso-toolbar--component__video"></li>
254
-						<li data-type="map" title="<?php esc_attr_e( 'Map', 'lasso' );?>"  class="lasso-toolbar--component__map"></li>
255
-						<li data-type="timeline_stop" title="<?php esc_attr_e( 'Timeline', 'lasso' );?>"  class="lasso-toolbar--component__timeline"></li>
256
-						<li data-type="document" title="<?php esc_attr_e( 'Document', 'lasso' );?>"  class="lasso-toolbar--component__document"></li>
257
-						<li data-type="collection" title="<?php esc_attr_e( 'Collection', 'lasso' );?>"  class="lasso-toolbar--component__collection"></li>
258
-						<li data-type="gallery" title="<?php esc_attr_e( 'Gallery', 'lasso' );?>"  class="lasso-toolbar--component__gallery"></li>
259
-						<?php if ( class_exists ('Aesop_GalleryPop') ) { ?>
260
-						     <li data-type="gallery" title="<?php esc_attr_e( 'Gallery Pop', 'lasso' );?>"  class="lasso-toolbar--component__gallerypop"></li>
245
+			    	<?php if ('ase-active' == $ase_status): ?>
246
+						<li data-type="image" title="<?php esc_attr_e('Image', 'lasso'); ?>" class="lasso-toolbar--component__image"></li>
247
+						<li data-type="character" title="<?php esc_attr_e('Character', 'lasso'); ?>" class="lasso-toolbar--component__character"></li>
248
+						<li data-type="quote" title="<?php esc_attr_e('Quote', 'lasso'); ?>"  class="lasso-toolbar--component__quote"></li>
249
+						<li data-type="content" title="<?php esc_attr_e('Content', 'lasso'); ?>"  class="lasso-toolbar--component__content"></li>
250
+						<li data-type="chapter" title="<?php esc_attr_e('Chapter', 'lasso'); ?>"  class="lasso-toolbar--component__chapter"></li>
251
+						<li data-type="parallax" title="<?php esc_attr_e('Parallax', 'lasso'); ?>"  class="lasso-toolbar--component__parallax"></li>
252
+						<li data-type="audio" title="<?php esc_attr_e('Audio', 'lasso'); ?>"  class="lasso-toolbar--component__audio"></li>
253
+						<li data-type="video" title="<?php esc_attr_e('Video', 'lasso'); ?>"  class="lasso-toolbar--component__video"></li>
254
+						<li data-type="map" title="<?php esc_attr_e('Map', 'lasso'); ?>"  class="lasso-toolbar--component__map"></li>
255
+						<li data-type="timeline_stop" title="<?php esc_attr_e('Timeline', 'lasso'); ?>"  class="lasso-toolbar--component__timeline"></li>
256
+						<li data-type="document" title="<?php esc_attr_e('Document', 'lasso'); ?>"  class="lasso-toolbar--component__document"></li>
257
+						<li data-type="collection" title="<?php esc_attr_e('Collection', 'lasso'); ?>"  class="lasso-toolbar--component__collection"></li>
258
+						<li data-type="gallery" title="<?php esc_attr_e('Gallery', 'lasso'); ?>"  class="lasso-toolbar--component__gallery"></li>
259
+						<?php if (class_exists('Aesop_GalleryPop')) { ?>
260
+						     <li data-type="gallery" title="<?php esc_attr_e('Gallery Pop', 'lasso'); ?>"  class="lasso-toolbar--component__gallerypop"></li>
261 261
 						<?php }?>
262
-						<?php if ( class_exists ('Aesop_Events') ) { ?>
263
-						     <li data-type="events" title="<?php esc_attr_e( 'Event', 'lasso' );?>"  class="lasso-toolbar--component__event"></li>
262
+						<?php if (class_exists('Aesop_Events')) { ?>
263
+						     <li data-type="events" title="<?php esc_attr_e('Event', 'lasso'); ?>"  class="lasso-toolbar--component__event"></li>
264 264
 						<?php }?>
265 265
 					<?php else: ?>
266
-						<li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li>
267
-						<li data-type="wpquote" title="<?php esc_attr_e( 'WordPress Quote', 'lasso' );?>" class="quote lasso-toolbar--component__quote"></li>
268
-						<!--li data-type="wpvideo" title="<?php esc_attr_e( 'WordPress Video', 'lasso' );?>" class="video lasso-toolbar--component__video"></li-->
266
+						<li data-type="wpimg" title="<?php esc_attr_e('WordPress Image', 'lasso'); ?>" class="image lasso-toolbar--component__image"></li>
267
+						<li data-type="wpquote" title="<?php esc_attr_e('WordPress Quote', 'lasso'); ?>" class="quote lasso-toolbar--component__quote"></li>
268
+						<!--li data-type="wpvideo" title="<?php esc_attr_e('WordPress Video', 'lasso'); ?>" class="video lasso-toolbar--component__video"></li-->
269 269
 					<?php endif; ?>
270
-					<?php do_action( 'lasso_toolbar_components' );?>
270
+					<?php do_action('lasso_toolbar_components'); ?>
271 271
 			    </ul>
272 272
 			</li>
273
-		    <?php if ( $toolbar_headings ): ?>
274
-		    <li id="lasso-toolbar--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"></li>
275
-		    <li id="lasso-toolbar--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"></li>
273
+		    <?php if ($toolbar_headings): ?>
274
+		    <li id="lasso-toolbar--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"></li>
275
+		    <li id="lasso-toolbar--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"></li>
276 276
 			<?php endif; ?>
277 277
 			
278 278
 			
279 279
 			
280
-			<?php if ( $toolbar_headings_h4 ): ?>
281
-		    <li id="lasso-toolbar--h4" title="<?php esc_attr_e( 'H4 Heading', 'lasso' );?>"></li>
282
-		    <li id="lasso-toolbar--h5" title="<?php esc_attr_e( 'H5 Heading', 'lasso' );?>"></li>
283
-			<li id="lasso-toolbar--h6" title="<?php esc_attr_e( 'H6 Heading', 'lasso' );?>"></li>
280
+			<?php if ($toolbar_headings_h4): ?>
281
+		    <li id="lasso-toolbar--h4" title="<?php esc_attr_e('H4 Heading', 'lasso'); ?>"></li>
282
+		    <li id="lasso-toolbar--h5" title="<?php esc_attr_e('H5 Heading', 'lasso'); ?>"></li>
283
+			<li id="lasso-toolbar--h6" title="<?php esc_attr_e('H6 Heading', 'lasso'); ?>"></li>
284 284
 			<?php endif; ?>
285 285
 			
286
-			<?php if ( $show_color ): ?>
287
-		    <li id="lasso-toolbar--color-set" title="<?php esc_attr_e( 'Set Color for Selected Text', 'lasso' );?>"></li>
288
-		    <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e( 'Choose Color', 'lasso' );?>"></li>
286
+			<?php if ($show_color): ?>
287
+		    <li id="lasso-toolbar--color-set" title="<?php esc_attr_e('Set Color for Selected Text', 'lasso'); ?>"></li>
288
+		    <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e('Choose Color', 'lasso'); ?>"></li>
289 289
 			<?php endif; ?>
290 290
 			
291
-			<?php if ( $toolbar_list ): ?>
292
-		    <li id="lasso-toolbar--ol" title="<?php esc_attr_e( 'Ordered List', 'lasso' );?>"></li>
293
-		    <li id="lasso-toolbar--ul" title="<?php esc_attr_e( 'Unordered', 'lasso' );?>"></li>
291
+			<?php if ($toolbar_list): ?>
292
+		    <li id="lasso-toolbar--ol" title="<?php esc_attr_e('Ordered List', 'lasso'); ?>"></li>
293
+		    <li id="lasso-toolbar--ul" title="<?php esc_attr_e('Unordered', 'lasso'); ?>"></li>
294 294
 			<?php endif; ?>
295 295
 					
296 296
 		    
297
-			<li id="lasso-toolbar--link" title="<?php esc_attr_e( 'Anchor Link', 'lasso' );?>">
297
+			<li id="lasso-toolbar--link" title="<?php esc_attr_e('Anchor Link', 'lasso'); ?>">
298 298
 		    	<div id="lasso-toolbar--link__wrap" <?php echo $mobile_style ?> >
299
-		    		<div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'http://url.com', 'lasso' );?>"></div>
300
-		    		<a href="#" title="<?php esc_attr_e( 'Create Link', 'lasso' );?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a>
299
+		    		<div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e('http://url.com', 'lasso'); ?>"></div>
300
+		    		<a href="#" title="<?php esc_attr_e('Create Link', 'lasso'); ?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a>
301 301
 					<input class="styled-checkbox" type="checkbox" id="aesop-toolbar--link_newtab" checked/>
302
-                    <label for="aesop-toolbar--link_newtab"><?php esc_attr_e( 'Open in a New Tab', 'lasso' );?></label>
302
+                    <label for="aesop-toolbar--link_newtab"><?php esc_attr_e('Open in a New Tab', 'lasso'); ?></label>
303 303
 		    	</div>
304 304
 		    </li>
305
-		    <?php do_action( 'lasso_toolbar_components_after' );?>
306
-		    <li id="lasso-toolbar--html" title="<?php esc_attr_e( 'Insert HTML or Code', 'lasso' );?>">
305
+		    <?php do_action('lasso_toolbar_components_after'); ?>
306
+		    <li id="lasso-toolbar--html" title="<?php esc_attr_e('Insert HTML or Code', 'lasso'); ?>">
307 307
 		    	<div id="lasso-toolbar--html__wrap" <?php echo $mobile_style ?>>
308
-		    		<div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?>"></div>
308
+		    		<div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e('Enter HTML to insert', 'lasso'); ?>"></div>
309 309
 		    		<div id="lasso-toolbar--html__footer">
310 310
 					<div id="lasso-toolbar--html__footer_desc" >
311
-					<?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?><br>
312
-					<?php esc_attr_e( 'You can also use Shortcodes', 'lasso' );?><br>
313
-					<?php esc_attr_e( 'You can also enter a URL to embed, such as Youtube, Vimeo and Twitter URLs.', 'lasso' );?>
311
+					<?php esc_attr_e('Enter HTML to insert', 'lasso'); ?><br>
312
+					<?php esc_attr_e('You can also use Shortcodes', 'lasso'); ?><br>
313
+					<?php esc_attr_e('You can also enter a URL to embed, such as Youtube, Vimeo and Twitter URLs.', 'lasso'); ?>
314 314
 					</div>
315 315
 		    			<ul class="lasso-toolbar--html-snips">
316 316
 						
317
-		    				<?php if ( !$toolbar_headings ): ?>
318
-		    				<li id="lasso-html--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>">
319
-		    				<li id="lasso-html--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>">
317
+		    				<?php if (!$toolbar_headings): ?>
318
+		    				<li id="lasso-html--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>">
319
+		    				<li id="lasso-html--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>">
320 320
 		    				<?php endif; ?>
321
-		    				<li id="lasso-html--ul" title="<?php esc_attr_e( 'Unordered List', 'lasso' );?>">
322
-		    				<li id="lasso-html--ol" title="<?php esc_attr_e( 'Ordered List', 'lasso' );?>">
323
-							<li id="lasso-html--table" title="<?php esc_attr_e( 'Table', 'lasso' );?>">
321
+		    				<li id="lasso-html--ul" title="<?php esc_attr_e('Unordered List', 'lasso'); ?>">
322
+		    				<li id="lasso-html--ol" title="<?php esc_attr_e('Ordered List', 'lasso'); ?>">
323
+							<li id="lasso-html--table" title="<?php esc_attr_e('Table', 'lasso'); ?>">
324 324
 		    			</ul>
325
-		    			<a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e( 'Cancel', 'lasso' );?></a>
326
-		    			<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>
325
+		    			<a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e('Cancel', 'lasso'); ?></a>
326
+		    			<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>
327 327
 		    		</div>
328 328
 		    	</div>
329 329
 		    </li>
330
-			<?php if ( $show_align ): ?>
331
-		    <li id="lasso-toolbar--left-align" title="<?php esc_attr_e( 'Text Left Align', 'lasso' );?>"></li>
332
-		    <li id="lasso-toolbar--center-align" title="<?php esc_attr_e( 'Text Center Align', 'lasso' );?>"></li>
333
-			<li id="lasso-toolbar--right-align" title="<?php esc_attr_e( 'Text Right Align', 'lasso' );?>"></li>
330
+			<?php if ($show_align): ?>
331
+		    <li id="lasso-toolbar--left-align" title="<?php esc_attr_e('Text Left Align', 'lasso'); ?>"></li>
332
+		    <li id="lasso-toolbar--center-align" title="<?php esc_attr_e('Text Center Align', 'lasso'); ?>"></li>
333
+			<li id="lasso-toolbar--right-align" title="<?php esc_attr_e('Text Right Align', 'lasso'); ?>"></li>
334 334
 			<?php endif; ?>
335 335
 		</ul>
336
-		<?php if ( is_singular() && $is_mobile ) { ?>
336
+		<?php if (is_singular() && $is_mobile) { ?>
337 337
 
338
-				<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;">
338
+				<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;">
339 339
 
340
-					<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>
341
-					<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>
340
+					<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>
341
+					<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>
342 342
 
343
-					<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>
343
+					<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>
344 344
 
345
-					<?php if ( 'draft' == $status && ( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') )  ) { ?>
346
-						<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>
345
+					<?php if ('draft' == $status && (lasso_user_can('publish_posts') || lasso_user_can('publish_pages'))) { ?>
346
+						<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>
347 347
 					<?php } ?>
348 348
 
349 349
 				</div>
@@ -361,20 +361,20 @@  discard block
 block discarded – undo
361 361
  */
362 362
 function lasso_editor_settings_toolbar() {
363 363
 
364
-	$delete_nonce = wp_create_nonce( 'lasso-delete-nonce' );
364
+	$delete_nonce = wp_create_nonce('lasso-delete-nonce');
365 365
 
366 366
 	ob_start();
367 367
 
368 368
 
369 369
 	// let users add custom css classes
370
-	$custom_classes = apply_filters( 'lasso_component_classes', '' );
370
+	$custom_classes = apply_filters('lasso_component_classes', '');
371 371
 
372 372
 	?>
373
-	<ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false">
374
-		<li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li>
375
-		<li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li>
376
-		<li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li>
377
-		<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>
373
+	<ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false">
374
+		<li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li>
375
+		<li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li>
376
+		<li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li>
377
+		<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>
378 378
 	</ul>
379 379
 
380 380
 	<?php return ob_get_clean();
@@ -392,13 +392,13 @@  discard block
 block discarded – undo
392 392
 
393 393
 
394 394
 	// has post thumbnail
395
-	$has_thumbnail = has_post_thumbnail( get_the_ID() ) ? 'class="lasso--featImg--has-thumb"' : false;
395
+	$has_thumbnail = has_post_thumbnail(get_the_ID()) ? 'class="lasso--featImg--has-thumb"' : false;
396 396
 
397 397
 	?>
398
-	<ul id="lasso--featImgControls" <?php echo $has_thumbnail;?>>
399
-		<li id="lasso--featImgUpload"><a title="<?php esc_attr_e( 'Replace Image', 'lasso' );?>" href="#"><i class="lasso-icon-image"></i></a></li>
400
-		<li id="lasso--featImgDelete"><a title="<?php esc_attr_e( 'Delete Image', 'lasso' );?>" href="#"><i class="lasso-icon-bin2"></i></a></li>
401
-		<li id="lasso--featImgSave"><a href="#"><?php esc_attr_e( 'save', 'lasso' );?></a></li>
398
+	<ul id="lasso--featImgControls" <?php echo $has_thumbnail; ?>>
399
+		<li id="lasso--featImgUpload"><a title="<?php esc_attr_e('Replace Image', 'lasso'); ?>" href="#"><i class="lasso-icon-image"></i></a></li>
400
+		<li id="lasso--featImgDelete"><a title="<?php esc_attr_e('Delete Image', 'lasso'); ?>" href="#"><i class="lasso-icon-bin2"></i></a></li>
401
+		<li id="lasso--featImgSave"><a href="#"><?php esc_attr_e('save', 'lasso'); ?></a></li>
402 402
 	</ul>
403 403
 
404 404
 	<?php return ob_get_clean();
@@ -422,55 +422,55 @@  discard block
 block discarded – undo
422 422
 
423 423
 	$postid = get_the_ID();
424 424
 
425
-	$status = get_post_status( $postid );
426
-	$nonce = wp_create_nonce( 'lasso-update-post-settings' );
425
+	$status = get_post_status($postid);
426
+	$nonce = wp_create_nonce('lasso-update-post-settings');
427 427
 
428 428
 	// let users add custom css classes
429
-	$custom_classes = apply_filters( 'lasso_modal_settings_classes', '' );
429
+	$custom_classes = apply_filters('lasso_modal_settings_classes', '');
430 430
 
431 431
 	// objects categories
432
-	$categories 		= lasso_get_post_objects( $postid, 'category' );
433
-	$tags 				= lasso_get_post_objects( $postid, 'tag' );
432
+	$categories = lasso_get_post_objects($postid, 'category');
433
+	$tags = lasso_get_post_objects($postid, 'tag');
434 434
 
435 435
 	// modal tabs
436
-	$tabs  				= lasso_modal_addons('tab');
437
-	$content 			= lasso_modal_addons('content');
436
+	$tabs = lasso_modal_addons('tab');
437
+	$content = lasso_modal_addons('content');
438 438
 	
439 439
 	//editor options
440 440
 	$allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor');
441 441
 	$no_url_setting = lasso_editor_get_option('no_url_setting', 'lasso_editor');
442 442
 
443 443
 	// are we singular
444
-	$is_singular 		= is_singular();
444
+	$is_singular = is_singular();
445 445
 	$is_singular_class 	= $is_singular ? 'lasso--postsettings__2col' : 'lasso--postsettings__1col';
446 446
 	$has_thumb_class    = has_post_thumbnail() ? 'has-thumbnail' : 'no-thumbnail';
447 447
 	$theme_supports     = current_theme_supports('post-thumbnails');
448
-	$default_image 		= LASSO_URL.'/admin/assets/img/empty-img.png';
448
+	$default_image = LASSO_URL.'/admin/assets/img/empty-img.png';
449 449
 	
450 450
 	// do we support pending status
451 451
 	$no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor');
452 452
 
453 453
 ?>
454
-	<div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>">
454
+	<div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>">
455 455
 		<div class="lasso--modal__inner">
456 456
 
457
-			<?php if( $tabs ) { echo $tabs; } ?>
457
+			<?php if ($tabs) { echo $tabs; } ?>
458 458
 
459 459
 			<div class="lasso--modal__content modal__content--core visible" data-addon-content="core">
460
-				<form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class;?>" >
460
+				<form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class; ?>" >
461 461
 
462
-					<?php if ( $is_singular && $theme_supports ) : ?>
462
+					<?php if ($is_singular && $theme_supports) : ?>
463 463
 					<div class="lasso--postsettings__left">
464
-						<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>
465
-						<div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url( $default_image );?>">
464
+						<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>
465
+						<div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url($default_image); ?>">
466 466
 
467 467
 							<div id="lasso--post-thumb__controls" class="lasso--post-thumb__controls">
468
-								<i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image','lasso');?>" class="dashicons dashicons-edit"></i>
469
-								<i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image','lasso');?>" class="dashicons dashicons-no-alt"></i>
468
+								<i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image', 'lasso'); ?>" class="dashicons dashicons-edit"></i>
469
+								<i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image', 'lasso'); ?>" class="dashicons dashicons-no-alt"></i>
470 470
 								<i id="lasso--save-status" class="lasso-icon lasso-icon-spinner6 not-visible"></i>
471 471
 							</div>
472 472
 
473
-							<?php echo has_post_thumbnail() ? get_the_post_thumbnail( $post->ID, 'medium' ) : '<img src="'.$default_image.'">'; ?>
473
+							<?php echo has_post_thumbnail() ? get_the_post_thumbnail($post->ID, 'medium') : '<img src="'.$default_image.'">'; ?>
474 474
 
475 475
 						</div>
476 476
 						<div id="lasso--featImgSave"><a href="#" class="not-visible">Save</a></div>
@@ -480,15 +480,15 @@  discard block
 block discarded – undo
480 480
 
481 481
 					<div class="lasso--postsettings__right">
482 482
 
483
-						<?php if( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ): ?>
483
+						<?php if (lasso_user_can('publish_posts') || lasso_user_can('publish_pages')): ?>
484 484
 						<div class="lasso--postsettings__option story-status-option">
485
-							<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>
486
-							<ul class="story-status story-status-<?php echo sanitize_html_class( $status );?>">
487
-								<li id="lasso--status-draft"><?php _e( 'Draft', 'lasso' );?></li>
488
-								<?php if( !$no_pending_status ): ?>								
489
-								<li id="lasso--status-pending"><?php _e( 'Pending', 'lasso' );?></li>
485
+							<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>
486
+							<ul class="story-status story-status-<?php echo sanitize_html_class($status); ?>">
487
+								<li id="lasso--status-draft"><?php _e('Draft', 'lasso'); ?></li>
488
+								<?php if (!$no_pending_status): ?>								
489
+								<li id="lasso--status-pending"><?php _e('Pending', 'lasso'); ?></li>
490 490
 								<?php endif; ?>
491
-								<li id="lasso--status-publish"><?php _e( 'Publish', 'lasso' );?></li>
491
+								<li id="lasso--status-publish"><?php _e('Publish', 'lasso'); ?></li>
492 492
 							</ul>
493 493
 							<div class="lasso--slider_wrap">
494 494
 								<div id="lasso--slider"></div>
@@ -496,10 +496,10 @@  discard block
 block discarded – undo
496 496
 						</div>
497 497
 						<?php endif; ?>
498 498
 
499
-						<?php if ( 'publish' == $status  && !$no_url_setting): ?>
499
+						<?php if ('publish' == $status && !$no_url_setting): ?>
500 500
 						<div class="lasso--postsettings__option story-slug-option">
501
-							<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>
502
-							<input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset( $post ) ? esc_attr( $post->post_name ) : false;?>">
501
+							<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>
502
+							<input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset($post) ? esc_attr($post->post_name) : false; ?>">
503 503
 						</div>
504 504
 						<?php endif; ?>
505 505
 
@@ -508,21 +508,21 @@  discard block
 block discarded – undo
508 508
 					<div class="lasso--postsettings__middle">
509 509
 
510 510
 						<div class="lasso--postsettings__option story-categories-option">
511
-							<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>
512
-							<input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories;?>">
511
+							<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>
512
+							<input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories; ?>">
513 513
 						</div>
514 514
 
515 515
 						<div class="lasso--postsettings__option story-tags-option">
516
-							<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>
517
-							<input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags;?>">
516
+							<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>
517
+							<input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags; ?>">
518 518
 						</div>
519 519
 						<?php 
520 520
 						if ($allow_change_date) { 
521
-						    $dateformat = get_option( 'date_format' ); 
521
+						    $dateformat = get_option('date_format'); 
522 522
 						?>
523
-						    <label><?php _e( 'Post Date', 'lasso' ); ?></label>
524
-							<input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/>
525
-							<a href="#" id="lasso--postsettings-setnow"><?php _e( 'Set to Now', 'lasso' ); ?></a>
523
+						    <label><?php _e('Post Date', 'lasso'); ?></label>
524
+							<input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid); ?>"/>
525
+							<a href="#" id="lasso--postsettings-setnow"><?php _e('Set to Now', 'lasso'); ?></a>
526 526
 						<?php
527 527
 						}?>
528 528
 
@@ -544,23 +544,23 @@  discard block
 block discarded – undo
544 544
 					?>
545 545
 					<!--/div-->
546 546
 
547
-					<?php do_action( 'lasso_modal_post_form' ); // action ?>
547
+					<?php do_action('lasso_modal_post_form'); // action ?>
548 548
 
549 549
 					<div class="lasso--postsettings__footer" >
550
-						<a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a>
550
+						<a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a>
551 551
 						<input type="hidden" name="status" value="">
552 552
 						<input type="hidden" name="categories" value="">
553
-						<input type="hidden" name="postid" value="<?php echo get_the_ID();?>">
553
+						<input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>">
554 554
 						<input type="hidden" name="action" value="process_update-object_post">
555
-						<input type="hidden" name="nonce" value="<?php echo $nonce;?>">
556
-						<?php do_action( 'lasso_modal_post_form_footer' ); // action ?>
557
-						<input type="submit" id="lasso--postsettings-submit" value="<?php esc_attr_e( 'Save', 'lasso' );?>">
555
+						<input type="hidden" name="nonce" value="<?php echo $nonce; ?>">
556
+						<?php do_action('lasso_modal_post_form_footer'); // action ?>
557
+						<input type="submit" id="lasso--postsettings-submit" value="<?php esc_attr_e('Save', 'lasso'); ?>">
558 558
 					</div>
559 559
 
560 560
 				</form>
561 561
 			</div>
562 562
 
563
-			<?php if( $tabs ) { echo $content; } ?>
563
+			<?php if ($tabs) { echo $content; } ?>
564 564
 
565 565
 		</div>
566 566
 
@@ -582,41 +582,41 @@  discard block
 block discarded – undo
582 582
 	ob_start();
583 583
 
584 584
 
585
-	$status = get_post_status( get_the_ID() );
585
+	$status = get_post_status(get_the_ID());
586 586
 
587
-	$nonce = wp_create_nonce( 'lasso-editor-new-post' );
587
+	$nonce = wp_create_nonce('lasso-editor-new-post');
588 588
 
589 589
 	// let users add custom css classes
590
-	$custom_classes = apply_filters( 'lasso_modal_post_classes', '' );
590
+	$custom_classes = apply_filters('lasso_modal_post_classes', '');
591 591
 
592 592
 	// return the post type
593
-	$type = get_post_type( get_the_ID() );
593
+	$type = get_post_type(get_the_ID());
594 594
 
595 595
 	$mobile_style = "";
596 596
 	if (wp_is_mobile()) {
597 597
 		$mobile_style = 'style="top:140px !important;"';
598 598
 	}
599 599
 	?>
600
-	<div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style;?>">
600
+	<div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" <?php echo $mobile_style; ?>">
601 601
 		<div class="lasso--modal__inner lasso--hasnewform">
602 602
 
603 603
 			<form id="lasso--postnew__form" enctype="multipart/form-data" class="lasso--post-form">
604 604
 
605 605
 				<div class="lasso--postsettings__option story-slug-option lasso--last-option">
606
-					<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>
607
-					<input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e( 'Type Your Title Here', 'lasso' );?>">
606
+					<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>
607
+					<input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e('Type Your Title Here', 'lasso'); ?>">
608 608
 						<div class="lasso--select-wrap" style="width:90px">
609 609
 						<select id="lasso--select-type" name="story_type">
610 610
 
611 611
 							<?php
612 612
 								$types = lasso_post_types_names();
613
-								if ( !empty( $types ) ) {
614
-									foreach( $types as $name => $label ) {										
615
-										$type = preg_replace( '/s\b/','', $name );
613
+								if (!empty($types)) {
614
+									foreach ($types as $name => $label) {										
615
+										$type = preg_replace('/s\b/', '', $name);
616 616
 										if ($type == 'page' && !current_user_can('edit_pages')) {
617 617
 											continue;
618 618
 										}
619
-										printf( '<option value="%s">%s</option>', lcfirst( esc_attr( $type ) ) , ucfirst( esc_attr( $label ) ) );
619
+										printf('<option value="%s">%s</option>', lcfirst(esc_attr($type)), ucfirst(esc_attr($label)));
620 620
 									}
621 621
 
622 622
 								}
@@ -627,19 +627,19 @@  discard block
 block discarded – undo
627 627
 				</div>
628 628
 
629 629
 				<div class="lasso--postsettings__footer">
630
-					<a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a>
630
+					<a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a>
631 631
 					<input type="hidden" name="action" value="process_new-object_post">
632 632
 					<?php
633
-						if ( !empty( $types ) ) {
633
+						if (!empty($types)) {
634 634
 							// get the first element
635 635
 							$keys = array_keys($types);
636
-						    $type =$keys[0];						
637
-							$type = preg_replace( '/s\b/','', $type );
638
-							printf( '<input type="hidden" name="object" value="%s">', lcfirst( esc_attr( $type ) ) );		
636
+						    $type = $keys[0];						
637
+							$type = preg_replace('/s\b/', '', $type);
638
+							printf('<input type="hidden" name="object" value="%s">', lcfirst(esc_attr($type)));		
639 639
 						}
640 640
 					?>
641
-					<input type="hidden" name="nonce" value="<?php echo $nonce;?>">
642
-					<input type="submit" value="<?php esc_attr_e( 'Create', 'lasso' );?>">
641
+					<input type="hidden" name="nonce" value="<?php echo $nonce; ?>">
642
+					<input type="submit" value="<?php esc_attr_e('Create', 'lasso'); ?>">
643 643
 				</div>
644 644
 
645 645
 			</form>
@@ -667,18 +667,18 @@  discard block
 block discarded – undo
667 667
 	ob_start();
668 668
 
669 669
 	// post status
670
-	$status = get_post_status( get_the_ID() );
670
+	$status = get_post_status(get_the_ID());
671 671
 
672 672
 	// let users add custom css classes
673
-	$custom_classes = apply_filters( 'lasso_modal_all_post_classes', '' );
673
+	$custom_classes = apply_filters('lasso_modal_all_post_classes', '');
674 674
 
675 675
 	?>
676
-	<div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" style="max-height:100%">
676
+	<div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" style="max-height:100%">
677 677
 		<div class="lasso--modal__inner">
678 678
 
679 679
 			<div class="lasso--post-filtering not-visible">
680 680
 				<div class="lasso--search__results">
681
-					<span id="lasso--results-found"></span><?php _e('results found','lasso');?>
681
+					<span id="lasso--results-found"></span><?php _e('results found', 'lasso'); ?>
682 682
 				</div>
683 683
 				<div class="lasso--search">
684 684
 					<i id="lasso--search__toggle" class="dashicons dashicons-search"></i>
@@ -692,18 +692,18 @@  discard block
 block discarded – undo
692 692
 				$post_types = lasso_post_types_names();
693 693
 				$rest_bases = lasso_post_types_rest_base();
694 694
 
695
-				if ( ! empty( $post_types ) ) {
695
+				if (!empty($post_types)) {
696 696
 					$first = 'active';
697
-					foreach( $post_types as $name => $label ) {
697
+					foreach ($post_types as $name => $label) {
698 698
 						if (array_key_exists($name, $rest_bases)) {
699
-							printf( '<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr( $first), esc_attr( $rest_bases[$name] ), esc_attr( $label ) );
699
+							printf('<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr($first), esc_attr($rest_bases[$name]), esc_attr($label));
700 700
 						}
701 701
 						$first = '';
702 702
 					}
703 703
 
704 704
 				}
705 705
 
706
-				do_action('lasso_modal_post_objects');?>
706
+				do_action('lasso_modal_post_objects'); ?>
707 707
 
708 708
 			</ul>
709 709
 			<div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div>
@@ -723,14 +723,14 @@  discard block
 block discarded – undo
723 723
 
724 724
 
725 725
 	// let users add custom css classes
726
-	$custom_classes = apply_filters( 'lasso_wpimg_classes', '' );
726
+	$custom_classes = apply_filters('lasso_wpimg_classes', '');
727 727
 
728 728
 	?>
729
-	<ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false">
730
-		<li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li>
731
-		<li id="lasso--wpimg-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li>
732
-		<li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li>
733
-		<li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li>
729
+	<ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false">
730
+		<li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li>
731
+		<li id="lasso--wpimg-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li>
732
+		<li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li>
733
+		<li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li>
734 734
 	</ul>
735 735
 
736 736
 	<?php return ob_get_clean();
@@ -742,14 +742,14 @@  discard block
 block discarded – undo
742 742
 
743 743
 
744 744
 	// let users add custom css classes
745
-	$custom_classes = apply_filters( 'lasso_wpimg_classes', '' );
745
+	$custom_classes = apply_filters('lasso_wpimg_classes', '');
746 746
 
747 747
 	?>
748
-	<ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false">
749
-		<li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li>
750
-		<li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li>
751
-		<li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li>
752
-		<li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li>
748
+	<ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false">
749
+		<li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li>
750
+		<li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li>
751
+		<li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li>
752
+		<li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li>
753 753
 	</ul>
754 754
 
755 755
 	<?php return ob_get_clean();
@@ -762,16 +762,16 @@  discard block
 block discarded – undo
762 762
  */
763 763
 function lasso_map_form_footer() {
764 764
 
765
-	$nonce = wp_create_nonce( 'lasso-process-map' );
765
+	$nonce = wp_create_nonce('lasso-process-map');
766 766
 
767 767
 	ob_start();
768 768
 
769 769
 	?>
770 770
 	<div class="lasso--map-form__footer">
771
-		<input type="hidden" name="postid" value="<?php echo get_the_ID();?>">
772
-		<input type="hidden" name="nonce" value="<?php echo $nonce;?>">
771
+		<input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>">
772
+		<input type="hidden" name="nonce" value="<?php echo $nonce; ?>">
773 773
 		<input type="hidden" name="action" value="process_map_save">
774
-		<input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e( 'Save Locations', 'lasso' );?>">
774
+		<input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e('Save Locations', 'lasso'); ?>">
775 775
 	</div>
776 776
 
777 777
 	<?php return ob_get_clean();
@@ -789,7 +789,7 @@  discard block
 block discarded – undo
789 789
 
790 790
 	?>
791 791
 	<div id="lasso--pagerefresh" class="visible">
792
-		<?php _e( 'Save this post and refesh the page to see these changes.', 'lasso' );?>
792
+		<?php _e('Save this post and refesh the page to see these changes.', 'lasso'); ?>
793 793
 	</div>
794 794
 
795 795
 	<?php return ob_get_clean();
@@ -803,43 +803,43 @@  discard block
 block discarded – undo
803 803
  */
804 804
 function lasso_editor_options_blob() {
805 805
 
806
-	$codes   = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : apply_filters( 'lasso_custom_options', '' );
807
-	$galleries  = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery';
806
+	$codes = function_exists('aesop_shortcodes') ? aesop_shortcodes() : apply_filters('lasso_custom_options', '');
807
+	$galleries = function_exists('lasso_editor_galleries_exist') && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery';
808 808
 
809
-	$nonce = wp_create_nonce( 'lasso_gallery' );
809
+	$nonce = wp_create_nonce('lasso_gallery');
810 810
 
811 811
 	$blob = array();
812 812
 
813
-	if ( empty( $codes ) )
813
+	if (empty($codes))
814 814
 		return;
815 815
 
816
-	foreach ( $codes as $slug => $shortcode ) {
816
+	foreach ($codes as $slug => $shortcode) {
817 817
 		$return = '';
818 818
 		// Shortcode has atts
819 819
 
820
-		if ( count( $shortcode['atts'] ) && $shortcode['atts'] ) {
820
+		if (count($shortcode['atts']) && $shortcode['atts']) {
821 821
 
822
-			foreach ( $shortcode['atts'] as $attr_name => $attr_info ) {
822
+			foreach ($shortcode['atts'] as $attr_name => $attr_info) {
823 823
 
824 824
 
825
-				$prefix = isset( $attr_info['prefix'] ) ? sprintf( '<span class="lasso-option-prefix">%s</span>', $attr_info['prefix'] ) : null;
825
+				$prefix = isset($attr_info['prefix']) ? sprintf('<span class="lasso-option-prefix">%s</span>', $attr_info['prefix']) : null;
826 826
 
827 827
 				$return .= '<form id="lasso--component-settings-form" class="'.$galleries.'" method="post">';
828 828
 				$return .= '<p data-option="'.$attr_name.'" class="lasso-option aesop-'.$slug.'-'.$attr_name.'">';
829
-				$return .= '<label for="aesop-generator-attr-' . $attr_name . '">' . $attr_info['desc'] . '</label>';
829
+				$return .= '<label for="aesop-generator-attr-'.$attr_name.'">'.$attr_info['desc'].'</label>';
830 830
 				$return .= '<small class="lasso-option-desc">'.$attr_info['tip'].'</small>';
831 831
 				// Select
832 832
 
833
-				if ( isset( $attr_info['values'] ) ) {
833
+				if (isset($attr_info['values'])) {
834 834
 
835
-					$return .= '<select name="' . $attr_name . '" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr">';
835
+					$return .= '<select name="'.$attr_name.'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr">';
836 836
 
837
-					$i=0;
837
+					$i = 0;
838 838
 
839
-					foreach ( $attr_info['values'] as $attr_value ) {
839
+					foreach ($attr_info['values'] as $attr_value) {
840 840
 						$attr_value_selected = $attr_info['default'] == $attr_value ? ' selected="selected"' : '';
841 841
 
842
-						$return .= '<option value="'.$attr_info['values'][$i]['value'].'" ' . $attr_value_selected . '>'.$attr_info['values'][$i]['name'].'</option>';
842
+						$return .= '<option value="'.$attr_info['values'][$i]['value'].'" '.$attr_value_selected.'>'.$attr_info['values'][$i]['name'].'</option>';
843 843
 
844 844
 						$i++;
845 845
 					}
@@ -848,24 +848,24 @@  discard block
 block discarded – undo
848 848
 
849 849
 				} else {
850 850
 
851
-					$attr_field_type = isset( $attr_info['type'] ) ? $attr_info['type'] : 'text';
851
+					$attr_field_type = isset($attr_info['type']) ? $attr_info['type'] : 'text';
852 852
 
853 853
 					// image upload
854
-					if ( 'media_upload' == $attr_info['type'] ) {
854
+					if ('media_upload' == $attr_info['type']) {
855 855
 
856
-						$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.'" />';
856
+						$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.'" />';
857 857
 						$return .= '<a href="#" id="lasso-upload-img" class="lasso-option-button" /></a>';
858 858
 
859
-					} elseif ( 'color' == $attr_info['type'] ) {
859
+					} elseif ('color' == $attr_info['type']) {
860 860
 
861
-						$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.'" />';
861
+						$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.'" />';
862 862
 
863
-					} elseif ( 'text_area' == $attr_info['type'] ) {
863
+					} elseif ('text_area' == $attr_info['type']) {
864 864
 
865
-						$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.'';
865
+						$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.'';
866 866
 
867 867
 					} else {
868
-						$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.'';
868
+						$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.'';
869 869
 					}
870 870
 				}
871 871
 				$return .= '</p>';
@@ -876,9 +876,9 @@  discard block
 block discarded – undo
876 876
 		///////////////////////////
877 877
 		// START GALLERY AND MAP FRONT END STUFFS
878 878
 		///////////////////////////
879
-		if ( isset( $shortcode['front'] ) && true == $shortcode['front'] ) {
879
+		if (isset($shortcode['front']) && true == $shortcode['front']) {
880 880
 
881
-			if ( 'gallery' == $shortcode['front_type'] ) {
881
+			if ('gallery' == $shortcode['front_type']) {
882 882
 
883 883
 				$return .= lasso_gallery_editor_module();
884 884
 
@@ -889,13 +889,13 @@  discard block
 block discarded – undo
889 889
 		///////////////////////////
890 890
 
891 891
 		// Single shortcode (not closed)
892
-		if ( 'single' == $shortcode['type'] ) {
892
+		if ('single' == $shortcode['type']) {
893 893
 
894 894
 			$return .= '<input type="hidden" name="lasso-generator-content" id="lasso-generator-content" value="false" />';
895 895
 
896 896
 		} else {
897 897
 
898
-			$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>';
898
+			$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>';
899 899
 		}
900 900
 
901 901
 		$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>';
@@ -931,14 +931,14 @@  discard block
 block discarded – undo
931 931
 				<div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div>
932 932
 				<div id="lasso--hide" style="display:none;" class="lasso--post-form">
933 933
 					<i class="lasso-icon lasso-icon-move"></i>
934
-					<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>
934
+					<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>
935 935
 					<div class="lasso--slider_wrap">
936 936
 						<div id="lasso--slider"></div>
937 937
 					</div>
938 938
 					<ul id="lasso--revision-list"></ul>
939 939
 					<div class="lasso--btn-group lasso--btn-group-small">
940
-						<a href="#" class="lasso--btn-secondary" id="lasso--close-modal"><?php _e( 'Cancel', 'lasso' );?></a>
941
-						<a href="#" class="lasso--btn-primary" id="lasso--select-revision"><?php _e( 'Select', 'lasso' );?></a>
940
+						<a href="#" class="lasso--btn-secondary" id="lasso--close-modal"><?php _e('Cancel', 'lasso'); ?></a>
941
+						<a href="#" class="lasso--btn-primary" id="lasso--select-revision"><?php _e('Select', 'lasso'); ?></a>
942 942
 					</div>
943 943
 				</div>
944 944
 
@@ -961,7 +961,7 @@  discard block
 block discarded – undo
961 961
     // Normalize into a six character long hex string
962 962
     $hex = str_replace('#', '', $hex);
963 963
     if (strlen($hex) == 3) {
964
-        $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2);
964
+        $hex = str_repeat(substr($hex, 0, 1), 2).str_repeat(substr($hex, 1, 1), 2).str_repeat(substr($hex, 2, 1), 2);
965 965
     }
966 966
 
967 967
     // Split into three parts: R, G and B
@@ -970,7 +970,7 @@  discard block
 block discarded – undo
970 970
 
971 971
     foreach ($color_parts as $color) {
972 972
         $color   = hexdec($color); // Convert to decimal
973
-        $color   = max(0,min(255,$color + $steps)); // Adjust color
973
+        $color   = max(0, min(255, $color + $steps)); // Adjust color
974 974
         $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code
975 975
     }
976 976
 
Please login to merge, or discard this patch.
lasso.php 1 patch
Spacing   +18 added lines, -18 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.1.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.1.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;
@@ -67,16 +67,16 @@  discard block
 block discarded – undo
67 67
 ));
68 68
 
69 69
 // Gutenberg
70
-if( function_exists( 'is_gutenberg_page' ) ) {
71
-	function add_raw_to_post( $response, $post, $request ) {
70
+if (function_exists('is_gutenberg_page')) {
71
+	function add_raw_to_post($response, $post, $request) {
72 72
 		$response_data = $response->get_data();
73
-		if ( is_array( $response_data['content'] )) {
74
-			$response_data['content']['raw'] =  $post->post_content ;
75
-			$response->set_data( $response_data );
73
+		if (is_array($response_data['content'])) {
74
+			$response_data['content']['raw'] = $post->post_content;
75
+			$response->set_data($response_data);
76 76
 		}
77 77
 
78 78
 		return $response;
79 79
 	}
80
-	add_filter( "rest_prepare_post", 'add_raw_to_post', 10, 3 );
80
+	add_filter("rest_prepare_post", 'add_raw_to_post', 10, 3);
81 81
 }
82 82
 
Please login to merge, or discard this patch.