Completed
Push — master ( 51c0b5...713d70 )
by
unknown
01:53
created
admin/includes/menus/settings.php 2 patches
Braces   +9 added lines, -5 removed lines patch added patch discarded remove patch
@@ -45,8 +45,9 @@  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() )
49
-			return;
48
+		if ( !current_user_can( 'manage_options' ) || !is_user_logged_in() ) {
49
+					return;
50
+		}
50 51
 
51 52
 		if ( isset( $_POST['action'] ) && 'lasso-editor-settings' == $_POST['action'] && check_admin_referer( 'nonce', 'lasso_editor_settings' ) ) {
52 53
 
@@ -86,8 +87,9 @@  discard block
 block discarded – undo
86 87
 	 */
87 88
 	function lasso_editor_settings_form() {
88 89
 
89
-		if ( !is_user_logged_in() )
90
-			return;
90
+		if ( !is_user_logged_in() ) {
91
+					return;
92
+		}
91 93
 
92 94
 		$article_object   = lasso_editor_get_option( 'article_class', 'lasso_editor' );
93 95
 		$featImgClass    = lasso_editor_get_option( 'featimg_class', 'lasso_editor' );
@@ -137,7 +139,9 @@  discard block
 block discarded – undo
137 139
 						$post_types = get_post_types( $args, 'objects' );
138 140
 						 
139 141
 						foreach ( $post_types  as $post_type ) {
140
-						   if ($post_type->name == 'attachment') continue;
142
+						   if ($post_type->name == 'attachment') {
143
+						   	continue;
144
+						   }
141 145
 						   $checked ="";
142 146
 						   if (  in_array( $post_type->name, $allowed_post_types )  ) {
143 147
 								$checked = 'checked="checked"';
Please login to merge, or discard this patch.
Spacing   +122 added lines, -122 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@  discard block
 block discarded – undo
9 9
 
10 10
 	function __construct() {
11 11
 
12
-		add_action( 'admin_menu',     array( $this, 'menu' ) );
13
-		add_action( 'network_admin_menu',   array( $this, 'menu' ) );
14
-		add_action( 'wp_ajax_lasso-editor-settings', array( $this, 'process_settings' ) );
12
+		add_action('admin_menu', array($this, 'menu'));
13
+		add_action('network_admin_menu', array($this, 'menu'));
14
+		add_action('wp_ajax_lasso-editor-settings', array($this, 'process_settings'));
15 15
 
16 16
 	}
17 17
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	function menu() {
24 24
 
25 25
 		// CHANGED Removed condition.
26
-		add_submenu_page( 'lasso-editor', __( 'Settings', 'lasso' ), __( 'Settings', 'lasso' ), 'manage_options', 'lasso-editor-settings', array( $this, 'settings' ) );
26
+		add_submenu_page('lasso-editor', __('Settings', 'lasso'), __('Settings', 'lasso'), 'manage_options', 'lasso-editor-settings', array($this, 'settings'));
27 27
 
28 28
 	}
29 29
 
@@ -45,26 +45,26 @@  discard block
 block discarded – undo
45 45
 	function process_settings() {
46 46
 
47 47
 		// bail out if current user isn't and administrator and they are not logged in
48
-		if ( !current_user_can( 'manage_options' ) || !is_user_logged_in() )
48
+		if (!current_user_can('manage_options') || !is_user_logged_in())
49 49
 			return;
50 50
 
51
-		if ( isset( $_POST['action'] ) && 'lasso-editor-settings' == $_POST['action'] && check_admin_referer( 'nonce', 'lasso_editor_settings' ) ) {
51
+		if (isset($_POST['action']) && 'lasso-editor-settings' == $_POST['action'] && check_admin_referer('nonce', 'lasso_editor_settings')) {
52 52
 
53
-			$options = isset( $_POST['lasso_editor'] ) ? $_POST['lasso_editor'] : false;
53
+			$options = isset($_POST['lasso_editor']) ? $_POST['lasso_editor'] : false;
54 54
 			
55 55
 			$arr = $options['allowed_post_types'];
56
-			$options = array_map( 'sanitize_text_field', $options );
57
-			$options['allowed_post_types'] = array_keys( $arr);
56
+			$options = array_map('sanitize_text_field', $options);
57
+			$options['allowed_post_types'] = array_keys($arr);
58 58
 
59 59
 			
60 60
 
61
-			if ( function_exists( 'is_multisite' ) && is_multisite() ) {
61
+			if (function_exists('is_multisite') && is_multisite()) {
62 62
 
63
-				update_site_option( 'lasso_editor', $options );
63
+				update_site_option('lasso_editor', $options);
64 64
 
65 65
 			} else {
66 66
 
67
-				update_option( 'lasso_editor', $options );
67
+				update_option('lasso_editor', $options);
68 68
 			}
69 69
 
70 70
 			wp_send_json_success();
@@ -86,37 +86,37 @@  discard block
 block discarded – undo
86 86
 	 */
87 87
 	function lasso_editor_settings_form() {
88 88
 
89
-		if ( !is_user_logged_in() )
89
+		if (!is_user_logged_in())
90 90
 			return;
91 91
 
92
-		$article_object   = lasso_editor_get_option( 'article_class', 'lasso_editor' );
93
-		$featImgClass    = lasso_editor_get_option( 'featimg_class', 'lasso_editor' );
94
-		$titleClass    = lasso_editor_get_option( 'title_class', 'lasso_editor' );
95
-
96
-		$post_new_disabled   = lasso_editor_get_option( 'post_adding_disabled', 'lasso_editor' );
97
-		$save_to_post_disabled  = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' );
98
-		$post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' );
99
-		$allow_change_date = lasso_editor_get_option( 'allow_change_date', 'lasso_editor' );
100
-		$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
101
-		$shortcodify_disabled  = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' );
102
-		$enable_autosave  = lasso_editor_get_option( 'enable_autosave', 'lasso_editor' );
103
-
104
-		$toolbar_headings      = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' );
105
-		$toolbar_headings_h4      = lasso_editor_get_option( 'toolbar_headings_h4', 'lasso_editor' );
106
-		$toolbar_show_color      = lasso_editor_get_option( 'toolbar_show_color', 'lasso_editor' );
107
-		$toolbar_show_alignment  = lasso_editor_get_option( 'toolbar_show_alignment', 'lasso_editor' );
92
+		$article_object = lasso_editor_get_option('article_class', 'lasso_editor');
93
+		$featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor');
94
+		$titleClass = lasso_editor_get_option('title_class', 'lasso_editor');
95
+
96
+		$post_new_disabled = lasso_editor_get_option('post_adding_disabled', 'lasso_editor');
97
+		$save_to_post_disabled  = lasso_editor_get_option('post_save_disabled', 'lasso_editor');
98
+		$post_settings_disabled = lasso_editor_get_option('post_settings_disabled', 'lasso_editor');
99
+		$allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor');
100
+		$allow_new_category = lasso_editor_get_option('allow_new_category', 'lasso_editor');
101
+		$shortcodify_disabled  = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor');
102
+		$enable_autosave = lasso_editor_get_option('enable_autosave', 'lasso_editor');
103
+
104
+		$toolbar_headings      = lasso_editor_get_option('toolbar_headings', 'lasso_editor');
105
+		$toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
106
+		$toolbar_show_color      = lasso_editor_get_option('toolbar_show_color', 'lasso_editor');
107
+		$toolbar_show_alignment  = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor');
108 108
 		
109
-		$objectsNoSave  	= lasso_editor_get_option('dont_save', 'lasso_editor');
110
-		$objectsNonEditable  	= lasso_editor_get_option('non_editable', 'lasso_editor');
109
+		$objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor');
110
+		$objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor');
111 111
 		$disable_tour = lasso_editor_get_option('disable_tour', 'lasso_editor');
112 112
 		$show_ignored_items = lasso_editor_get_option('show_ignored_items', 'lasso_editor');
113 113
 		$save_using_rest_disabled = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor');
114 114
 		
115
-		$default_post_types = apply_filters( 'lasso_allowed_post_types', array( 'post', 'page'));
116
-		$allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor',  $default_post_types);
115
+		$default_post_types = apply_filters('lasso_allowed_post_types', array('post', 'page'));
116
+		$allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', $default_post_types);
117 117
 		
118
-		$bold_tag = lasso_editor_get_option( 'bold_tag', 'lasso_editor',  "b");
119
-		$i_tag = lasso_editor_get_option( 'i_tag', 'lasso_editor',  "i");
118
+		$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor', "b");
119
+		$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor', "i");
120 120
 		
121 121
 		$insert_comp_ui = lasso_editor_get_option('insert_comp_ui', 'lasso_editor');
122 122
 		if (!$insert_comp_ui) {
@@ -126,31 +126,31 @@  discard block
 block discarded – undo
126 126
 ?>
127 127
 		<div class="wrap">
128 128
 
129
-	    	<h2><?php _e( 'Editus Settings', 'lasso' );?></h2>
129
+	    	<h2><?php _e('Editus Settings', 'lasso'); ?></h2>
130 130
 
131 131
 			<form id="lasso-editor-settings-form" class="lasso--form-settings" method="post" enctype="multipart/form-data">
132 132
 
133
-				<?php do_action('lasso_settings_before');?>
133
+				<?php do_action('lasso_settings_before'); ?>
134 134
 				
135 135
 				
136 136
 				
137
-				<h3><?php _e( 'Enable for:', 'lasso' );?></h3>
137
+				<h3><?php _e('Enable for:', 'lasso'); ?></h3>
138 138
 				<div class="lasso-editor-settings--option-wrap">
139 139
 					<div class="lasso-editor-settings--option-inner">
140 140
 						
141
-						<span class="lasso--setting-description"><?php _e( 'Enable Editus for the following post types.', 'lasso' );?></span>
141
+						<span class="lasso--setting-description"><?php _e('Enable Editus for the following post types.', 'lasso'); ?></span>
142 142
 						<?php
143 143
 						$args = array(
144 144
 							'public'   => true
145 145
 						);
146 146
 						 
147
-						$allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
148
-						$post_types = get_post_types( $args, 'objects' );
147
+						$allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types);
148
+						$post_types = get_post_types($args, 'objects');
149 149
 						 
150
-						foreach ( $post_types  as $post_type ) {
150
+						foreach ($post_types  as $post_type) {
151 151
 						   if ($post_type->name == 'attachment') continue;
152
-						   $checked ="";
153
-						   if (  in_array( $post_type->name, $allowed_post_types )  ) {
152
+						   $checked = "";
153
+						   if (in_array($post_type->name, $allowed_post_types)) {
154 154
 								$checked = 'checked="checked"';
155 155
 						   }
156 156
 						   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>';
@@ -160,77 +160,77 @@  discard block
 block discarded – undo
160 160
 				</div>
161 161
 				
162 162
 
163
-				<h3><?php _e( 'Internal Settings', 'lasso' );?></h3>
163
+				<h3><?php _e('Internal Settings', 'lasso'); ?></h3>
164 164
 				<div class="lasso-editor-settings--option-wrap">
165 165
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
166
-						<label><?php _e( 'Article Class', 'lasso' );?></label>
167
-						<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>
168
-						<input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr( $article_object );?>" placeholder=".entry-content">
166
+						<label><?php _e('Article Class', 'lasso'); ?></label>
167
+						<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>
168
+						<input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr($article_object); ?>" placeholder=".entry-content">
169 169
 					</div>
170 170
 				
171 171
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
172
-						<label><?php _e( 'Featured Image Class', 'lasso' );?></label>
173
-						<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>
174
-						<input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr( $featImgClass );?>" placeholder=".entry-content">
172
+						<label><?php _e('Featured Image Class', 'lasso'); ?></label>
173
+						<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>
174
+						<input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr($featImgClass); ?>" placeholder=".entry-content">
175 175
 					</div>
176 176
 				
177 177
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
178
-						<label><?php _e( 'Article Title Class', 'lasso' );?></label>
179
-						<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>
180
-						<input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr( $titleClass );?>" placeholder=".entry-content">
178
+						<label><?php _e('Article Title Class', 'lasso'); ?></label>
179
+						<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>
180
+						<input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr($titleClass); ?>" placeholder=".entry-content">
181 181
 					</div>
182 182
 				
183 183
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
184
-						<label><?php _e( 'Ignored Items to Save', 'lasso' );?></label>
185
-						<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>
186
-						<textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNoSave );?></textarea>
184
+						<label><?php _e('Ignored Items to Save', 'lasso'); ?></label>
185
+						<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>
186
+						<textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr($objectsNoSave); ?></textarea>
187 187
 					</div>
188 188
 				
189 189
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
190
-						<label><?php _e( 'Read Only Items', 'lasso' );?></label>
191
-						<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>
192
-						<textarea name="lasso_editor[non_editable]" id="lasso_editor[non_editable]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNonEditable );?></textarea>
190
+						<label><?php _e('Read Only Items', 'lasso'); ?></label>
191
+						<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>
192
+						<textarea name="lasso_editor[non_editable]" id="lasso_editor[non_editable]" placeholder=".classname, .another-class"><?php echo esc_attr($objectsNonEditable); ?></textarea>
193 193
 					</div>
194 194
 				
195 195
 					<div class="lasso-editor-settings--option-inner" >
196
-						<input type="checkbox" class="checkbox" name="lasso_editor[show_ignored_items]" id="lasso_editor[show_ignored_items]" <?php echo checked( $show_ignored_items, 'on' );?> >
197
-						<label for="lasso_editor[show_ignored_items]"> <?php _e( 'Show Ignored Items', 'lasso' );?></label>
198
-						<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>
196
+						<input type="checkbox" class="checkbox" name="lasso_editor[show_ignored_items]" id="lasso_editor[show_ignored_items]" <?php echo checked($show_ignored_items, 'on'); ?> >
197
+						<label for="lasso_editor[show_ignored_items]"> <?php _e('Show Ignored Items', 'lasso'); ?></label>
198
+						<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>
199 199
 					</div>
200 200
 				</div>
201 201
 
202
-				<h3><?php _e( 'Editor UI', 'lasso' );?></h3>
202
+				<h3><?php _e('Editor UI', 'lasso'); ?></h3>
203 203
 				<div class="lasso-editor-settings--option-wrap">
204 204
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
205
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked( $toolbar_headings, 'on' );?> >
206
-						<label for="lasso_editor[toolbar_headings]"><?php _e( 'Enable H2 and H3 Buttons', 'lasso' );?></label>
207
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set H2 and H3 settings.', 'lasso' );?></span>
205
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked($toolbar_headings, 'on'); ?> >
206
+						<label for="lasso_editor[toolbar_headings]"><?php _e('Enable H2 and H3 Buttons', 'lasso'); ?></label>
207
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set H2 and H3 settings.', 'lasso'); ?></span>
208 208
 
209 209
 					</div>
210 210
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
211
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings_h4]" id="lasso_editor[toolbar_headings_h4]" <?php echo checked( $toolbar_headings_h4, 'on' );?> >
212
-						<label for="lasso_editor[toolbar_headings_h4]"><?php _e( 'Enable H4/H5/H6 Buttons', 'lasso' );?></label>
213
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set H4/H5/H6 settings.', 'lasso' );?></span>
211
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings_h4]" id="lasso_editor[toolbar_headings_h4]" <?php echo checked($toolbar_headings_h4, 'on'); ?> >
212
+						<label for="lasso_editor[toolbar_headings_h4]"><?php _e('Enable H4/H5/H6 Buttons', 'lasso'); ?></label>
213
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set H4/H5/H6 settings.', 'lasso'); ?></span>
214 214
 
215 215
 					</div>
216 216
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
217
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_color]" id="lasso_editor[toolbar_show_color]" <?php echo checked( $toolbar_show_color, 'on' );?> >
218
-						<label for="lasso_editor[toolbar_show_color]"><?php _e( 'Enable Text Color Buttons', 'lasso' );?></label>
219
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set text colors.', 'lasso' );?></span>
217
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_color]" id="lasso_editor[toolbar_show_color]" <?php echo checked($toolbar_show_color, 'on'); ?> >
218
+						<label for="lasso_editor[toolbar_show_color]"><?php _e('Enable Text Color Buttons', 'lasso'); ?></label>
219
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set text colors.', 'lasso'); ?></span>
220 220
 
221 221
 					</div>
222 222
 					<div class="lasso-editor-settings--option-inner" style="border:none;">
223
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_alignment]" id="lasso_editor[toolbar_show_alignment]" <?php echo checked( $toolbar_show_alignment, 'on' );?> >
224
-						<label for="lasso_editor[toolbar_show_alignment]"><?php _e( 'Enable Text Align Buttons', 'lasso' );?></label>
225
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set text alignment.', 'lasso' );?></span>
223
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_alignment]" id="lasso_editor[toolbar_show_alignment]" <?php echo checked($toolbar_show_alignment, 'on'); ?> >
224
+						<label for="lasso_editor[toolbar_show_alignment]"><?php _e('Enable Text Align Buttons', 'lasso'); ?></label>
225
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set text alignment.', 'lasso'); ?></span>
226 226
 
227 227
 					</div>
228 228
 					<div class="lasso-editor-settings--option-inner">
229
-					    <label for="lasso_editor[insert_comp_ui]"> <?php _e( 'Insert Component UI', 'lasso' );?></label>
230
-						<span class="lasso--setting-description"><?php _e( 'UI mechanism to insert components', 'lasso' );?></span>
231
-					    <input type="radio" name="lasso_editor[insert_comp_ui]" value='drag' <?php echo checked( $insert_comp_ui, 'drag' );?>> <?php _e( 'Drag and Drop', 'lasso' );?>
232
-						<input type="radio" name="lasso_editor[insert_comp_ui]" value="click" <?php echo checked( $insert_comp_ui, 'click' );?>> <?php _e( 'Click', 'lasso' );?>
233
-						<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', 'lasso' );?>
229
+					    <label for="lasso_editor[insert_comp_ui]"> <?php _e('Insert Component UI', 'lasso'); ?></label>
230
+						<span class="lasso--setting-description"><?php _e('UI mechanism to insert components', 'lasso'); ?></span>
231
+					    <input type="radio" name="lasso_editor[insert_comp_ui]" value='drag' <?php echo checked($insert_comp_ui, 'drag'); ?>> <?php _e('Drag and Drop', 'lasso'); ?>
232
+						<input type="radio" name="lasso_editor[insert_comp_ui]" value="click" <?php echo checked($insert_comp_ui, 'click'); ?>> <?php _e('Click', 'lasso'); ?>
233
+						<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', 'lasso'); ?>
234 234
 					</div>
235 235
 				</div>
236 236
 				
@@ -238,82 +238,82 @@  discard block
 block discarded – undo
238 238
 				
239 239
 				
240 240
 
241
-				<h3><?php _e( 'Post Settings UI', 'lasso' );?></h3>
241
+				<h3><?php _e('Post Settings UI', 'lasso'); ?></h3>
242 242
 				<div class="lasso-editor-settings--option-wrap"  >
243 243
 					<div class="lasso-editor-settings--option-inner" style="border:none">
244
-						<input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked( $post_settings_disabled, 'on' );?> >
245
-						<label for="lasso_editor[post_settings_disabled]"> <?php _e( 'Disable Post Settings', 'lasso' );?></label>
246
-						<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>
244
+						<input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked($post_settings_disabled, 'on'); ?> >
245
+						<label for="lasso_editor[post_settings_disabled]"> <?php _e('Disable Post Settings', 'lasso'); ?></label>
246
+						<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>
247 247
 					</div>
248 248
 					
249 249
 					<div class="lasso-editor-settings--option-inner" style="border:none">
250
-						<input type="checkbox" class="checkbox" name="lasso_editor[allow_change_date]" id="lasso_editor[allow_change_date]" <?php echo checked( $allow_change_date, 'on' );?> >
251
-						<label for="lasso_editor[allow_change_date]"> <?php _e( 'Allow Changing Post Date', 'lasso' );?></label>
252
-						<span class="lasso--setting-description"><?php _e( 'Add the date selector to change the post\'s date to the Post Setting dialog', 'lasso' );?></span>
250
+						<input type="checkbox" class="checkbox" name="lasso_editor[allow_change_date]" id="lasso_editor[allow_change_date]" <?php echo checked($allow_change_date, 'on'); ?> >
251
+						<label for="lasso_editor[allow_change_date]"> <?php _e('Allow Changing Post Date', 'lasso'); ?></label>
252
+						<span class="lasso--setting-description"><?php _e('Add the date selector to change the post\'s date to the Post Setting dialog', 'lasso'); ?></span>
253 253
 					</div>
254 254
 					
255 255
 					<div class="lasso-editor-settings--option-inner" style="border:none">
256
-						<input type="checkbox" class="checkbox" name="lasso_editor[allow_new_category]" id="lasso_editor[allow_new_category]" <?php echo checked( $allow_new_category, 'on' );?> >
257
-						<label for="lasso_editor[allow_new_category]"> <?php _e( 'Allow Adding New Category', 'lasso' );?></label>
258
-						<span class="lasso--setting-description"><?php _e( 'Add the user to create new, previously non-existing categories for posts.', 'lasso' );?></span>
256
+						<input type="checkbox" class="checkbox" name="lasso_editor[allow_new_category]" id="lasso_editor[allow_new_category]" <?php echo checked($allow_new_category, 'on'); ?> >
257
+						<label for="lasso_editor[allow_new_category]"> <?php _e('Allow Adding New Category', 'lasso'); ?></label>
258
+						<span class="lasso--setting-description"><?php _e('Add the user to create new, previously non-existing categories for posts.', 'lasso'); ?></span>
259 259
 					</div>
260 260
 				
261 261
 					<div class="lasso-editor-settings--option-inner" >
262
-						<input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked( $post_new_disabled, 'on' );?> >
263
-						<label for="lasso_editor[post_adding_disabled]"><?php _e( 'Disable Post Adding', 'lasso' );?></label>
264
-						<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>
262
+						<input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked($post_new_disabled, 'on'); ?> >
263
+						<label for="lasso_editor[post_adding_disabled]"><?php _e('Disable Post Adding', 'lasso'); ?></label>
264
+						<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>
265 265
 					</div>
266 266
 					
267 267
 
268 268
 				</div>
269 269
 				
270
-				<h3><?php _e( 'Misc', 'lasso' );?></h3>
270
+				<h3><?php _e('Misc', 'lasso'); ?></h3>
271 271
 				<div class="lasso-editor-settings--option-wrap">
272 272
 					<div class="lasso-editor-settings--option-inner" style="border:none">
273
-						<input type="checkbox" class="checkbox" name="lasso_editor[disable_tour]" id="lasso_editor[disable_tour]" <?php echo checked( $disable_tour, 'on' );?> >
274
-						<label for="lasso_editor[disable_tour]"> <?php _e( 'Do Not Show Tour Dialog', 'lasso' );?></label>
275
-						<span class="lasso--setting-description"><?php _e( 'Check this box to disable the tour dialog box for all users.', 'lasso' );?></span>
273
+						<input type="checkbox" class="checkbox" name="lasso_editor[disable_tour]" id="lasso_editor[disable_tour]" <?php echo checked($disable_tour, 'on'); ?> >
274
+						<label for="lasso_editor[disable_tour]"> <?php _e('Do Not Show Tour Dialog', 'lasso'); ?></label>
275
+						<span class="lasso--setting-description"><?php _e('Check this box to disable the tour dialog box for all users.', 'lasso'); ?></span>
276 276
 					</div>
277 277
 
278 278
 					<div class="lasso-editor-settings--option-inner" style="border:none">
279
-					    <label for="lasso_editor[bold_tag]"> <?php _e( '"Bold" Tag', 'lasso' );?></label>
280
-						<span class="lasso--setting-description"><?php _e( 'Choose the HTML tag used for the "Bold" style.', 'lasso' );?></span>
281
-					    <input type="radio" name="lasso_editor[bold_tag]" value='b' <?php echo checked( $bold_tag, 'b' );?>> b
282
-						<input type="radio" name="lasso_editor[bold_tag]" value="strong" <?php echo checked( $bold_tag, 'strong' );?>> strong
279
+					    <label for="lasso_editor[bold_tag]"> <?php _e('"Bold" Tag', 'lasso'); ?></label>
280
+						<span class="lasso--setting-description"><?php _e('Choose the HTML tag used for the "Bold" style.', 'lasso'); ?></span>
281
+					    <input type="radio" name="lasso_editor[bold_tag]" value='b' <?php echo checked($bold_tag, 'b'); ?>> b
282
+						<input type="radio" name="lasso_editor[bold_tag]" value="strong" <?php echo checked($bold_tag, 'strong'); ?>> strong
283 283
 					</div>
284 284
 					<div class="lasso-editor-settings--option-inner" >
285
-					    <label for="lasso_editor[i_tag]"> <?php _e( '"Italic" Tag', 'lasso' );?></label>
286
-						<span class="lasso--setting-description"><?php _e( 'Choose the HTML tag used for the "Italic" style.', 'lasso' );?></span>
287
-					    <input type="radio" name="lasso_editor[i_tag]" value='i' <?php echo checked( $i_tag, 'i' );?>> i
288
-						<input type="radio" name="lasso_editor[i_tag]" value="em" <?php echo checked( $i_tag, 'em' );?>> em
285
+					    <label for="lasso_editor[i_tag]"> <?php _e('"Italic" Tag', 'lasso'); ?></label>
286
+						<span class="lasso--setting-description"><?php _e('Choose the HTML tag used for the "Italic" style.', 'lasso'); ?></span>
287
+					    <input type="radio" name="lasso_editor[i_tag]" value='i' <?php echo checked($i_tag, 'i'); ?>> i
288
+						<input type="radio" name="lasso_editor[i_tag]" value="em" <?php echo checked($i_tag, 'em'); ?>> em
289 289
 					</div>
290 290
 				</div>
291 291
 
292
-				<h3><?php _e( 'Advanced', 'lasso' );?></h3>
292
+				<h3><?php _e('Advanced', 'lasso'); ?></h3>
293 293
 				<div class="lasso-editor-settings--option-wrap ">
294 294
 					<div class="lasso-editor-settings--option-inner" style="border:none">
295
-						<input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked( $shortcodify_disabled, 'on' );?> >
296
-						<label for="lasso_editor[shortcodify_disabled]"><?php _e( 'Disable Aesop Component Conversion', 'lasso' );?></label>
297
-						<span class="lasso--setting-description"><?php _e( 'Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso' );?></span>
295
+						<input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked($shortcodify_disabled, 'on'); ?> >
296
+						<label for="lasso_editor[shortcodify_disabled]"><?php _e('Disable Aesop Component Conversion', 'lasso'); ?></label>
297
+						<span class="lasso--setting-description"><?php _e('Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso'); ?></span>
298 298
 					</div>
299 299
 				
300 300
 					<div class="lasso-editor-settings--option-inner" style="border:none">
301
-						<input type="checkbox" class="checkbox" name="lasso_editor[enable_autosave]" id="lasso_editor[enable_autosave]" <?php echo checked( $enable_autosave, 'on' );?> >
302
-						<label for="lasso_editor[enable_autosave]"><?php _e( 'Enable Auto Save', 'lasso' );?></label>
303
-						<span class="lasso--setting-description"><?php _e( 'Check this box to enable auto save.', 'lasso' );?></span>
301
+						<input type="checkbox" class="checkbox" name="lasso_editor[enable_autosave]" id="lasso_editor[enable_autosave]" <?php echo checked($enable_autosave, 'on'); ?> >
302
+						<label for="lasso_editor[enable_autosave]"><?php _e('Enable Auto Save', 'lasso'); ?></label>
303
+						<span class="lasso--setting-description"><?php _e('Check this box to enable auto save.', 'lasso'); ?></span>
304 304
 					</div>
305 305
 				
306 306
 					<div class="lasso-editor-settings--option-inner" style="border:none">
307
-						<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' );?> >
308
-						<label for="lasso_editor[post_save_disabled]"><?php _e( 'Disable Post Saving', 'lasso' );?></label>
309
-						<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>
307
+						<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'); ?> >
308
+						<label for="lasso_editor[post_save_disabled]"><?php _e('Disable Post Saving', 'lasso'); ?></label>
309
+						<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>
310 310
 
311 311
 					</div>
312 312
 				
313 313
 					<div class="lasso-editor-settings--option-inner">
314
-						<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' );?> >
315
-						<label for="lasso_editor[save_using_rest_disabled]"><?php _e( "Don't Use REST API to Save", 'lasso' );?></label>
316
-						<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>
314
+						<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'); ?> >
315
+						<label for="lasso_editor[save_using_rest_disabled]"><?php _e("Don't Use REST API to Save", 'lasso'); ?></label>
316
+						<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>
317 317
 
318 318
 					</div>
319 319
 				</div>
@@ -323,11 +323,11 @@  discard block
 block discarded – undo
323 323
 
324 324
 				<div class="lasso-editor-settings--submit">
325 325
 				    <input type="hidden" name="action" value="lasso-editor-settings" />
326
-				    <input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save Settings', 'lasso' );?>" />
327
-					<?php wp_nonce_field( 'nonce', 'lasso_editor_settings' ); ?>
326
+				    <input type="submit" class="button-primary" value="<?php esc_attr_e('Save Settings', 'lasso'); ?>" />
327
+					<?php wp_nonce_field('nonce', 'lasso_editor_settings'); ?>
328 328
 				</div>
329 329
 				
330
-				<?php do_action('lasso_settings_after');?>
330
+				<?php do_action('lasso_settings_after'); ?>
331 331
 			</form>
332 332
 
333 333
 		</div><?php
Please login to merge, or discard this patch.
lasso.php 4 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 add_filter('register_post_type_args', 'lasso_show_in_rest', 10, 2);
49 49
 function lasso_show_in_rest($args, $post_type){
50 50
  
51
-    $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( ) );
51
+	$allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( ) );
52 52
 	$allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
53 53
 	if (in_array( $post_type,$allowed_post_types)) {
54 54
 		$args['show_in_rest'] = true;
@@ -57,6 +57,6 @@  discard block
 block discarded – undo
57 57
 		}
58 58
 	}
59 59
  
60
-    return $args;
60
+	return $args;
61 61
 }
62 62
 
Please login to merge, or discard this patch.
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -61,6 +61,10 @@
 block discarded – undo
61 61
 }
62 62
 
63 63
 
64
+/**
65
+ * @param string $option
66
+ * @param string $section
67
+ */
64 68
 function lasso_editor_get_option( $option, $section, $default = '' ) {
65 69
 
66 70
 	if ( empty( $option ) )
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,8 +63,9 @@
 block discarded – undo
63 63
 
64 64
 function lasso_editor_get_option( $option, $section, $default = '' ) {
65 65
 
66
-	if ( empty( $option ) )
67
-		return;
66
+	if ( empty( $option ) ) {
67
+			return;
68
+	}
68 69
 
69 70
 	if ( function_exists( 'is_multisite' ) && is_multisite() ) {
70 71
 
Please login to merge, or discard this 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', '0.10.1.1' );
27
-define( 'LASSO_DIR', plugin_dir_path( __FILE__ ) );
28
-define( 'LASSO_URL', plugins_url( '', __FILE__ ) );
29
-define( 'LASSO_FILE', __FILE__ );
26
+define('LASSO_VERSION', '0.10.1.1');
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>Lasso requires PHP 5.4 or higher.</p></div>');
44 44
 
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
 }
47 47
 
48 48
 add_filter('register_post_type_args', 'lasso_show_in_rest', 10, 2);
49
-function lasso_show_in_rest($args, $post_type){
49
+function lasso_show_in_rest($args, $post_type) {
50 50
  
51
-    $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( ) );
52
-	$allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
53
-	if (in_array( $post_type,$allowed_post_types)) {
51
+    $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array( ));
52
+	$allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types);
53
+	if (in_array($post_type, $allowed_post_types)) {
54 54
 		$args['show_in_rest'] = true;
55 55
 		if ($post_type != 'post' && $post_type != 'page') {
56 56
 			$args['rest_base'] = $post_type;
@@ -61,21 +61,21 @@  discard block
 block discarded – undo
61 61
 }
62 62
 
63 63
 
64
-function lasso_editor_get_option( $option, $section, $default = '' ) {
64
+function lasso_editor_get_option($option, $section, $default = '') {
65 65
 
66
-	if ( empty( $option ) )
66
+	if (empty($option))
67 67
 		return;
68 68
 
69
-	if ( function_exists( 'is_multisite' ) && is_multisite() ) {
69
+	if (function_exists('is_multisite') && is_multisite()) {
70 70
 
71
-		$options = get_site_option( $section );
71
+		$options = get_site_option($section);
72 72
 
73 73
 	} else {
74 74
 
75
-		$options = get_option( $section );
75
+		$options = get_option($section);
76 76
 	}
77 77
 
78
-	if ( isset( $options[$option] ) ) {
78
+	if (isset($options[$option])) {
79 79
 		return $options[$option];
80 80
 	}
81 81
 
Please login to merge, or discard this patch.
public/includes/components.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -279,6 +279,9 @@
 block discarded – undo
279 279
 endif;
280 280
 
281 281
 // helper function to retrieve one id for default option
282
+/**
283
+ * @param string $type
284
+ */
282 285
 function editus_get_one_id($type)
283 286
 {
284 287
 	$args = array( 'posts_per_page' => 1, 'post_type' => $type );
Please login to merge, or discard this patch.
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -16,80 +16,80 @@  discard block
 block discarded – undo
16 16
 
17 17
 	$array = array(
18 18
 		'quote' => array(
19
-			'name'    => __('Quote','lasso'),
19
+			'name'    => __('Quote', 'lasso'),
20 20
 			'content' => lasso_quote_component(),
21 21
 		),
22 22
 		'image' => array(
23
-			'name'    => __('Image','lasso'),
23
+			'name'    => __('Image', 'lasso'),
24 24
 			'content' => lasso_image_component(),
25 25
 		),
26 26
 		'parallax' => array(
27
-			'name'    => __('Parallax','lasso'),
27
+			'name'    => __('Parallax', 'lasso'),
28 28
 			'content' => lasso_parallax_component(),
29 29
 		),
30 30
 		'audio' => array(
31
-			'name'    => __('Audio','lasso'),
31
+			'name'    => __('Audio', 'lasso'),
32 32
 			'content' => lasso_audio_component(),
33 33
 		),
34 34
 		'content' => array(
35
-			'name'    => __('Content','lasso'),
35
+			'name'    => __('Content', 'lasso'),
36 36
 			'content' => lasso_content_component(),
37 37
 		),
38 38
 		'character' => array(
39
-			'name'    => __('Character','lasso'),
39
+			'name'    => __('Character', 'lasso'),
40 40
 			'content' => lasso_character_component(),
41 41
 		),
42 42
 		'collection' => array(
43
-			'name'    => __('Collection','lasso'),
43
+			'name'    => __('Collection', 'lasso'),
44 44
 			'content' => lasso_collections_component(),
45 45
 		),
46 46
 		'document' => array(
47
-			'name'    => __('Document','lasso'),
47
+			'name'    => __('Document', 'lasso'),
48 48
 			'content' => lasso_document_component(),
49 49
 		),
50 50
 		'gallery' => array(
51
-			'name'    => __('Gallery','lasso'),
51
+			'name'    => __('Gallery', 'lasso'),
52 52
 			'content' => lasso_gallery_component(),
53 53
 		),
54 54
 		'chapter' => array(
55
-			'name'    => __('Chapter','lasso'),
55
+			'name'    => __('Chapter', 'lasso'),
56 56
 			'content' => lasso_heading_component(),
57 57
 		),
58 58
 		'map' => array(
59
-			'name'    => __('Map','lasso'),
59
+			'name'    => __('Map', 'lasso'),
60 60
 			'content' => lasso_map_component(),
61 61
 		),
62 62
 		'timeline_stop' => array(
63
-			'name'    => __('Timeline','lasso'),
63
+			'name'    => __('Timeline', 'lasso'),
64 64
 			'content' => lasso_timeline_component(),
65 65
 		),
66 66
 		'video' => array(
67
-			'name'    => __('Video','lasso'),
67
+			'name'    => __('Video', 'lasso'),
68 68
 			'content' => lasso_video_component(),
69 69
 		),
70 70
 		'wpimg' => array(
71
-			'name'    => __('WordPress Image','lasso'),
71
+			'name'    => __('WordPress Image', 'lasso'),
72 72
 			'content' => lasso_wp_image(),
73 73
 		),
74 74
 		'wpquote' => array(
75
-			'name'    => __('WordPress Quote','lasso'),
75
+			'name'    => __('WordPress Quote', 'lasso'),
76 76
 			'content' => lasso_wp_quote(),
77 77
 		),
78 78
 		'gallery_pop' => array(
79
-			'name'    => __('Gallery Pop','lasso'),
79
+			'name'    => __('Gallery Pop', 'lasso'),
80 80
 			'content' => lasso_gallery_pop_component(),
81 81
 		),
82 82
 		'events' => array(
83
-			'name'    => __('Events','lasso'),
83
+			'name'    => __('Events', 'lasso'),
84 84
 			'content' => lasso_event_component(),
85 85
 		),
86 86
 		'wpvideo' => array(
87
-			'name'    => __('WordPress Image','lasso'),
87
+			'name'    => __('WordPress Image', 'lasso'),
88 88
 			'content' => lasso_wp_video(),
89 89
 		),
90 90
 	);
91 91
 
92
-	return apply_filters( 'lasso_components', $array );
92
+	return apply_filters('lasso_components', $array);
93 93
 }
94 94
 
95 95
 /**
@@ -115,132 +115,132 @@  discard block
 block discarded – undo
115 115
  */
116 116
 
117 117
 // 1
118
-if ( !function_exists( 'lasso_quote_component' ) ):
118
+if (!function_exists('lasso_quote_component')):
119 119
 	function lasso_quote_component() {
120 120
 
121
-		return do_shortcode( '[aesop_quote quote="The Universe is made of stories, not of atoms."]' );
121
+		return do_shortcode('[aesop_quote quote="The Universe is made of stories, not of atoms."]');
122 122
 	}
123 123
 endif;
124 124
 
125 125
 // 2
126
-if ( !function_exists( 'lasso_image_component' ) ):
126
+if (!function_exists('lasso_image_component')):
127 127
 	function lasso_image_component() {
128 128
 
129
-		return do_shortcode( '[aesop_image img="'.LASSO_URL.'/public/assets/img/empty-img.png" align="center" imgwidth="800px"]' );
129
+		return do_shortcode('[aesop_image img="'.LASSO_URL.'/public/assets/img/empty-img.png" align="center" imgwidth="800px"]');
130 130
 	}
131 131
 endif;
132 132
 
133 133
 // 3
134
-if ( !function_exists( 'lasso_parallax_component' ) ):
134
+if (!function_exists('lasso_parallax_component')):
135 135
 	function lasso_parallax_component() {
136 136
 
137
-		return do_shortcode( '[aesop_parallax img="'.LASSO_URL.'/public/assets/img/empty-img.png"]' );
137
+		return do_shortcode('[aesop_parallax img="'.LASSO_URL.'/public/assets/img/empty-img.png"]');
138 138
 	}
139 139
 endif;
140 140
 
141 141
 // 4
142
-if ( !function_exists( 'lasso_audio_component' ) ):
142
+if (!function_exists('lasso_audio_component')):
143 143
 	function lasso_audio_component() {
144 144
 
145
-		return do_shortcode( '[aesop_audio src="http://users.skynet.be/fa046054/home/P22/track06.mp3"]' );
145
+		return do_shortcode('[aesop_audio src="http://users.skynet.be/fa046054/home/P22/track06.mp3"]');
146 146
 
147 147
 	}
148 148
 endif;
149 149
 
150 150
 // 5
151
-if ( !function_exists( 'lasso_content_component' ) ):
151
+if (!function_exists('lasso_content_component')):
152 152
 	function lasso_content_component() {
153 153
 
154
-		return do_shortcode( '[aesop_content]Start typing here...[/aesop_content]' );
154
+		return do_shortcode('[aesop_content]Start typing here...[/aesop_content]');
155 155
 	}
156 156
 endif;
157 157
 
158 158
 // 6
159
-if ( !function_exists( 'lasso_character_component' ) ):
159
+if (!function_exists('lasso_character_component')):
160 160
 	function lasso_character_component() {
161 161
 
162
-		return do_shortcode( '[aesop_character img="'.LASSO_URL.'/public/assets/img/empty-img.png" name="Joes Apartment" width="150px"]' );
162
+		return do_shortcode('[aesop_character img="'.LASSO_URL.'/public/assets/img/empty-img.png" name="Joes Apartment" width="150px"]');
163 163
 
164 164
 	}
165 165
 endif;
166 166
 
167 167
 // 7
168
-if ( !function_exists( 'lasso_collections_component' ) ):
168
+if (!function_exists('lasso_collections_component')):
169 169
 	function lasso_collections_component() {
170 170
 
171
-		return do_shortcode( '[aesop_collection]' );
171
+		return do_shortcode('[aesop_collection]');
172 172
 	}
173 173
 endif;
174 174
 
175 175
 // 8
176
-if ( !function_exists( 'lasso_document_component' ) ):
176
+if (!function_exists('lasso_document_component')):
177 177
 	function lasso_document_component() {
178 178
 
179
-		return do_shortcode( '[aesop_document src="'.LASSO_URL.'/public/assets/img/empty-img.png" ]' );
179
+		return do_shortcode('[aesop_document src="'.LASSO_URL.'/public/assets/img/empty-img.png" ]');
180 180
 
181 181
 	}
182 182
 endif;
183 183
 
184 184
 // 9
185
-if ( !function_exists( 'lasso_gallery_component' ) ):
185
+if (!function_exists('lasso_gallery_component')):
186 186
 	function lasso_gallery_component() {
187 187
 
188
-		return do_shortcode( '[aesop_gallery]' );
188
+		return do_shortcode('[aesop_gallery]');
189 189
 
190 190
 	}
191 191
 endif;
192 192
 
193 193
 // 10
194
-if ( !function_exists( 'lasso_heading_component' ) ):
194
+if (!function_exists('lasso_heading_component')):
195 195
 	function lasso_heading_component() {
196 196
 
197
-		return do_shortcode( '[aesop_chapter title="Chapter One" img="'.LASSO_URL.'/public/assets/img/empty-img.png" full="on"]' );
197
+		return do_shortcode('[aesop_chapter title="Chapter One" img="'.LASSO_URL.'/public/assets/img/empty-img.png" full="on"]');
198 198
 	}
199 199
 endif;
200 200
 
201 201
 // 11
202
-if ( !function_exists( 'lasso_map_component' ) ):
202
+if (!function_exists('lasso_map_component')):
203 203
 	function lasso_map_component() {
204 204
 
205 205
 		return '<form id="lasso--map-form" class="aesop-component aesop-map-component lasso--map-drag-holder" enctype="multipart/form-data">
206 206
 				'.lasso_map_form_footer().'
207
-				'.do_shortcode( '[aesop_map sticky="off"]' ).'
207
+				'.do_shortcode('[aesop_map sticky="off"]').'
208 208
 			</form>';
209 209
 
210 210
 	}
211 211
 endif;
212 212
 
213 213
 // 12
214
-if ( !function_exists( 'lasso_timeline_component' ) ):
214
+if (!function_exists('lasso_timeline_component')):
215 215
 	function lasso_timeline_component() {
216 216
 
217
-		return do_shortcode( '[aesop_timeline_stop num="Title" title="2014"]' );
217
+		return do_shortcode('[aesop_timeline_stop num="Title" title="2014"]');
218 218
 
219 219
 	}
220 220
 endif;
221 221
 
222 222
 // 13
223
-if ( !function_exists( 'lasso_video_component' ) ):
223
+if (!function_exists('lasso_video_component')):
224 224
 	function lasso_video_component() {
225 225
 
226
-		return do_shortcode( '[aesop_video src="vimeo" id="59940289" width="100%" align="center"]' );
226
+		return do_shortcode('[aesop_video src="vimeo" id="59940289" width="100%" align="center"]');
227 227
 
228 228
 	}
229 229
 endif;
230 230
 
231 231
 // 14 - since 0.9.1
232
-if ( !function_exists('lasso_wp_image') ):
232
+if (!function_exists('lasso_wp_image')):
233 233
 
234
-	function lasso_wp_image(){
234
+	function lasso_wp_image() {
235 235
 		return '<div data-component-type="wpimg" class="lasso--wpimg__wrap lasso-component"><img class="wp-image-0" src="'.LASSO_URL.'/public/assets/img/empty-img.png"></div>';
236 236
 	}
237 237
 
238 238
 endif;
239 239
 
240 240
 // 15 - since 0.9.2
241
-if ( !function_exists('lasso_wp_quote') ):
241
+if (!function_exists('lasso_wp_quote')):
242 242
 
243
-	function lasso_wp_quote(){
243
+	function lasso_wp_quote() {
244 244
 		return '<blockquote data-component-type="wpquote" class="lasso--wpquote lasso-component"><p>The universe is made of stories.</p></blockquote>';
245 245
 	}
246 246
 
@@ -248,15 +248,15 @@  discard block
 block discarded – undo
248 248
 
249 249
 // 16 gallery pop added but not fully supported as of 0.9.9.11 
250 250
 
251
-if ( !function_exists( 'lasso_gallery_pop_component' ) ):
251
+if (!function_exists('lasso_gallery_pop_component')):
252 252
 	function lasso_gallery_pop_component() {
253
-		return do_shortcode( '[aesop_gallery_pop]' );
253
+		return do_shortcode('[aesop_gallery_pop]');
254 254
 	}
255 255
 endif;
256 256
 
257 257
 // 17 - work in progress
258 258
 
259
-if ( !function_exists( 'lasso_event_component' ) ):
259
+if (!function_exists('lasso_event_component')):
260 260
 	function lasso_event_component() {
261 261
 		$id = editus_get_one_id('aesop_events');
262 262
 		return '<div data-component-type="events" class="aesop-component lasso-component"><p>Aesop Event: After setting the event, save and reload the page.</p></div>';
@@ -264,9 +264,9 @@  discard block
 block discarded – undo
264 264
 endif;
265 265
 
266 266
 // 18 - work in progress
267
-if ( !function_exists('lasso_wp_video') ):
267
+if (!function_exists('lasso_wp_video')):
268 268
 
269
-	function lasso_wp_video(){
269
+	function lasso_wp_video() {
270 270
 		return '<div data-component-type="wpvideo" class="lasso--wpvideo__wrap lasso-component"><video class="wp-video-0"></video>';
271 271
 	}
272 272
 
@@ -275,10 +275,10 @@  discard block
 block discarded – undo
275 275
 // helper function to retrieve one id for default option
276 276
 function editus_get_one_id($type)
277 277
 {
278
-	$args = array( 'posts_per_page' => 1, 'post_type' => $type );
279
-	$posts = get_posts( $args );
280
-	if ( $posts ) {
281
-		foreach ( $posts as $post ) {
278
+	$args = array('posts_per_page' => 1, 'post_type' => $type);
279
+	$posts = get_posts($args);
280
+	if ($posts) {
281
+		foreach ($posts as $post) {
282 282
 			return $post->ID;
283 283
 		}
284 284
 	}
Please login to merge, or discard this patch.
includes/process/update_object.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -182,7 +182,7 @@
 block discarded – undo
182 182
      *  @param    string|bool     $value    The term slug, or a comma separated list of slugs. Or false to remove all terms set for post.
183 183
 	 *                                      The first item is the name of taxonomy
184 184
 	 *
185
-	 *  @return bool True if update was successful, false if not.
185
+	 *  @return boolean|null True if update was successful, false if not.
186 186
 	 */
187 187
 	public function set_custom_taxonomy( $postid, $value) {
188 188
 		
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 	 *  @since    0.9.3
135 135
 	 *
136 136
 	 *  @param    int    	$postid       	The current postid
137
-     *  @param    string|bool     $value    The term slug, or a comma separated list of slugs. Or false to remove all terms set for post.
137
+	 *  @param    string|bool     $value    The term slug, or a comma separated list of slugs. Or false to remove all terms set for post.
138 138
 	 *  @param    string     $taxonomy    	The name of the taxonomy to which the term belongs.
139 139
 	 *
140 140
 	 *  @return bool True if update was successful, false if not.
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 			}
148 148
 			
149 149
 			if ($taxonomy =='category') {
150
-                // convert from names to category ids
150
+				// convert from names to category ids
151 151
 				$cats = array();
152 152
 				if (is_array($value)) {
153 153
 					foreach ($value as $cat) {
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 	 *
180 180
 	 *
181 181
 	 *  @param    int    	$postid       	The current postid
182
-     *  @param    string|bool     $value    The term slug, or a comma separated list of slugs. Or false to remove all terms set for post.
182
+	 *  @param    string|bool     $value    The term slug, or a comma separated list of slugs. Or false to remove all terms set for post.
183 183
 	 *                                      The first item is the name of taxonomy
184 184
 	 *
185 185
 	 *  @return bool True if update was successful, false if not.
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 				$value = explode( ',', $value );
193 193
 			}
194 194
 						
195
-            // Deleting first array item
195
+			// Deleting first array item
196 196
 			$taxonomy = array_shift($value);
197 197
 			$cats = array();
198 198
 			foreach ($value as $cat) {
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 		
215 215
 		if( $value ) {
216 216
 			$time = current_time('mysql');
217
-            wp_update_post(
217
+			wp_update_post(
218 218
 				array (
219 219
 					'ID'            => $postid, // ID of the post to update
220 220
 					'post_date'     => date( 'Y-m-d H:i:s',  strtotime($value) ),
Please login to merge, or discard this patch.
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 
10 10
 use lasso\internal_api\api_action;
11 11
 
12
-class update_object implements api_action{
12
+class update_object implements api_action {
13 13
 
14 14
 	/**
15 15
 	 * The nonce action for this request.
@@ -29,11 +29,11 @@  discard block
 block discarded – undo
29 29
 	 *
30 30
 	 * @return bool Always returns true.
31 31
 	 */
32
-	public function post( $data ) {
32
+	public function post($data) {
33 33
 
34
-		$status = isset( $data['status'] ) ? $data['status'] : false;
35
-		$postid = isset( $data['postid'] ) ? $data['postid'] : false;
36
-		$slug   = isset( $data['story_slug'] ) ? $data['story_slug'] : false;
34
+		$status = isset($data['status']) ? $data['status'] : false;
35
+		$postid = isset($data['postid']) ? $data['postid'] : false;
36
+		$slug   = isset($data['story_slug']) ? $data['story_slug'] : false;
37 37
 
38 38
 
39 39
 
@@ -43,28 +43,28 @@  discard block
 block discarded – undo
43 43
 			'post_status' 	=> $status
44 44
 		);
45 45
 
46
-		wp_update_post( apply_filters( 'lasso_object_status_update_args', $args ) );
46
+		wp_update_post(apply_filters('lasso_object_status_update_args', $args));
47 47
 
48 48
 
49 49
 		// update categories
50
-		$cats  = isset( $data['story_cats'] ) ? $data['story_cats'] : false;
51
-		self::set_post_terms( $postid, $cats, 'category' );
50
+		$cats = isset($data['story_cats']) ? $data['story_cats'] : false;
51
+		self::set_post_terms($postid, $cats, 'category');
52 52
 
53 53
 
54 54
 		// update tags
55
-		$tags = isset( $data['story_tags'] ) ? $data['story_tags'] : false;
56
-		self::set_post_terms( $postid, $tags, 'post_tag' );
55
+		$tags = isset($data['story_tags']) ? $data['story_tags'] : false;
56
+		self::set_post_terms($postid, $tags, 'post_tag');
57 57
 		
58 58
 		// update custom taxonomy
59
-		$taxs  = isset( $data['story_custom_taxonomy'] ) ? $data['story_custom_taxonomy'] : false;
60
-		self::set_custom_taxonomy( $postid, $taxs );
59
+		$taxs = isset($data['story_custom_taxonomy']) ? $data['story_custom_taxonomy'] : false;
60
+		self::set_custom_taxonomy($postid, $taxs);
61 61
 		
62 62
 		//update date
63
-		$date  = isset( $data['post_date'] ) ? $data['post_date'] : false;
64
-		self::set_date( $postid, $date );
63
+		$date = isset($data['post_date']) ? $data['post_date'] : false;
64
+		self::set_date($postid, $date);
65 65
 
66 66
 
67
-		do_action( 'lasso_post_updated', $postid, $slug, $status, get_current_user_ID() );
67
+		do_action('lasso_post_updated', $postid, $slug, $status, get_current_user_ID());
68 68
 
69 69
 		return true;
70 70
 
@@ -78,8 +78,8 @@  discard block
 block discarded – undo
78 78
 	 *
79 79
 	 * @return array Array of keys to pull from $_POST per action and their sanitization callback
80 80
 	 */
81
-	public static function params(){
82
-		$params[ 'process_update_object_post' ] = array(
81
+	public static function params() {
82
+		$params['process_update_object_post'] = array(
83 83
 			'postid' => 'absint',
84 84
 			'status' => 'strip_tags',
85 85
 			'story_slug' => array(
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	 * @return array Array of additional functions to use to authorize action.
118 118
 	 */
119 119
 	public static function auth_callbacks() {
120
-		$params[ 'process_update_object_post' ] = array(
120
+		$params['process_update_object_post'] = array(
121 121
 			'lasso_user_can'
122 122
 		);
123 123
 
@@ -139,14 +139,14 @@  discard block
 block discarded – undo
139 139
 	 *
140 140
 	 *  @return bool True if update was successful, false if not.
141 141
 	 */
142
-	public function set_post_terms( $postid, $value, $taxonomy ) {
143
-		if( $value ) {
142
+	public function set_post_terms($postid, $value, $taxonomy) {
143
+		if ($value) {
144 144
 			// first check if multiple, make array if so.
145
-			if ( self::has_multiple_objects( $value ) ) {	
146
-				$value = explode( ',', $value );
145
+			if (self::has_multiple_objects($value)) {	
146
+				$value = explode(',', $value);
147 147
 			}
148 148
 			
149
-			if ($taxonomy =='category') {
149
+			if ($taxonomy == 'category') {
150 150
                 // convert from names to category ids
151 151
 				$cats = array();
152 152
 				if (is_array($value)) {
@@ -159,17 +159,17 @@  discard block
 block discarded – undo
159 159
 				}
160 160
 			}
161 161
 	
162
-			$result = wp_set_object_terms( $postid, $value, $taxonomy );
162
+			$result = wp_set_object_terms($postid, $value, $taxonomy);
163 163
 		}
164
-		else  {
164
+		else {
165 165
 			//remove all terms from post
166
-			$result = wp_set_object_terms( $postid, null, $taxonomy );
166
+			$result = wp_set_object_terms($postid, null, $taxonomy);
167 167
 
168 168
 		}
169 169
 
170
-		if ( ! is_wp_error( $result ) ) {
170
+		if (!is_wp_error($result)) {
171 171
 			return true;
172
-		}else{
172
+		} else {
173 173
 			return false;
174 174
 		}
175 175
 	}
@@ -184,12 +184,12 @@  discard block
 block discarded – undo
184 184
 	 *
185 185
 	 *  @return bool True if update was successful, false if not.
186 186
 	 */
187
-	public function set_custom_taxonomy( $postid, $value) {
187
+	public function set_custom_taxonomy($postid, $value) {
188 188
 		
189
-		if( $value ) {
189
+		if ($value) {
190 190
 			// first check if multiple, make array if so.
191
-			if ( self::has_multiple_objects( $value ) ) {	
192
-				$value = explode( ',', $value );
191
+			if (self::has_multiple_objects($value)) {	
192
+				$value = explode(',', $value);
193 193
 			}
194 194
 						
195 195
             // Deleting first array item
@@ -201,24 +201,24 @@  discard block
 block discarded – undo
201 201
 			$value = $cats;
202 202
 			
203 203
 	
204
-			$result = wp_set_object_terms( $postid, $cats, $taxonomy );
205
-			if ( ! is_wp_error( $result ) ) {
204
+			$result = wp_set_object_terms($postid, $cats, $taxonomy);
205
+			if (!is_wp_error($result)) {
206 206
 				return true;
207
-			}else{
207
+			} else {
208 208
 				return false;
209 209
 			}
210 210
 		}
211 211
 	}
212 212
 	
213
-	public function set_date( $postid, $value) {
213
+	public function set_date($postid, $value) {
214 214
 		
215
-		if( $value ) {
215
+		if ($value) {
216 216
 			$time = current_time('mysql');
217 217
             wp_update_post(
218
-				array (
218
+				array(
219 219
 					'ID'            => $postid, // ID of the post to update
220
-					'post_date'     => date( 'Y-m-d H:i:s',  strtotime($value) ),
221
-					'post_date_gmt'     => gmdate( 'Y-m-d H:i:s',  strtotime($value) ),
220
+					'post_date'     => date('Y-m-d H:i:s', strtotime($value)),
221
+					'post_date_gmt'     => gmdate('Y-m-d H:i:s', strtotime($value)),
222 222
 				)
223 223
 			);
224 224
 		}
@@ -232,9 +232,9 @@  discard block
 block discarded – undo
232 232
 	 *  @return   bool               True if there are multiple terms; otherwise, false.
233 233
 	 *	@since   0.9.3
234 234
 	 */
235
-	public function has_multiple_objects( $value ) {
235
+	public function has_multiple_objects($value) {
236 236
 
237
-		return 0 < strpos( $value, ',' );
237
+		return 0 < strpos($value, ',');
238 238
 
239 239
 	}
240 240
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -160,8 +160,7 @@  discard block
 block discarded – undo
160 160
 			}
161 161
 	
162 162
 			$result = wp_set_object_terms( $postid, $value, $taxonomy );
163
-		}
164
-		else  {
163
+		} else  {
165 164
 			//remove all terms from post
166 165
 			$result = wp_set_object_terms( $postid, null, $taxonomy );
167 166
 
@@ -169,7 +168,7 @@  discard block
 block discarded – undo
169 168
 
170 169
 		if ( ! is_wp_error( $result ) ) {
171 170
 			return true;
172
-		}else{
171
+		} else{
173 172
 			return false;
174 173
 		}
175 174
 	}
@@ -204,7 +203,7 @@  discard block
 block discarded – undo
204 203
 			$result = wp_set_object_terms( $postid, $cats, $taxonomy );
205 204
 			if ( ! is_wp_error( $result ) ) {
206 205
 				return true;
207
-			}else{
206
+			} else{
208 207
 				return false;
209 208
 			}
210 209
 		}
Please login to merge, or discard this patch.
public/includes/lasso.php 4 patches
Doc Comments   +8 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 	 *
77 77
 	 * @since    0.0.1
78 78
 	 *
79
-	 * @return    Plugin slug variable.
79
+	 * @return    string slug variable.
80 80
 	 */
81 81
 	public function get_plugin_slug() {
82 82
 		return $this->plugin_slug;
@@ -330,6 +330,9 @@  discard block
 block discarded – undo
330 330
 		exit;
331 331
 	}
332 332
 	
333
+	/**
334
+	 * @param string $type
335
+	 */
333 336
 	public static function enable_metasave($type)
334 337
 	{
335 338
 		register_rest_field( $type, 'metadata', array(
@@ -422,6 +425,10 @@  discard block
 block discarded – undo
422 425
 		
423 426
 		exit; 
424 427
 	}
428
+
429
+	/**
430
+	 * @param string $taxonomy
431
+	 */
425 432
 	public function set_post_terms( $postid, $value, $taxonomy ) {
426 433
 		if( $value ) {
427 434
 			$value = explode( ',', $value );
Please login to merge, or discard this patch.
Braces   +12 added lines, -23 removed lines patch added patch discarded remove patch
@@ -372,44 +372,34 @@  discard block
 block discarded – undo
372 372
 		if ($code == "aesop_video") {
373 373
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
374 374
 		    echo aesop_video_shortcode($atts);
375
-		}
376
-		else if ($code == "aesop_image") {
375
+		} else if ($code == "aesop_image") {
377 376
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
378 377
 		    echo aesop_image_shortcode($atts);
379
-		}
380
-		else if ($code == "aesop_quote") {
378
+		} else if ($code == "aesop_quote") {
381 379
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
382 380
 		    echo aesop_quote_shortcode($atts);
383
-		}
384
-		else if ($code == "aesop_parallax") {
381
+		} else if ($code == "aesop_parallax") {
385 382
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
386 383
 		    echo aesop_parallax_shortcode($atts);
387
-		}
388
-		else if ($code == "aesop_character") {
384
+		} else if ($code == "aesop_character") {
389 385
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
390 386
 		    echo aesop_character_shortcode($atts);
391
-		}
392
-		else if ($code == "aesop_collection") {
387
+		} else if ($code == "aesop_collection") {
393 388
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
394 389
 		    echo aesop_collection_shortcode($atts);
395
-		}
396
-		else if ($code == "aesop_chapter") {
390
+		} else if ($code == "aesop_chapter") {
397 391
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
398 392
 		    echo aesop_chapter_shortcode($atts);
399
-		}
400
-		else if ($code == "aesop_content") {
393
+		} else if ($code == "aesop_content") {
401 394
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
402 395
 		    echo aesop_content_shortcode($atts, $atts['content_data']);
403
-		}
404
-		else if ($code == "aesop_gallery") {
396
+		} else if ($code == "aesop_gallery") {
405 397
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
406 398
 		    echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
407
-		}
408
-		else if ($code == "aesop_audio") {
399
+		} else if ($code == "aesop_audio") {
409 400
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
410 401
 		    echo aesop_audio_shortcode($atts);
411
-		}
412
-		else {
402
+		} else {
413 403
 			$code = '['.$code.' ';
414 404
 			foreach ($atts as $key => $value) {
415 405
 			    $code = ''.$key.'="'.$value.'" ';
@@ -436,15 +426,14 @@  discard block
 block discarded – undo
436 426
 			}
437 427
 	
438 428
 			$result = wp_set_object_terms( $postid, $value, $taxonomy );
439
-		}
440
-		else  {
429
+		} else  {
441 430
 			//remove all terms from post
442 431
 			$result = wp_set_object_terms( $postid, null, $taxonomy );
443 432
 		}
444 433
 
445 434
 		if ( ! is_wp_error( $result ) ) {
446 435
 			return true;
447
-		}else{
436
+		} else{
448 437
 			return false;
449 438
 		}
450 439
 	}
Please login to merge, or discard this patch.
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -261,14 +261,14 @@  discard block
 block discarded – undo
261 261
 		$out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' );
262 262
 	}
263 263
 	
264
-    // new ajax function to lock post for editing
264
+	// new ajax function to lock post for editing
265 265
 	public function editus_lock_post()
266 266
 	{
267 267
 		$post_id= $_POST["postid"];
268 268
 		$locked = wp_check_post_lock($post_id);
269 269
 		
270 270
 		if (!$locked) {
271
-		    wp_set_post_lock($post_id);
271
+			wp_set_post_lock($post_id);
272 272
 			echo "true";
273 273
 		} else {
274 274
 			$user_info = get_userdata($locked);
@@ -366,59 +366,59 @@  discard block
 block discarded – undo
366 366
 		 );
367 367
 		foreach ($_POST as $key => $value) {
368 368
 			if ($key !="code" && $key !="action") {
369
-			    //$shortcode = $shortcode.$key.'="'.$value.'" ';
369
+				//$shortcode = $shortcode.$key.'="'.$value.'" ';
370 370
 				$atts[$key] = $value;
371 371
 			}
372 372
 		}
373 373
 		if ($code == "aesop_video") {
374
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
375
-		    echo aesop_video_shortcode($atts);
374
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
375
+			echo aesop_video_shortcode($atts);
376 376
 		}
377 377
 		else if ($code == "aesop_image") {
378
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
379
-		    echo aesop_image_shortcode($atts);
378
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
379
+			echo aesop_image_shortcode($atts);
380 380
 		}
381 381
 		else if ($code == "aesop_quote") {
382
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
383
-		    echo aesop_quote_shortcode($atts);
382
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
383
+			echo aesop_quote_shortcode($atts);
384 384
 		}
385 385
 		else if ($code == "aesop_parallax") {
386
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
387
-		    echo aesop_parallax_shortcode($atts);
386
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
387
+			echo aesop_parallax_shortcode($atts);
388 388
 		}
389 389
 		else if ($code == "aesop_character") {
390
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
391
-		    echo aesop_character_shortcode($atts);
390
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
391
+			echo aesop_character_shortcode($atts);
392 392
 		}
393 393
 		else if ($code == "aesop_collection") {
394
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
395
-		    echo aesop_collection_shortcode($atts);
394
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
395
+			echo aesop_collection_shortcode($atts);
396 396
 		}
397 397
 		else if ($code == "aesop_chapter") {
398
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
399
-		    echo aesop_chapter_shortcode($atts);
398
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
399
+			echo aesop_chapter_shortcode($atts);
400 400
 		}
401 401
 		else if ($code == "aesop_content") {
402
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
403
-		    echo aesop_content_shortcode($atts, $atts['content_data']);
402
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
403
+			echo aesop_content_shortcode($atts, $atts['content_data']);
404 404
 		}
405 405
 		else if ($code == "aesop_gallery") {
406
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
407
-		    echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
406
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
407
+			echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
408 408
 		}
409 409
 		else if ($code == "aesop_audio") {
410
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
411
-		    echo aesop_audio_shortcode($atts);
410
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
411
+			echo aesop_audio_shortcode($atts);
412 412
 		}
413 413
 		else {
414 414
 			$code = '['.$code.' ';
415 415
 			foreach ($atts as $key => $value) {
416
-			    $code = ''.$key.'="'.$value.'" ';
416
+				$code = ''.$key.'="'.$value.'" ';
417 417
 			}
418 418
 			$code = $code.']';
419 419
 			echo do_shortcode($code);
420
-		    //require_once( ABSPATH . '/wp-content/plugins/aesop-events/public/includes/shortcode.php');
421
-		    //echo aesop_audio_shortcode($atts);
420
+			//require_once( ABSPATH . '/wp-content/plugins/aesop-events/public/includes/shortcode.php');
421
+			//echo aesop_audio_shortcode($atts);
422 422
 		}
423 423
 		
424 424
 		exit; 
@@ -429,14 +429,14 @@  discard block
 block discarded – undo
429 429
 			$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
430 430
 			
431 431
 			if ($taxonomy =='category') {
432
-                // convert from names to category ids
432
+				// convert from names to category ids
433 433
 				$cats = array();
434 434
 				foreach ($value as $cat) {
435 435
 					$cat_id = get_cat_ID($cat);
436 436
 					if ($cat_id !=0) {
437 437
 						$cats [] = $cat_id;
438 438
 					} else if ($allow_new_category) {
439
-					    $cats [] = wp_create_category($cat);
439
+						$cats [] = wp_create_category($cat);
440 440
 					}
441 441
 				}
442 442
 				$value = $cats;
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
 	
459 459
 	public function set_date( $postid, $value) {
460 460
 		if( $value ) {
461
-            wp_update_post(
461
+			wp_update_post(
462 462
 				array (
463 463
 					'ID'            => $postid, // ID of the post to update
464 464
 					'post_date'     => date( 'Y-m-d H:i:s',  strtotime($value) ),
Please login to merge, or discard this patch.
Spacing   +82 added lines, -82 removed lines patch added patch discarded remove patch
@@ -52,16 +52,16 @@  discard block
 block discarded – undo
52 52
 		require_once LASSO_DIR.'/public/includes/wrap-shortcodes.php';
53 53
 
54 54
 		// Activate plugin when new blog is added
55
-		add_action( 'wpmu_new_blog', array( $this, 'activate_new_site' ) );
55
+		add_action('wpmu_new_blog', array($this, 'activate_new_site'));
56 56
 
57 57
 		// Load plugin text domain
58
-		add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
58
+		add_action('init', array($this, 'load_plugin_textdomain'));
59 59
 		
60
-		add_action( 'wp_ajax_get_aesop_component',     array( $this, 'get_aesop_component' ) );
61
-		add_action( 'wp_ajax_editus_do_shortcode',     array( $this, 'editus_do_shortcode' ) );
62
-		add_action( 'wp_ajax_editus_lock_post',     array( $this, 'editus_lock_post' ) );
63
-		add_action( 'wp_ajax_editus_hide_tour',     array( $this, 'editus_hide_tour' ) );
64
-		add_action( 'wp_ajax_editus_set_post_setting',     array( $this, 'editus_set_post_setting' ) );
60
+		add_action('wp_ajax_get_aesop_component', array($this, 'get_aesop_component'));
61
+		add_action('wp_ajax_editus_do_shortcode', array($this, 'editus_do_shortcode'));
62
+		add_action('wp_ajax_editus_lock_post', array($this, 'editus_lock_post'));
63
+		add_action('wp_ajax_editus_hide_tour', array($this, 'editus_hide_tour'));
64
+		add_action('wp_ajax_editus_set_post_setting', array($this, 'editus_set_post_setting'));
65 65
 
66 66
 		// enable saving custom fields through REST API
67 67
 		self::enable_metasave('post');
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 	public static function get_instance() {
93 93
 
94 94
 		// If the single instance hasn't been set, set it now.
95
-		if ( null == self::$instance ) {
95
+		if (null == self::$instance) {
96 96
 			self::$instance = new self;
97 97
 		}
98 98
 
@@ -109,18 +109,18 @@  discard block
 block discarded – undo
109 109
 	 *                                       WPMU is disabled or plugin is
110 110
 	 *                                       activated on an individual blog.
111 111
 	 */
112
-	public static function activate( $network_wide ) {
112
+	public static function activate($network_wide) {
113 113
 
114
-		if ( function_exists( 'is_multisite' ) && is_multisite() ) {
114
+		if (function_exists('is_multisite') && is_multisite()) {
115 115
 
116
-			if ( $network_wide  ) {
116
+			if ($network_wide) {
117 117
 
118 118
 				// Get all blog ids
119 119
 				$blog_ids = self::get_blog_ids();
120 120
 
121
-				foreach ( $blog_ids as $blog_id ) {
121
+				foreach ($blog_ids as $blog_id) {
122 122
 
123
-					switch_to_blog( $blog_id );
123
+					switch_to_blog($blog_id);
124 124
 					self::single_activate();
125 125
 				}
126 126
 
@@ -146,18 +146,18 @@  discard block
 block discarded – undo
146 146
 	 *                                       WPMU is disabled or plugin is
147 147
 	 *                                       deactivated on an individual blog.
148 148
 	 */
149
-	public static function deactivate( $network_wide ) {
149
+	public static function deactivate($network_wide) {
150 150
 
151
-		if ( function_exists( 'is_multisite' ) && is_multisite() ) {
151
+		if (function_exists('is_multisite') && is_multisite()) {
152 152
 
153
-			if ( $network_wide ) {
153
+			if ($network_wide) {
154 154
 
155 155
 				// Get all blog ids
156 156
 				$blog_ids = self::get_blog_ids();
157 157
 
158
-				foreach ( $blog_ids as $blog_id ) {
158
+				foreach ($blog_ids as $blog_id) {
159 159
 
160
-					switch_to_blog( $blog_id );
160
+					switch_to_blog($blog_id);
161 161
 					self::single_deactivate();
162 162
 
163 163
 				}
@@ -181,13 +181,13 @@  discard block
 block discarded – undo
181 181
 	 *
182 182
 	 * @param int     $blog_id ID of the new blog.
183 183
 	 */
184
-	public function activate_new_site( $blog_id ) {
184
+	public function activate_new_site($blog_id) {
185 185
 
186
-		if ( 1 !== did_action( 'wpmu_new_blog' ) ) {
186
+		if (1 !== did_action('wpmu_new_blog')) {
187 187
 			return;
188 188
 		}
189 189
 
190
-		switch_to_blog( $blog_id );
190
+		switch_to_blog($blog_id);
191 191
 		self::single_activate();
192 192
 		restore_current_blog();
193 193
 
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 			WHERE archived = '0' AND spam = '0'
213 213
 			AND deleted = '0'";
214 214
 
215
-		return $wpdb->get_col( $sql );
215
+		return $wpdb->get_col($sql);
216 216
 
217 217
 	}
218 218
 
@@ -223,18 +223,18 @@  discard block
 block discarded – undo
223 223
 	 */
224 224
 	private static function single_activate() {
225 225
 
226
-		$curr_version = get_option( 'lasso_version' );
226
+		$curr_version = get_option('lasso_version');
227 227
 
228 228
 		// update upgraded from
229
-		if ( $curr_version ) {
230
-			update_option( 'lasso_updated_from', $curr_version );
229
+		if ($curr_version) {
230
+			update_option('lasso_updated_from', $curr_version);
231 231
 		}
232 232
 
233 233
 		// update lasso version option
234
-		update_option( 'lasso_version', LASSO_VERSION );
234
+		update_option('lasso_version', LASSO_VERSION);
235 235
 
236 236
 		// set transietn for activation welcome
237
-		set_transient( '_lasso_welcome_redirect', true, 30 );
237
+		set_transient('_lasso_welcome_redirect', true, 30);
238 238
 
239 239
 
240 240
 	}
@@ -256,15 +256,15 @@  discard block
 block discarded – undo
256 256
 	public function load_plugin_textdomain() {
257 257
 
258 258
 		$domain = $this->plugin_slug;
259
-		$locale = apply_filters( 'plugin_locale', get_locale(), $domain );
259
+		$locale = apply_filters('plugin_locale', get_locale(), $domain);
260 260
 
261
-		$out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' );
261
+		$out = load_textdomain($domain, trailingslashit(LASSO_DIR).'languages/'.$domain.'-'.$locale.'.mo');
262 262
 	}
263 263
 	
264 264
     // new ajax function to lock post for editing
265 265
 	public function editus_lock_post()
266 266
 	{
267
-		$post_id= $_POST["postid"];
267
+		$post_id = $_POST["postid"];
268 268
 		$locked = wp_check_post_lock($post_id);
269 269
 		
270 270
 		if (!$locked) {
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 			echo "true";
273 273
 		} else {
274 274
 			$user_info = get_userdata($locked);
275
-			echo "Post opened by ".$user_info->first_name .  " " . $user_info->last_name;
275
+			echo "Post opened by ".$user_info->first_name." ".$user_info->last_name;
276 276
 		}
277 277
 		exit;
278 278
 	}
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 	{
283 283
 		$user_id = get_current_user_ID();
284 284
 				
285
-		update_user_meta( $user_id, 'lasso_hide_tour', true );
285
+		update_user_meta($user_id, 'lasso_hide_tour', true);
286 286
 		exit;
287 287
 	}
288 288
 	
@@ -293,14 +293,14 @@  discard block
 block discarded – undo
293 293
 		$data = array();
294 294
 		parse_str($_POST['data'], $data);
295 295
 		
296
-		if (!wp_verify_nonce( $data[ 'nonce' ], 'lasso-update-post-settings' )) {
296
+		if (!wp_verify_nonce($data['nonce'], 'lasso-update-post-settings')) {
297 297
 			wp_send_json_error();
298 298
 			exit;
299 299
 		}
300 300
 		
301
-		$status = isset( $data['status'] ) ? $data['status'] : false;
302
-		$postid = isset( $data['postid'] ) ? $data['postid'] : false;
303
-		$slug   = isset( $data['story_slug'] ) ? $data['story_slug'] : false;
301
+		$status = isset($data['status']) ? $data['status'] : false;
302
+		$postid = isset($data['postid']) ? $data['postid'] : false;
303
+		$slug   = isset($data['story_slug']) ? $data['story_slug'] : false;
304 304
 	
305 305
 
306 306
 		$args = array(
@@ -311,33 +311,33 @@  discard block
 block discarded – undo
311 311
 		
312 312
 		
313 313
 
314
-		wp_update_post( apply_filters( 'lasso_object_status_update_args', $args ) );
314
+		wp_update_post(apply_filters('lasso_object_status_update_args', $args));
315 315
 		
316 316
 		// update categories
317
-		$cats  = isset( $data['story_cats'] ) ? $data['story_cats'] : false;
317
+		$cats = isset($data['story_cats']) ? $data['story_cats'] : false;
318 318
 		
319
-		self::set_post_terms( $postid, $cats, 'category' );
319
+		self::set_post_terms($postid, $cats, 'category');
320 320
 		
321 321
 		// update tags
322
-		$tags = isset( $data['story_tags'] ) ? $data['story_tags'] : false;
323
-		self::set_post_terms( $postid, $tags, 'post_tag' );
322
+		$tags = isset($data['story_tags']) ? $data['story_tags'] : false;
323
+		self::set_post_terms($postid, $tags, 'post_tag');
324 324
 		
325 325
 		//update date
326
-		$date  = isset( $data['post_date'] ) ? $data['post_date'] : false;
327
-		self::set_date( $postid, $date );
326
+		$date = isset($data['post_date']) ? $data['post_date'] : false;
327
+		self::set_date($postid, $date);
328 328
 		
329
-		do_action( 'lasso_post_updated', $postid, $slug, $status, get_current_user_ID() );
329
+		do_action('lasso_post_updated', $postid, $slug, $status, get_current_user_ID());
330 330
 		wp_send_json_success();
331 331
 		exit;
332 332
 	}
333 333
 	
334 334
 	public static function enable_metasave($type)
335 335
 	{
336
-		register_rest_field( $type, 'metadata', array(
337
-			'get_callback' => function ( $data ) {
338
-				return get_post_meta( $data['id']);//, '', '' );
336
+		register_rest_field($type, 'metadata', array(
337
+			'get_callback' => function($data) {
338
+				return get_post_meta($data['id']); //, '', '' );
339 339
 			}, 
340
-			'update_callback' => function( $data, $post ) {
340
+			'update_callback' => function($data, $post) {
341 341
 				foreach ($data as $key => $value) {
342 342
 					update_post_meta($post->ID, $key, $value);
343 343
 				}
@@ -349,13 +349,13 @@  discard block
 block discarded – undo
349 349
 	public function editus_do_shortcode()
350 350
 	{
351 351
 		
352
-		$code= $_POST["code"];
352
+		$code = $_POST["code"];
353 353
 		$code = str_replace('\"', '"', $code);
354 354
 		
355
-		$code_wrapped = lasso_wrap_shortcodes( $code);
356
-		$out =  do_shortcode($code);
355
+		$code_wrapped = lasso_wrap_shortcodes($code);
356
+		$out = do_shortcode($code);
357 357
 		if ($out != '') {
358
-			$out =  do_shortcode($code_wrapped);
358
+			$out = do_shortcode($code_wrapped);
359 359
 			echo $out;
360 360
 			exit;
361 361
 		}
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
 		/** @var \WP_Embed $wp_embed */
366 366
 		global $wp_embed;
367 367
 		$wp_embed->post_ID = $_POST["ID"];
368
-		$out =$wp_embed->run_shortcode( $code_wrapped );
368
+		$out = $wp_embed->run_shortcode($code_wrapped);
369 369
 		
370 370
 		echo $out;
371 371
 		exit;
@@ -375,53 +375,53 @@  discard block
 block discarded – undo
375 375
 	{
376 376
 		
377 377
 		
378
-		$code= $_POST["code"];
378
+		$code = $_POST["code"];
379 379
 		$atts = array(
380 380
 		 );
381 381
 		foreach ($_POST as $key => $value) {
382
-			if ($key !="code" && $key !="action") {
382
+			if ($key != "code" && $key != "action") {
383 383
 			    //$shortcode = $shortcode.$key.'="'.$value.'" ';
384 384
 				$atts[$key] = $value;
385 385
 			}
386 386
 		}
387 387
 		if ($code == "aesop_video") {
388
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
388
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
389 389
 		    echo aesop_video_shortcode($atts);
390 390
 		}
391 391
 		else if ($code == "aesop_image") {
392
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
392
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
393 393
 		    echo aesop_image_shortcode($atts);
394 394
 		}
395 395
 		else if ($code == "aesop_quote") {
396
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
396
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
397 397
 		    echo aesop_quote_shortcode($atts);
398 398
 		}
399 399
 		else if ($code == "aesop_parallax") {
400
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
400
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
401 401
 		    echo aesop_parallax_shortcode($atts);
402 402
 		}
403 403
 		else if ($code == "aesop_character") {
404
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
404
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
405 405
 		    echo aesop_character_shortcode($atts);
406 406
 		}
407 407
 		else if ($code == "aesop_collection") {
408
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
408
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
409 409
 		    echo aesop_collection_shortcode($atts);
410 410
 		}
411 411
 		else if ($code == "aesop_chapter") {
412
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
412
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
413 413
 		    echo aesop_chapter_shortcode($atts);
414 414
 		}
415 415
 		else if ($code == "aesop_content") {
416
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
416
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
417 417
 		    echo aesop_content_shortcode($atts, $atts['content_data']);
418 418
 		}
419 419
 		else if ($code == "aesop_gallery") {
420
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
421
-		    echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
420
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
421
+		    echo do_shortcode('[aesop_gallery id="'.$atts["id"].'"]');
422 422
 		}
423 423
 		else if ($code == "aesop_audio") {
424
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
424
+		    require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
425 425
 		    echo aesop_audio_shortcode($atts);
426 426
 		}
427 427
 		else {
@@ -437,17 +437,17 @@  discard block
 block discarded – undo
437 437
 		
438 438
 		exit; 
439 439
 	}
440
-	public function set_post_terms( $postid, $value, $taxonomy ) {
441
-		if( $value ) {
442
-			$value = explode( ',', $value );
443
-			$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
440
+	public function set_post_terms($postid, $value, $taxonomy) {
441
+		if ($value) {
442
+			$value = explode(',', $value);
443
+			$allow_new_category = lasso_editor_get_option('allow_new_category', 'lasso_editor');
444 444
 			
445
-			if ($taxonomy =='category') {
445
+			if ($taxonomy == 'category') {
446 446
                 // convert from names to category ids
447 447
 				$cats = array();
448 448
 				foreach ($value as $cat) {
449 449
 					$cat_id = get_cat_ID($cat);
450
-					if ($cat_id !=0) {
450
+					if ($cat_id != 0) {
451 451
 						$cats [] = $cat_id;
452 452
 					} else if ($allow_new_category) {
453 453
 					    $cats [] = wp_create_category($cat);
@@ -456,27 +456,27 @@  discard block
 block discarded – undo
456 456
 				$value = $cats;
457 457
 			}
458 458
 	
459
-			$result = wp_set_object_terms( $postid, $value, $taxonomy );
459
+			$result = wp_set_object_terms($postid, $value, $taxonomy);
460 460
 		}
461
-		else  {
461
+		else {
462 462
 			//remove all terms from post
463
-			$result = wp_set_object_terms( $postid, null, $taxonomy );
463
+			$result = wp_set_object_terms($postid, null, $taxonomy);
464 464
 		}
465 465
 
466
-		if ( ! is_wp_error( $result ) ) {
466
+		if (!is_wp_error($result)) {
467 467
 			return true;
468
-		}else{
468
+		} else {
469 469
 			return false;
470 470
 		}
471 471
 	}
472 472
 	
473
-	public function set_date( $postid, $value) {
474
-		if( $value ) {
473
+	public function set_date($postid, $value) {
474
+		if ($value) {
475 475
             wp_update_post(
476
-				array (
476
+				array(
477 477
 					'ID'            => $postid, // ID of the post to update
478
-					'post_date'     => date( 'Y-m-d H:i:s',  strtotime($value) ),
479
-					'post_date_gmt'     => gmdate( 'Y-m-d H:i:s',  strtotime($value) ),
478
+					'post_date'     => date('Y-m-d H:i:s', strtotime($value)),
479
+					'post_date_gmt'     => gmdate('Y-m-d H:i:s', strtotime($value)),
480 480
 				)
481 481
 			);
482 482
 		}
Please login to merge, or discard this patch.
public/includes/editor-modules.php 3 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 	$toolbar_class  = $toolbar_headings ? 'toolbar-extended' : false;
152 152
 	
153 153
 	// mobile styles
154
-    $mobile_class = $is_mobile ? 'lasso-mobile' : false;
154
+	$mobile_class = $is_mobile ? 'lasso-mobile' : false;
155 155
 	$mobile_style =$is_mobile ? 'style="bottom:0px;"' : null;
156 156
 	
157 157
 	//show color
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 						</div>
436 436
 						<?php 
437 437
 						if ($allow_change_date) { 
438
-						    $dateformat = get_option( 'date_format' ); 
438
+							$dateformat = get_option( 'date_format' ); 
439 439
 						?>
440 440
 						    <label><?php _e( 'Post Date', 'lasso' ); ?></label>
441 441
 							<input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/>
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
 					<?php
548 548
 						if ( !empty( $types ) ) {
549 549
 							// get the first element
550
-						    $type = reset($types);							
550
+							$type = reset($types);							
551 551
 							$type = preg_replace( '/s\b/','', $type );
552 552
 							printf( '<input type="hidden" name="object" value="%s">', lcfirst( esc_attr( $type ) ) );		
553 553
 						}
@@ -575,8 +575,8 @@  discard block
 block discarded – undo
575 575
 	global $post;
576 576
 	
577 577
 	global $wp_post_types;
578
-    $labels = &$wp_post_types['post']->labels;
579
-    $labels->name = 'Articles';
578
+	$labels = &$wp_post_types['post']->labels;
579
+	$labels->name = 'Articles';
580 580
 
581 581
 	ob_start();
582 582
 
@@ -824,9 +824,9 @@  discard block
 block discarded – undo
824 824
 		$return .= '</form>';
825 825
 
826 826
 		// extra JS codes
827
-        if (isset($shortcode['codes'])) {
828
-		    $return .= $shortcode['codes'];
829
-        }
827
+		if (isset($shortcode['codes'])) {
828
+			$return .= $shortcode['codes'];
829
+		}
830 830
 		$blob[$slug] = $return;
831 831
 	}
832 832
 
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -188,8 +188,11 @@  discard block
 block discarded – undo
188 188
 						<?php if ( class_exists ('Aesop_Events') ) { ?>
189 189
 						     <li data-type="events" title="<?php esc_attr_e( 'Event', 'lasso' );?>"  class="lasso-toolbar--component__event"></li>
190 190
 						<?php }?>
191
-					<?php else: ?>
192
-						<li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li>
191
+					<?php else {
192
+	: ?>
193
+						<li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );
194
+}
195
+?>" class="image lasso-toolbar--component__image"></li>
193 196
 						<li data-type="wpquote" title="<?php esc_attr_e( 'WordPress Quote', 'lasso' );?>" class="quote lasso-toolbar--component__quote"></li>
194 197
 						<!--li data-type="wpvideo" title="<?php esc_attr_e( 'WordPress Video', 'lasso' );?>" class="video lasso-toolbar--component__video"></li-->
195 198
 					<?php endif; ?>
@@ -712,8 +715,9 @@  discard block
 block discarded – undo
712 715
 
713 716
 	$blob = array();
714 717
 
715
-	if ( empty( $codes ) )
716
-		return;
718
+	if ( empty( $codes ) ) {
719
+			return;
720
+	}
717 721
 
718 722
 	foreach ( $codes as $slug => $shortcode ) {
719 723
 		$return = '';
Please login to merge, or discard this patch.
Spacing   +226 added lines, -226 removed lines patch added patch discarded remove patch
@@ -11,32 +11,32 @@  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() );
21
+		$status = get_post_status(get_the_ID());
22 22
 
23 23
 		// let users add custom css classes
24
-		$custom_classes = apply_filters( 'lasso_control_classes', '' );
24
+		$custom_classes = apply_filters('lasso_control_classes', '');
25 25
 
26 26
 		$post_access_class   = '';
27
-		$post_new_disabled   = lasso_editor_get_option( 'post_adding_disabled', 'lasso_editor' );
28
-		$post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' );
29
-		$shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' );
27
+		$post_new_disabled   = lasso_editor_get_option('post_adding_disabled', 'lasso_editor');
28
+		$post_settings_disabled = lasso_editor_get_option('post_settings_disabled', 'lasso_editor');
29
+		$shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor');
30 30
 
31 31
 
32 32
 		// CSS class if adding new post objects is disabled
33
-		if ( 'on' == $post_new_disabled ) { $post_access_class = 'lasso--post-new-disabled'; }
33
+		if ('on' == $post_new_disabled) { $post_access_class = 'lasso--post-new-disabled'; }
34 34
 
35 35
 		// CSS class if adjust settings is disabled
36
-		if ( 'on' == $post_settings_disabled ) { $post_access_class = 'lasso--post-settings-disabled'; }
36
+		if ('on' == $post_settings_disabled) { $post_access_class = 'lasso--post-settings-disabled'; }
37 37
 
38 38
 		// CSS class if adding new post objects AND settings are disabled
39
-		if ( 'on' == $post_new_disabled && 'on' == $post_settings_disabled ) { $post_access_class = 'lasso--post-all-disabled'; }
39
+		if ('on' == $post_new_disabled && 'on' == $post_settings_disabled) { $post_access_class = 'lasso--post-all-disabled'; }
40 40
 
41 41
 		// CSS class if shortcodify or (Aesop Shortcode Conversion) is disabled
42 42
 		$sc_saving_class = 'on' == $shortcodify_disabled ? 'shortcodify-disabled' : 'shortcodify-enabled';
@@ -48,44 +48,44 @@  discard block
 block discarded – undo
48 48
 		$mobile_style = $is_mobile ? 'style="bottom:0px;"' : null;
49 49
 		
50 50
 
51
-		?><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();?>" >
51
+		?><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(); ?>" >
52 52
 
53
-			<ul class="lasso--controls__center lasso-editor-controls lasso-editor-controls--wrap <?php echo $post_access_class;?> "  <?php echo $mobile_style ?> >
53
+			<ul class="lasso--controls__center lasso-editor-controls lasso-editor-controls--wrap <?php echo $post_access_class; ?> "  <?php echo $mobile_style ?> >
54 54
 
55
-				<?php do_action( 'lasso_editor_controls_before' );
55
+				<?php do_action('lasso_editor_controls_before');
56 56
 
57
-				if ( $is_capable ) { ?>
57
+				if ($is_capable) { ?>
58 58
 
59
-					<li id="lasso--edit" title="<?php esc_attr_e( 'Edit Post', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
59
+					<li id="lasso--edit" title="<?php esc_attr_e('Edit Post', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
60 60
 
61
-					<?php if ( 'off' == $post_settings_disabled || empty( $post_settings_disabled ) ) { ?>
62
-						<li id="lasso--post-settings" title="<?php esc_attr_e( 'Post Settings', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
61
+					<?php if ('off' == $post_settings_disabled || empty($post_settings_disabled)) { ?>
62
+						<li id="lasso--post-settings" title="<?php esc_attr_e('Post Settings', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
63 63
 					<?php }
64 64
 
65 65
 				} ?>
66 66
 
67
-				<li id="lasso--post-all" title="<?php esc_attr_e( 'All Posts', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
67
+				<li id="lasso--post-all" title="<?php esc_attr_e('All Posts', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
68 68
 
69
-				<?php if ( $is_capable && wp_revisions_enabled( $post ) ) { ?>
70
-					<li id="lasso--post-revisions" title="<?php esc_attr_e( 'Revisions', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
69
+				<?php if ($is_capable && wp_revisions_enabled($post)) { ?>
70
+					<li id="lasso--post-revisions" title="<?php esc_attr_e('Revisions', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
71 71
 				<?php } ?>
72 72
 
73
-				<?php if ( ( 'off' == $post_new_disabled || empty( $post_new_disabled ) && lasso_user_can('publish_posts') ) ) { ?>
74
-					<li id="lasso--post-new" title="<?php esc_attr_e( 'Add Post', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
73
+				<?php if (('off' == $post_new_disabled || empty($post_new_disabled) && lasso_user_can('publish_posts'))) { ?>
74
+					<li id="lasso--post-new" title="<?php esc_attr_e('Add Post', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
75 75
 				<?php } ?>
76 76
 
77
-				<?php do_action( 'lasso_editor_controls_after' );?>
77
+				<?php do_action('lasso_editor_controls_after'); ?>
78 78
 
79 79
 			</ul>
80 80
 
81
-			<?php if ( is_singular() && !$is_mobile ) { ?>
81
+			<?php if (is_singular() && !$is_mobile) { ?>
82 82
 
83
-				<div class="lasso--controls__right" data-posttype="<?php echo get_post_type( get_the_ID() );?>" data-status="<?php echo $status;?>">
83
+				<div class="lasso--controls__right" data-posttype="<?php echo get_post_type(get_the_ID()); ?>" data-status="<?php echo $status; ?>">
84 84
 
85
-					<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>
85
+					<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>
86 86
 
87
-					<?php if ( 'draft' == $status && ( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') )  ) { ?>
88
-						<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>
87
+					<?php if ('draft' == $status && (lasso_user_can('publish_posts') || lasso_user_can('publish_pages'))) { ?>
88
+						<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>
89 89
 					<?php } ?>
90 90
 
91 91
 				</div>
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
 
111 111
 
112 112
 	// let users add custom css classes
113
-	$custom_classes = apply_filters( 'lasso_sidebar_classes', '' );
113
+	$custom_classes = apply_filters('lasso_sidebar_classes', '');
114 114
 	?>
115
-	<div id="lasso--sidebar" class="<?php echo sanitize_html_class( $custom_classes );?>" >
115
+	<div id="lasso--sidebar" class="<?php echo sanitize_html_class($custom_classes); ?>" >
116 116
 		<div class="lasso--sidebar__inner">
117 117
 			<div id="lasso--component__settings"></div>
118 118
 		</div>
@@ -134,20 +134,20 @@  discard block
 block discarded – undo
134 134
 	$is_mobile = wp_is_mobile();
135 135
 
136 136
 	// check for lasso story engine and add a class doniting this
137
-	$ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active';
137
+	$ase_status = class_exists('Aesop_Core') || defined('LASSO_CUSTOM') ? 'ase-active' : 'ase-not-active';
138 138
 
139 139
 	// let users add custom css classes
140
-	$custom_classes = apply_filters( 'lasso_toolbar_classes', '' );
140
+	$custom_classes = apply_filters('lasso_toolbar_classes', '');
141 141
 
142 142
 	// are toolbar headings enabled
143
-	$toolbar_headings      = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' );
144
-	$toolbar_headings_h4      = lasso_editor_get_option( 'toolbar_headings_h4', 'lasso_editor' );
143
+	$toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor');
144
+	$toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
145 145
 
146
-	$toolbar_class  = $toolbar_headings ? 'toolbar-extended' : false;
146
+	$toolbar_class = $toolbar_headings ? 'toolbar-extended' : false;
147 147
 	
148 148
 	// mobile styles
149 149
     $mobile_class = $is_mobile ? 'lasso-mobile' : false;
150
-	$mobile_style =$is_mobile ? 'style="bottom:0px;"' : null;
150
+	$mobile_style = $is_mobile ? 'style="bottom:0px;"' : null;
151 151
 	
152 152
 	//show color
153 153
 	$show_color = lasso_editor_get_option('toolbar_show_color', 'lasso_editor');
@@ -155,109 +155,109 @@  discard block
 block discarded – undo
155 155
 	//show alignment
156 156
 	$show_align = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor');
157 157
 	
158
-	$status = get_post_status( get_the_ID() );
158
+	$status = get_post_status(get_the_ID());
159 159
 
160 160
 
161 161
 	?>
162
-	<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 ?>>
163
-		<ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"';}?>>
164
-			<?php do_action( 'lasso_toolbar_components_before' );?>
165
-		    <li id="lasso-toolbar--bold" title="<?php esc_attr_e( 'Bold', 'lasso' );?>"></li>
166
-		    <li id="lasso-toolbar--underline" title="<?php esc_attr_e( 'Underline', 'lasso' );?>"></li>
167
-		    <li id="lasso-toolbar--italic" title="<?php esc_attr_e( 'Italicize', 'lasso' );?>"></li>
168
-		    <li id="lasso-toolbar--strike" title="<?php esc_attr_e( 'Strikethrough', 'lasso' );?>"></li>
169
-			<li id="lasso-toolbar--components" title="<?php esc_attr_e( 'Insert Component', 'lasso' );?>" style="color:#ffffa0;">
162
+	<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 ?>>
163
+		<ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"'; }?>>
164
+			<?php do_action('lasso_toolbar_components_before'); ?>
165
+		    <li id="lasso-toolbar--bold" title="<?php esc_attr_e('Bold', 'lasso'); ?>"></li>
166
+		    <li id="lasso-toolbar--underline" title="<?php esc_attr_e('Underline', 'lasso'); ?>"></li>
167
+		    <li id="lasso-toolbar--italic" title="<?php esc_attr_e('Italicize', 'lasso'); ?>"></li>
168
+		    <li id="lasso-toolbar--strike" title="<?php esc_attr_e('Strikethrough', 'lasso'); ?>"></li>
169
+			<li id="lasso-toolbar--components" title="<?php esc_attr_e('Insert Component', 'lasso'); ?>" style="color:#ffffa0;">
170 170
 			    <ul id="lasso-toolbar--components__list" style="display:none;color:white;">
171
-			    	<?php if ( 'ase-active' == $ase_status ): ?>
172
-						<li data-type="image" title="<?php esc_attr_e( 'Image', 'lasso' );?>" class="lasso-toolbar--component__image"></li>
173
-						<li data-type="character" title="<?php esc_attr_e( 'Character', 'lasso' );?>" class="lasso-toolbar--component__character"></li>
174
-						<li data-type="quote" title="<?php esc_attr_e( 'Quote', 'lasso' );?>"  class="lasso-toolbar--component__quote"></li>
175
-						<li data-type="content" title="<?php esc_attr_e( 'Content', 'lasso' );?>"  class="lasso-toolbar--component__content"></li>
176
-						<li data-type="chapter" title="<?php esc_attr_e( 'Chapter', 'lasso' );?>"  class="lasso-toolbar--component__chapter"></li>
177
-						<li data-type="parallax" title="<?php esc_attr_e( 'Parallax', 'lasso' );?>"  class="lasso-toolbar--component__parallax"></li>
178
-						<li data-type="audio" title="<?php esc_attr_e( 'Audio', 'lasso' );?>"  class="lasso-toolbar--component__audio"></li>
179
-						<li data-type="video" title="<?php esc_attr_e( 'Video', 'lasso' );?>"  class="lasso-toolbar--component__video"></li>
180
-						<li data-type="map" title="<?php esc_attr_e( 'Map', 'lasso' );?>"  class="lasso-toolbar--component__map"></li>
181
-						<li data-type="timeline_stop" title="<?php esc_attr_e( 'Timeline', 'lasso' );?>"  class="lasso-toolbar--component__timeline"></li>
182
-						<li data-type="document" title="<?php esc_attr_e( 'Document', 'lasso' );?>"  class="lasso-toolbar--component__document"></li>
183
-						<li data-type="collection" title="<?php esc_attr_e( 'Collection', 'lasso' );?>"  class="lasso-toolbar--component__collection"></li>
184
-						<li data-type="gallery" title="<?php esc_attr_e( 'Gallery', 'lasso' );?>"  class="lasso-toolbar--component__gallery"></li>
185
-						<?php if ( class_exists ('Aesop_GalleryPop') ) { ?>
186
-						     <li data-type="gallery" title="<?php esc_attr_e( 'Gallery Pop', 'lasso' );?>"  class="lasso-toolbar--component__gallerypop"></li>
171
+			    	<?php if ('ase-active' == $ase_status): ?>
172
+						<li data-type="image" title="<?php esc_attr_e('Image', 'lasso'); ?>" class="lasso-toolbar--component__image"></li>
173
+						<li data-type="character" title="<?php esc_attr_e('Character', 'lasso'); ?>" class="lasso-toolbar--component__character"></li>
174
+						<li data-type="quote" title="<?php esc_attr_e('Quote', 'lasso'); ?>"  class="lasso-toolbar--component__quote"></li>
175
+						<li data-type="content" title="<?php esc_attr_e('Content', 'lasso'); ?>"  class="lasso-toolbar--component__content"></li>
176
+						<li data-type="chapter" title="<?php esc_attr_e('Chapter', 'lasso'); ?>"  class="lasso-toolbar--component__chapter"></li>
177
+						<li data-type="parallax" title="<?php esc_attr_e('Parallax', 'lasso'); ?>"  class="lasso-toolbar--component__parallax"></li>
178
+						<li data-type="audio" title="<?php esc_attr_e('Audio', 'lasso'); ?>"  class="lasso-toolbar--component__audio"></li>
179
+						<li data-type="video" title="<?php esc_attr_e('Video', 'lasso'); ?>"  class="lasso-toolbar--component__video"></li>
180
+						<li data-type="map" title="<?php esc_attr_e('Map', 'lasso'); ?>"  class="lasso-toolbar--component__map"></li>
181
+						<li data-type="timeline_stop" title="<?php esc_attr_e('Timeline', 'lasso'); ?>"  class="lasso-toolbar--component__timeline"></li>
182
+						<li data-type="document" title="<?php esc_attr_e('Document', 'lasso'); ?>"  class="lasso-toolbar--component__document"></li>
183
+						<li data-type="collection" title="<?php esc_attr_e('Collection', 'lasso'); ?>"  class="lasso-toolbar--component__collection"></li>
184
+						<li data-type="gallery" title="<?php esc_attr_e('Gallery', 'lasso'); ?>"  class="lasso-toolbar--component__gallery"></li>
185
+						<?php if (class_exists('Aesop_GalleryPop')) { ?>
186
+						     <li data-type="gallery" title="<?php esc_attr_e('Gallery Pop', 'lasso'); ?>"  class="lasso-toolbar--component__gallerypop"></li>
187 187
 						<?php }?>
188
-						<?php if ( class_exists ('Aesop_Events') ) { ?>
189
-						     <li data-type="events" title="<?php esc_attr_e( 'Event', 'lasso' );?>"  class="lasso-toolbar--component__event"></li>
188
+						<?php if (class_exists('Aesop_Events')) { ?>
189
+						     <li data-type="events" title="<?php esc_attr_e('Event', 'lasso'); ?>"  class="lasso-toolbar--component__event"></li>
190 190
 						<?php }?>
191 191
 					<?php else: ?>
192
-						<li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li>
193
-						<li data-type="wpquote" title="<?php esc_attr_e( 'WordPress Quote', 'lasso' );?>" class="quote lasso-toolbar--component__quote"></li>
194
-						<!--li data-type="wpvideo" title="<?php esc_attr_e( 'WordPress Video', 'lasso' );?>" class="video lasso-toolbar--component__video"></li-->
192
+						<li data-type="wpimg" title="<?php esc_attr_e('WordPress Image', 'lasso'); ?>" class="image lasso-toolbar--component__image"></li>
193
+						<li data-type="wpquote" title="<?php esc_attr_e('WordPress Quote', 'lasso'); ?>" class="quote lasso-toolbar--component__quote"></li>
194
+						<!--li data-type="wpvideo" title="<?php esc_attr_e('WordPress Video', 'lasso'); ?>" class="video lasso-toolbar--component__video"></li-->
195 195
 					<?php endif; ?>
196
-					<?php do_action( 'lasso_toolbar_components' );?>
196
+					<?php do_action('lasso_toolbar_components'); ?>
197 197
 			    </ul>
198 198
 			</li>
199
-		    <?php if ( $toolbar_headings ): ?>
200
-		    <li id="lasso-toolbar--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"></li>
201
-		    <li id="lasso-toolbar--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"></li>
199
+		    <?php if ($toolbar_headings): ?>
200
+		    <li id="lasso-toolbar--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"></li>
201
+		    <li id="lasso-toolbar--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"></li>
202 202
 			<?php endif; ?>
203
-			<?php if ( $toolbar_headings_h4 ): ?>
204
-		    <li id="lasso-toolbar--h4" title="<?php esc_attr_e( 'H4 Heading', 'lasso' );?>"></li>
205
-		    <li id="lasso-toolbar--h5" title="<?php esc_attr_e( 'H5 Heading', 'lasso' );?>"></li>
206
-			<li id="lasso-toolbar--h6" title="<?php esc_attr_e( 'H6 Heading', 'lasso' );?>"></li>
203
+			<?php if ($toolbar_headings_h4): ?>
204
+		    <li id="lasso-toolbar--h4" title="<?php esc_attr_e('H4 Heading', 'lasso'); ?>"></li>
205
+		    <li id="lasso-toolbar--h5" title="<?php esc_attr_e('H5 Heading', 'lasso'); ?>"></li>
206
+			<li id="lasso-toolbar--h6" title="<?php esc_attr_e('H6 Heading', 'lasso'); ?>"></li>
207 207
 			<?php endif; ?>
208 208
 			
209
-			<?php if ( $show_color ): ?>
210
-		    <li id="lasso-toolbar--color-set" title="<?php esc_attr_e( 'Set Color for Selected Text', 'lasso' );?>"></li>
211
-		    <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e( 'Choose Color', 'lasso' );?>"></li>
209
+			<?php if ($show_color): ?>
210
+		    <li id="lasso-toolbar--color-set" title="<?php esc_attr_e('Set Color for Selected Text', 'lasso'); ?>"></li>
211
+		    <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e('Choose Color', 'lasso'); ?>"></li>
212 212
 			<?php endif; ?>
213 213
 					
214 214
 		    
215
-			<li id="lasso-toolbar--link" title="<?php esc_attr_e( 'Anchor Link', 'lasso' );?>">
215
+			<li id="lasso-toolbar--link" title="<?php esc_attr_e('Anchor Link', 'lasso'); ?>">
216 216
 		    	<div id="lasso-toolbar--link__wrap" <?php echo $mobile_style ?> >
217
-		    		<div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'http://url.com', 'lasso' );?>"></div>
218
-		    		<a href="#" title="<?php esc_attr_e( 'Create Link', 'lasso' );?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a>
217
+		    		<div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e('http://url.com', 'lasso'); ?>"></div>
218
+		    		<a href="#" title="<?php esc_attr_e('Create Link', 'lasso'); ?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a>
219 219
 					<input class="styled-checkbox" type="checkbox" id="aesop-toolbar--link_newtab" checked/>
220
-                    <label for="aesop-toolbar--link_newtab"><?php esc_attr_e( 'Open in a New Tab', 'lasso' );?></label>
220
+                    <label for="aesop-toolbar--link_newtab"><?php esc_attr_e('Open in a New Tab', 'lasso'); ?></label>
221 221
 		    	</div>
222 222
 		    </li>
223
-		    <?php do_action( 'lasso_toolbar_components_after' );?>
224
-		    <li id="lasso-toolbar--html" title="<?php esc_attr_e( 'Insert HTML or Code', 'lasso' );?>">
223
+		    <?php do_action('lasso_toolbar_components_after'); ?>
224
+		    <li id="lasso-toolbar--html" title="<?php esc_attr_e('Insert HTML or Code', 'lasso'); ?>">
225 225
 		    	<div id="lasso-toolbar--html__wrap" <?php echo $mobile_style ?>>
226
-		    		<div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?>"></div>
226
+		    		<div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e('Enter HTML to insert', 'lasso'); ?>"></div>
227 227
 		    		<div id="lasso-toolbar--html__footer">
228 228
 					<div id="lasso-toolbar--html__footer_desc" >
229
-					<?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?><br>
230
-					<?php esc_attr_e( 'You can also use Shortcodes', 'lasso' );?><br>
231
-					<?php esc_attr_e( 'You can also enter a URL to embed, such as Youtube, Vimeo and Twitter URLs.', 'lasso' );?>
229
+					<?php esc_attr_e('Enter HTML to insert', 'lasso'); ?><br>
230
+					<?php esc_attr_e('You can also use Shortcodes', 'lasso'); ?><br>
231
+					<?php esc_attr_e('You can also enter a URL to embed, such as Youtube, Vimeo and Twitter URLs.', 'lasso'); ?>
232 232
 					</div>
233 233
 		    			<ul class="lasso-toolbar--html-snips">
234 234
 						
235
-		    				<?php if ( !$toolbar_headings ): ?>
236
-		    				<li id="lasso-html--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>">
237
-		    				<li id="lasso-html--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>">
235
+		    				<?php if (!$toolbar_headings): ?>
236
+		    				<li id="lasso-html--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>">
237
+		    				<li id="lasso-html--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>">
238 238
 		    				<?php endif; ?>
239
-		    				<li id="lasso-html--ul" title="<?php esc_attr_e( 'Unordered List', 'lasso' );?>">
240
-		    				<li id="lasso-html--ol" title="<?php esc_attr_e( 'Ordered List', 'lasso' );?>">
239
+		    				<li id="lasso-html--ul" title="<?php esc_attr_e('Unordered List', 'lasso'); ?>">
240
+		    				<li id="lasso-html--ol" title="<?php esc_attr_e('Ordered List', 'lasso'); ?>">
241 241
 		    			</ul>
242
-		    			<a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e( 'Cancel', 'lasso' );?></a>
243
-		    			<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>
242
+		    			<a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e('Cancel', 'lasso'); ?></a>
243
+		    			<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>
244 244
 		    		</div>
245 245
 		    	</div>
246 246
 		    </li>
247
-			<?php if ( $show_align ): ?>
248
-		    <li id="lasso-toolbar--left-align" title="<?php esc_attr_e( 'Text Left Align', 'lasso' );?>"></li>
249
-		    <li id="lasso-toolbar--center-align" title="<?php esc_attr_e( 'Text Center Align', 'lasso' );?>"></li>
250
-			<li id="lasso-toolbar--right-align" title="<?php esc_attr_e( 'Text Right Align', 'lasso' );?>"></li>
247
+			<?php if ($show_align): ?>
248
+		    <li id="lasso-toolbar--left-align" title="<?php esc_attr_e('Text Left Align', 'lasso'); ?>"></li>
249
+		    <li id="lasso-toolbar--center-align" title="<?php esc_attr_e('Text Center Align', 'lasso'); ?>"></li>
250
+			<li id="lasso-toolbar--right-align" title="<?php esc_attr_e('Text Right Align', 'lasso'); ?>"></li>
251 251
 			<?php endif; ?>
252 252
 		</ul>
253
-		<?php if ( is_singular() && $is_mobile ) { ?>
253
+		<?php if (is_singular() && $is_mobile) { ?>
254 254
 
255
-				<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;">
255
+				<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;">
256 256
 
257
-					<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>
257
+					<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>
258 258
 
259
-					<?php if ( 'draft' == $status && ( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') )  ) { ?>
260
-						<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>
259
+					<?php if ('draft' == $status && (lasso_user_can('publish_posts') || lasso_user_can('publish_pages'))) { ?>
260
+						<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>
261 261
 					<?php } ?>
262 262
 
263 263
 				</div>
@@ -275,20 +275,20 @@  discard block
 block discarded – undo
275 275
  */
276 276
 function lasso_editor_settings_toolbar() {
277 277
 
278
-	$delete_nonce = wp_create_nonce( 'lasso-delete-nonce' );
278
+	$delete_nonce = wp_create_nonce('lasso-delete-nonce');
279 279
 
280 280
 	ob_start();
281 281
 
282 282
 
283 283
 	// let users add custom css classes
284
-	$custom_classes = apply_filters( 'lasso_component_classes', '' );
284
+	$custom_classes = apply_filters('lasso_component_classes', '');
285 285
 
286 286
 	?>
287
-	<ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false">
288
-		<li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li>
289
-		<li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li>
290
-		<li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li>
291
-		<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>
287
+	<ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false">
288
+		<li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li>
289
+		<li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li>
290
+		<li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li>
291
+		<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>
292 292
 	</ul>
293 293
 
294 294
 	<?php return ob_get_clean();
@@ -306,13 +306,13 @@  discard block
 block discarded – undo
306 306
 
307 307
 
308 308
 	// has post thumbnail
309
-	$has_thumbnail = has_post_thumbnail( get_the_ID() ) ? 'class="lasso--featImg--has-thumb"' : false;
309
+	$has_thumbnail = has_post_thumbnail(get_the_ID()) ? 'class="lasso--featImg--has-thumb"' : false;
310 310
 
311 311
 	?>
312
-	<ul id="lasso--featImgControls" <?php echo $has_thumbnail;?>>
313
-		<li id="lasso--featImgUpload"><a title="<?php esc_attr_e( 'Replace Image', 'lasso' );?>" href="#"><i class="lasso-icon-image"></i></a></li>
314
-		<li id="lasso--featImgDelete"><a title="<?php esc_attr_e( 'Delete Image', 'lasso' );?>" href="#"><i class="lasso-icon-bin2"></i></a></li>
315
-		<li id="lasso--featImgSave"><a href="#"><?php esc_attr_e( 'save', 'lasso' );?></a></li>
312
+	<ul id="lasso--featImgControls" <?php echo $has_thumbnail; ?>>
313
+		<li id="lasso--featImgUpload"><a title="<?php esc_attr_e('Replace Image', 'lasso'); ?>" href="#"><i class="lasso-icon-image"></i></a></li>
314
+		<li id="lasso--featImgDelete"><a title="<?php esc_attr_e('Delete Image', 'lasso'); ?>" href="#"><i class="lasso-icon-bin2"></i></a></li>
315
+		<li id="lasso--featImgSave"><a href="#"><?php esc_attr_e('save', 'lasso'); ?></a></li>
316 316
 	</ul>
317 317
 
318 318
 	<?php return ob_get_clean();
@@ -336,51 +336,51 @@  discard block
 block discarded – undo
336 336
 
337 337
 	$postid = get_the_ID();
338 338
 
339
-	$status = get_post_status( $postid );
340
-	$nonce = wp_create_nonce( 'lasso-update-post-settings' );
339
+	$status = get_post_status($postid);
340
+	$nonce = wp_create_nonce('lasso-update-post-settings');
341 341
 
342 342
 	// let users add custom css classes
343
-	$custom_classes = apply_filters( 'lasso_modal_settings_classes', '' );
343
+	$custom_classes = apply_filters('lasso_modal_settings_classes', '');
344 344
 
345 345
 	// objects categories
346
-	$categories 		= lasso_get_post_objects( $postid, 'category' );
347
-	$tags 				= lasso_get_post_objects( $postid, 'tag' );
346
+	$categories = lasso_get_post_objects($postid, 'category');
347
+	$tags = lasso_get_post_objects($postid, 'tag');
348 348
 
349 349
 	// modal tabs
350
-	$tabs  				= lasso_modal_addons('tab');
351
-	$content 			= lasso_modal_addons('content');
350
+	$tabs = lasso_modal_addons('tab');
351
+	$content = lasso_modal_addons('content');
352 352
 	
353 353
 	//editor options
354 354
 	$allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor');
355 355
 
356 356
 	// are we singular
357
-	$is_singular 		= is_singular();
357
+	$is_singular = is_singular();
358 358
 	$is_singular_class 	= $is_singular ? 'lasso--postsettings__2col' : 'lasso--postsettings__1col';
359 359
 	$has_thumb_class    = has_post_thumbnail() ? 'has-thumbnail' : 'no-thumbnail';
360 360
 	$theme_supports     = current_theme_supports('post-thumbnails');
361
-	$default_image 		= LASSO_URL.'/admin/assets/img/empty-img.png';
361
+	$default_image = LASSO_URL.'/admin/assets/img/empty-img.png';
362 362
 
363 363
 ?>
364
-	<div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>">
364
+	<div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>">
365 365
 		<div class="lasso--modal__inner">
366 366
 
367
-			<?php if( $tabs ) { echo $tabs; } ?>
367
+			<?php if ($tabs) { echo $tabs; } ?>
368 368
 
369 369
 			<div class="lasso--modal__content modal__content--core visible" data-addon-content="core">
370
-				<form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class;?>" >
370
+				<form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class; ?>" >
371 371
 
372
-					<?php if ( $is_singular && $theme_supports ) : ?>
372
+					<?php if ($is_singular && $theme_supports) : ?>
373 373
 					<div class="lasso--postsettings__left">
374
-						<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>
375
-						<div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url( $default_image );?>">
374
+						<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>
375
+						<div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url($default_image); ?>">
376 376
 
377 377
 							<div id="lasso--post-thumb__controls" class="lasso--post-thumb__controls">
378
-								<i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image','lasso');?>" class="dashicons dashicons-edit"></i>
379
-								<i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image','lasso');?>" class="dashicons dashicons-no-alt"></i>
378
+								<i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image', 'lasso'); ?>" class="dashicons dashicons-edit"></i>
379
+								<i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image', 'lasso'); ?>" class="dashicons dashicons-no-alt"></i>
380 380
 								<i id="lasso--save-status" class="lasso-icon lasso-icon-spinner6 not-visible"></i>
381 381
 							</div>
382 382
 
383
-							<?php echo has_post_thumbnail() ? get_the_post_thumbnail( $post->ID, 'medium' ) : '<img src="'.$default_image.'">'; ?>
383
+							<?php echo has_post_thumbnail() ? get_the_post_thumbnail($post->ID, 'medium') : '<img src="'.$default_image.'">'; ?>
384 384
 
385 385
 						</div>
386 386
 						<div id="lasso--featImgSave"><a href="#" class="not-visible">Save</a></div>
@@ -390,12 +390,12 @@  discard block
 block discarded – undo
390 390
 
391 391
 					<div class="lasso--postsettings__right">
392 392
 
393
-						<?php if( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ): ?>
393
+						<?php if (lasso_user_can('publish_posts') || lasso_user_can('publish_pages')): ?>
394 394
 						<div class="lasso--postsettings__option story-status-option">
395
-							<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>
396
-							<ul class="story-status story-status-<?php echo sanitize_html_class( $status );?>">
397
-								<li id="lasso--status-draft"><?php _e( 'Draft', 'lasso' );?></li>
398
-								<li id="lasso--status-publish"><?php _e( 'Publish', 'lasso' );?></li>
395
+							<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>
396
+							<ul class="story-status story-status-<?php echo sanitize_html_class($status); ?>">
397
+								<li id="lasso--status-draft"><?php _e('Draft', 'lasso'); ?></li>
398
+								<li id="lasso--status-publish"><?php _e('Publish', 'lasso'); ?></li>
399 399
 							</ul>
400 400
 							<div class="lasso--slider_wrap">
401 401
 								<div id="lasso--slider"></div>
@@ -403,10 +403,10 @@  discard block
 block discarded – undo
403 403
 						</div>
404 404
 						<?php endif; ?>
405 405
 
406
-						<?php if ( 'publish' == $status ): ?>
406
+						<?php if ('publish' == $status): ?>
407 407
 						<div class="lasso--postsettings__option story-slug-option">
408
-							<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>
409
-							<input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset( $post ) ? esc_attr( $post->post_name ) : false;?>">
408
+							<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>
409
+							<input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset($post) ? esc_attr($post->post_name) : false; ?>">
410 410
 						</div>
411 411
 						<?php endif; ?>
412 412
 
@@ -415,20 +415,20 @@  discard block
 block discarded – undo
415 415
 					<div class="lasso--postsettings__middle">
416 416
 
417 417
 						<div class="lasso--postsettings__option story-categories-option">
418
-							<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>
419
-							<input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories;?>">
418
+							<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>
419
+							<input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories; ?>">
420 420
 						</div>
421 421
 
422 422
 						<div class="lasso--postsettings__option story-tags-option">
423
-							<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>
424
-							<input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags;?>">
423
+							<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>
424
+							<input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags; ?>">
425 425
 						</div>
426 426
 						<?php 
427 427
 						if ($allow_change_date) { 
428
-						    $dateformat = get_option( 'date_format' ); 
428
+						    $dateformat = get_option('date_format'); 
429 429
 						?>
430
-						    <label><?php _e( 'Post Date', 'lasso' ); ?></label>
431
-							<input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/>
430
+						    <label><?php _e('Post Date', 'lasso'); ?></label>
431
+							<input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid); ?>"/>
432 432
 						<?php
433 433
 						}?>
434 434
 
@@ -450,23 +450,23 @@  discard block
 block discarded – undo
450 450
 					?>
451 451
 					<!--/div-->
452 452
 
453
-					<?php do_action( 'lasso_modal_post_form' ); // action ?>
453
+					<?php do_action('lasso_modal_post_form'); // action ?>
454 454
 
455 455
 					<div class="lasso--postsettings__footer" >
456
-						<a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a>
456
+						<a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a>
457 457
 						<input type="hidden" name="status" value="">
458 458
 						<input type="hidden" name="categories" value="">
459
-						<input type="hidden" name="postid" value="<?php echo get_the_ID();?>">
459
+						<input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>">
460 460
 						<input type="hidden" name="action" value="process_update-object_post">
461
-						<input type="hidden" name="nonce" value="<?php echo $nonce;?>">
462
-						<?php do_action( 'lasso_modal_post_form_footer' ); // action ?>
463
-						<input type="submit" id="lasso--postsettings-submit" value="<?php esc_attr_e( 'Save', 'lasso' );?>">
461
+						<input type="hidden" name="nonce" value="<?php echo $nonce; ?>">
462
+						<?php do_action('lasso_modal_post_form_footer'); // action ?>
463
+						<input type="submit" id="lasso--postsettings-submit" value="<?php esc_attr_e('Save', 'lasso'); ?>">
464 464
 					</div>
465 465
 
466 466
 				</form>
467 467
 			</div>
468 468
 
469
-			<?php if( $tabs ) { echo $content; } ?>
469
+			<?php if ($tabs) { echo $content; } ?>
470 470
 
471 471
 		</div>
472 472
 
@@ -488,38 +488,38 @@  discard block
 block discarded – undo
488 488
 	ob_start();
489 489
 
490 490
 
491
-	$status = get_post_status( get_the_ID() );
491
+	$status = get_post_status(get_the_ID());
492 492
 
493
-	$nonce = wp_create_nonce( 'lasso-editor-new-post' );
493
+	$nonce = wp_create_nonce('lasso-editor-new-post');
494 494
 
495 495
 	// let users add custom css classes
496
-	$custom_classes = apply_filters( 'lasso_modal_post_classes', '' );
496
+	$custom_classes = apply_filters('lasso_modal_post_classes', '');
497 497
 
498 498
 	// return the post type
499
-	$type = get_post_type( get_the_ID() );
499
+	$type = get_post_type(get_the_ID());
500 500
 
501 501
 	$mobile_style = "";
502 502
 	if (wp_is_mobile()) {
503 503
 		$mobile_style = 'style="top:140px !important;"';
504 504
 	}
505 505
 	?>
506
-	<div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style;?>">
506
+	<div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" <?php echo $mobile_style; ?>">
507 507
 		<div class="lasso--modal__inner lasso--hasnewform">
508 508
 
509 509
 			<form id="lasso--postnew__form" enctype="multipart/form-data" class="lasso--post-form">
510 510
 
511 511
 				<div class="lasso--postsettings__option story-slug-option lasso--last-option">
512
-					<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>
513
-					<input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e( 'Grump Wizards Make Toxic Brew', 'lasso' );?>">
512
+					<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>
513
+					<input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e('Grump Wizards Make Toxic Brew', 'lasso'); ?>">
514 514
 						<div class="lasso--select-wrap" style="width:90px">
515 515
 						<select id="lasso--select-type" name="story_type">
516 516
 
517 517
 							<?php
518 518
 								$types = lasso_post_types();
519
-								if ( !empty( $types ) ) {
520
-									foreach( $types as $type ) {					
521
-										$type = preg_replace( '/s\b/','', $type );
522
-										printf( '<option value="%s">%s</option>', lcfirst( esc_attr( $type ) ) , ucfirst( esc_attr( $type ) ) );
519
+								if (!empty($types)) {
520
+									foreach ($types as $type) {					
521
+										$type = preg_replace('/s\b/', '', $type);
522
+										printf('<option value="%s">%s</option>', lcfirst(esc_attr($type)), ucfirst(esc_attr($type)));
523 523
 									}
524 524
 
525 525
 								}
@@ -530,18 +530,18 @@  discard block
 block discarded – undo
530 530
 				</div>
531 531
 
532 532
 				<div class="lasso--postsettings__footer">
533
-					<a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a>
533
+					<a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a>
534 534
 					<input type="hidden" name="action" value="process_new-object_post">
535 535
 					<?php
536
-						if ( !empty( $types ) ) {
536
+						if (!empty($types)) {
537 537
 							// get the first element
538 538
 						    $type = reset($types);							
539
-							$type = preg_replace( '/s\b/','', $type );
540
-							printf( '<input type="hidden" name="object" value="%s">', lcfirst( esc_attr( $type ) ) );		
539
+							$type = preg_replace('/s\b/', '', $type);
540
+							printf('<input type="hidden" name="object" value="%s">', lcfirst(esc_attr($type)));		
541 541
 						}
542 542
 					?>
543
-					<input type="hidden" name="nonce" value="<?php echo $nonce;?>">
544
-					<input type="submit" value="<?php esc_attr_e( 'Create', 'lasso' );?>">
543
+					<input type="hidden" name="nonce" value="<?php echo $nonce; ?>">
544
+					<input type="submit" value="<?php esc_attr_e('Create', 'lasso'); ?>">
545 545
 				</div>
546 546
 
547 547
 			</form>
@@ -569,18 +569,18 @@  discard block
 block discarded – undo
569 569
 	ob_start();
570 570
 
571 571
 	// post status
572
-	$status = get_post_status( get_the_ID() );
572
+	$status = get_post_status(get_the_ID());
573 573
 
574 574
 	// let users add custom css classes
575
-	$custom_classes = apply_filters( 'lasso_modal_all_post_classes', '' );
575
+	$custom_classes = apply_filters('lasso_modal_all_post_classes', '');
576 576
 
577 577
 	?>
578
-	<div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" style="max-height:100%">
578
+	<div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" style="max-height:100%">
579 579
 		<div class="lasso--modal__inner">
580 580
 
581 581
 			<div class="lasso--post-filtering not-visible">
582 582
 				<div class="lasso--search__results">
583
-					<span id="lasso--results-found"></span><?php _e('results found','lasso');?>
583
+					<span id="lasso--results-found"></span><?php _e('results found', 'lasso'); ?>
584 584
 				</div>
585 585
 				<div class="lasso--search">
586 586
 					<i id="lasso--search__toggle" class="dashicons dashicons-search"></i>
@@ -594,18 +594,18 @@  discard block
 block discarded – undo
594 594
 				$post_types = lasso_post_types_names();
595 595
 				$rest_bases = lasso_post_types_rest_base();
596 596
 
597
-				if ( ! empty( $post_types ) ) {
597
+				if (!empty($post_types)) {
598 598
 					$first = 'active';
599
-					foreach( $post_types as $name => $label ) {
599
+					foreach ($post_types as $name => $label) {
600 600
 						if (array_key_exists($name, $rest_bases)) {
601
-							printf( '<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr( $first), esc_attr( $rest_bases[$name] ), esc_attr( $label ) );
601
+							printf('<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr($first), esc_attr($rest_bases[$name]), esc_attr($label));
602 602
 						}
603 603
 						$first = '';
604 604
 					}
605 605
 
606 606
 				}
607 607
 
608
-				do_action('lasso_modal_post_objects');?>
608
+				do_action('lasso_modal_post_objects'); ?>
609 609
 
610 610
 			</ul>
611 611
 			<div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div>
@@ -625,14 +625,14 @@  discard block
 block discarded – undo
625 625
 
626 626
 
627 627
 	// let users add custom css classes
628
-	$custom_classes = apply_filters( 'lasso_wpimg_classes', '' );
628
+	$custom_classes = apply_filters('lasso_wpimg_classes', '');
629 629
 
630 630
 	?>
631
-	<ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false">
632
-		<li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li>
633
-		<li id="lasso--wpimg-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li>
634
-		<li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li>
635
-		<li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li>
631
+	<ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false">
632
+		<li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li>
633
+		<li id="lasso--wpimg-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li>
634
+		<li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li>
635
+		<li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li>
636 636
 	</ul>
637 637
 
638 638
 	<?php return ob_get_clean();
@@ -644,14 +644,14 @@  discard block
 block discarded – undo
644 644
 
645 645
 
646 646
 	// let users add custom css classes
647
-	$custom_classes = apply_filters( 'lasso_wpimg_classes', '' );
647
+	$custom_classes = apply_filters('lasso_wpimg_classes', '');
648 648
 
649 649
 	?>
650
-	<ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false">
651
-		<li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li>
652
-		<li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li>
653
-		<li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li>
654
-		<li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li>
650
+	<ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false">
651
+		<li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li>
652
+		<li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li>
653
+		<li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li>
654
+		<li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li>
655 655
 	</ul>
656 656
 
657 657
 	<?php return ob_get_clean();
@@ -664,16 +664,16 @@  discard block
 block discarded – undo
664 664
  */
665 665
 function lasso_map_form_footer() {
666 666
 
667
-	$nonce = wp_create_nonce( 'lasso-process-map' );
667
+	$nonce = wp_create_nonce('lasso-process-map');
668 668
 
669 669
 	ob_start();
670 670
 
671 671
 	?>
672 672
 	<div class="lasso--map-form__footer">
673
-		<input type="hidden" name="postid" value="<?php echo get_the_ID();?>">
674
-		<input type="hidden" name="nonce" value="<?php echo $nonce;?>">
673
+		<input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>">
674
+		<input type="hidden" name="nonce" value="<?php echo $nonce; ?>">
675 675
 		<input type="hidden" name="action" value="process_map_save">
676
-		<input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e( 'Save Locations', 'lasso' );?>">
676
+		<input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e('Save Locations', 'lasso'); ?>">
677 677
 	</div>
678 678
 
679 679
 	<?php return ob_get_clean();
@@ -691,7 +691,7 @@  discard block
 block discarded – undo
691 691
 
692 692
 	?>
693 693
 	<div id="lasso--pagerefresh" class="visible">
694
-		<?php _e( 'Save this post and refesh the page to see these changes.', 'lasso' );?>
694
+		<?php _e('Save this post and refesh the page to see these changes.', 'lasso'); ?>
695 695
 	</div>
696 696
 
697 697
 	<?php return ob_get_clean();
@@ -705,43 +705,43 @@  discard block
 block discarded – undo
705 705
  */
706 706
 function lasso_editor_options_blob() {
707 707
 
708
-	$codes   = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : apply_filters( 'lasso_custom_options', '' );
709
-	$galleries  = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery';
708
+	$codes = function_exists('aesop_shortcodes') ? aesop_shortcodes() : apply_filters('lasso_custom_options', '');
709
+	$galleries = function_exists('lasso_editor_galleries_exist') && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery';
710 710
 
711
-	$nonce = wp_create_nonce( 'lasso_gallery' );
711
+	$nonce = wp_create_nonce('lasso_gallery');
712 712
 
713 713
 	$blob = array();
714 714
 
715
-	if ( empty( $codes ) )
715
+	if (empty($codes))
716 716
 		return;
717 717
 
718
-	foreach ( $codes as $slug => $shortcode ) {
718
+	foreach ($codes as $slug => $shortcode) {
719 719
 		$return = '';
720 720
 		// Shortcode has atts
721 721
 
722
-		if ( count( $shortcode['atts'] ) && $shortcode['atts'] ) {
722
+		if (count($shortcode['atts']) && $shortcode['atts']) {
723 723
 
724
-			foreach ( $shortcode['atts'] as $attr_name => $attr_info ) {
724
+			foreach ($shortcode['atts'] as $attr_name => $attr_info) {
725 725
 
726 726
 
727
-				$prefix = isset( $attr_info['prefix'] ) ? sprintf( '<span class="lasso-option-prefix">%s</span>', $attr_info['prefix'] ) : null;
727
+				$prefix = isset($attr_info['prefix']) ? sprintf('<span class="lasso-option-prefix">%s</span>', $attr_info['prefix']) : null;
728 728
 
729 729
 				$return .= '<form id="lasso--component-settings-form" class="'.$galleries.'" method="post">';
730 730
 				$return .= '<p data-option="'.$attr_name.'" class="lasso-option aesop-'.$slug.'-'.$attr_name.'">';
731
-				$return .= '<label for="aesop-generator-attr-' . $attr_name . '">' . $attr_info['desc'] . '</label>';
731
+				$return .= '<label for="aesop-generator-attr-'.$attr_name.'">'.$attr_info['desc'].'</label>';
732 732
 				$return .= '<small class="lasso-option-desc">'.$attr_info['tip'].'</small>';
733 733
 				// Select
734 734
 
735
-				if ( isset( $attr_info['values'] ) ) {
735
+				if (isset($attr_info['values'])) {
736 736
 
737
-					$return .= '<select name="' . $attr_name . '" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr">';
737
+					$return .= '<select name="'.$attr_name.'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr">';
738 738
 
739
-					$i=0;
739
+					$i = 0;
740 740
 
741
-					foreach ( $attr_info['values'] as $attr_value ) {
741
+					foreach ($attr_info['values'] as $attr_value) {
742 742
 						$attr_value_selected = $attr_info['default'] == $attr_value ? ' selected="selected"' : '';
743 743
 
744
-						$return .= '<option value="'.$attr_info['values'][$i]['value'].'" ' . $attr_value_selected . '>'.$attr_info['values'][$i]['name'].'</option>';
744
+						$return .= '<option value="'.$attr_info['values'][$i]['value'].'" '.$attr_value_selected.'>'.$attr_info['values'][$i]['name'].'</option>';
745 745
 
746 746
 						$i++;
747 747
 					}
@@ -750,24 +750,24 @@  discard block
 block discarded – undo
750 750
 
751 751
 				} else {
752 752
 
753
-					$attr_field_type = isset( $attr_info['type'] ) ? $attr_info['type'] : 'text';
753
+					$attr_field_type = isset($attr_info['type']) ? $attr_info['type'] : 'text';
754 754
 
755 755
 					// image upload
756
-					if ( 'media_upload' == $attr_info['type'] ) {
756
+					if ('media_upload' == $attr_info['type']) {
757 757
 
758
-						$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.'" />';
758
+						$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.'" />';
759 759
 						$return .= '<a href="#" id="lasso-upload-img" class="lasso-option-button" /></a>';
760 760
 
761
-					} elseif ( 'color' == $attr_info['type'] ) {
761
+					} elseif ('color' == $attr_info['type']) {
762 762
 
763
-						$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.'" />';
763
+						$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.'" />';
764 764
 
765
-					} elseif ( 'text_area' == $attr_info['type'] ) {
765
+					} elseif ('text_area' == $attr_info['type']) {
766 766
 
767
-						$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.'';
767
+						$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.'';
768 768
 
769 769
 					} else {
770
-						$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.'';
770
+						$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.'';
771 771
 					}
772 772
 				}
773 773
 				$return .= '</p>';
@@ -778,9 +778,9 @@  discard block
 block discarded – undo
778 778
 		///////////////////////////
779 779
 		// START GALLERY AND MAP FRONT END STUFFS
780 780
 		///////////////////////////
781
-		if ( isset( $shortcode['front'] ) && true == $shortcode['front'] ) {
781
+		if (isset($shortcode['front']) && true == $shortcode['front']) {
782 782
 
783
-			if ( 'gallery' == $shortcode['front_type'] ) {
783
+			if ('gallery' == $shortcode['front_type']) {
784 784
 
785 785
 				$return .= lasso_gallery_editor_module();
786 786
 
@@ -791,13 +791,13 @@  discard block
 block discarded – undo
791 791
 		///////////////////////////
792 792
 
793 793
 		// Single shortcode (not closed)
794
-		if ( 'single' == $shortcode['type'] ) {
794
+		if ('single' == $shortcode['type']) {
795 795
 
796 796
 			$return .= '<input type="hidden" name="lasso-generator-content" id="lasso-generator-content" value="false" />';
797 797
 
798 798
 		} else {
799 799
 
800
-			$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>';
800
+			$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>';
801 801
 		}
802 802
 
803 803
 		$return .= '<p class="lasso-buttoninsert-wrap"><a href="#" class="lasso-generator-cancel" id="lasso--sidebar__close">Cancel
@@ -834,14 +834,14 @@  discard block
 block discarded – undo
834 834
 				<div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div>
835 835
 				<div id="lasso--hide" style="display:none;" class="lasso--post-form">
836 836
 					<i class="lasso-icon lasso-icon-move"></i>
837
-					<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>
837
+					<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>
838 838
 					<div class="lasso--slider_wrap">
839 839
 						<div id="lasso--slider"></div>
840 840
 					</div>
841 841
 					<ul id="lasso--revision-list"></ul>
842 842
 					<div class="lasso--btn-group lasso--btn-group-small">
843
-						<a href="#" class="lasso--btn-secondary" id="lasso--close-modal"><?php _e( 'Cancel', 'lasso' );?></a>
844
-						<a href="#" class="lasso--btn-primary" id="lasso--select-revision"><?php _e( 'Select', 'lasso' );?></a>
843
+						<a href="#" class="lasso--btn-secondary" id="lasso--close-modal"><?php _e('Cancel', 'lasso'); ?></a>
844
+						<a href="#" class="lasso--btn-primary" id="lasso--select-revision"><?php _e('Select', 'lasso'); ?></a>
845 845
 					</div>
846 846
 				</div>
847 847
 
Please login to merge, or discard this patch.
public/includes/assets.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 
23 23
 			wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true);
24 24
 
25
-            //don't load autocomplete if it's a stockholm theme
25
+			//don't load autocomplete if it's a stockholm theme
26 26
 			$themename  	= wp_get_theme()->get('Name');
27 27
 			if ($themename !='Stockholm' ) {
28 28
 				wp_enqueue_script('jquery-ui-autocomplete');
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 			$postid 			= get_the_ID();
86 86
 			
87 87
 			$post_date = get_the_time('U', $postid);
88
-            $delta = time() - $post_date;
88
+			$delta = time() - $post_date;
89 89
 
90 90
 			$strings = array(
91 91
 				'save' 				=> __('Save','lasso'),
@@ -132,11 +132,11 @@  discard block
 block discarded – undo
132 132
 			$gallery_nonce = wp_create_nonce( $gallery_nonce_action );
133 133
 			
134 134
 			
135
-            if ($allow_change_date) {
136
-			    $permalink = get_site_url().'/?p='.$postid;
137
-            } else {
138
-                $permalink = get_permalink($postid);
139
-            }
135
+			if ($allow_change_date) {
136
+				$permalink = get_site_url().'/?p='.$postid;
137
+			} else {
138
+				$permalink = get_permalink($postid);
139
+			}
140 140
 			
141 141
 			// rest api
142 142
 			$rest_nonce = '';
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 			
234 234
 			
235 235
 			if (!$using_restapiv2) {
236
-               // enqueue REST API V1
236
+			   // enqueue REST API V1
237 237
 			   wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
238 238
 			   $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) );
239 239
 			   wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings );
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 			if ($show_color) {
250 250
 				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true);
251 251
 			} else {
252
-			    wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
252
+				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
253 253
 			}
254 254
 			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) );
255 255
 
Please login to merge, or discard this patch.
Spacing   +86 added lines, -86 removed lines patch added patch discarded remove patch
@@ -10,21 +10,21 @@  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
-		if ( lasso_user_can('edit_posts')) {
21
+		if (lasso_user_can('edit_posts')) {
22 22
 
23 23
 			wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true);
24 24
 
25 25
             //don't load autocomplete if it's a stockholm theme
26
-			$themename  	= wp_get_theme()->get('Name');
27
-			if ($themename !='Stockholm' ) {
26
+			$themename = wp_get_theme()->get('Name');
27
+			if ($themename != 'Stockholm') {
28 28
 				wp_enqueue_script('jquery-ui-autocomplete');
29 29
 			}
30 30
 			wp_enqueue_script('jquery-ui-draggable');
@@ -37,27 +37,27 @@  discard block
 block discarded – undo
37 37
 			// url for json api
38 38
 			$home_url = function_exists('json_get_url_prefix') ? json_get_url_prefix() : false;
39 39
 
40
-			$article_object 	= lasso_editor_get_option('article_class','lasso_editor');
40
+			$article_object 	= lasso_editor_get_option('article_class', 'lasso_editor');
41 41
 
42
-			$article_object 	= empty( $article_object ) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object;
42
+			$article_object 	= empty($article_object) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object;
43 43
 
44
-			$featImgClass 		= lasso_editor_get_option('featimg_class','lasso_editor');
45
-			if (empty( $featImgClass )) {
44
+			$featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor');
45
+			if (empty($featImgClass)) {
46 46
 				$featImgClass = lasso_get_supported_theme_featured_image_class();
47 47
 			}
48
-			$titleClass 		= lasso_editor_get_option('title_class','lasso_editor');
49
-			if (empty( $titleClass )) {
48
+			$titleClass = lasso_editor_get_option('title_class', 'lasso_editor');
49
+			if (empty($titleClass)) {
50 50
 				$titleClass = lasso_get_supported_theme_title_class();
51 51
 			}
52
-			$toolbar_headings  	= lasso_editor_get_option('toolbar_headings', 'lasso_editor');
53
-			$toolbar_headings_h4  	= lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
52
+			$toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor');
53
+			$toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
54 54
 			$objectsNoSave  	= lasso_editor_get_option('dont_save', 'lasso_editor');
55
-			$objectsNonEditable  	= lasso_editor_get_option('non_editable', 'lasso_editor');
55
+			$objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor');
56 56
 			$disableRESTSave = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor');
57
-			$save_to_post_disabled  = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' );
57
+			$save_to_post_disabled = lasso_editor_get_option('post_save_disabled', 'lasso_editor');
58 58
 			
59
-			$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor','b');
60
-			$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor','i');
59
+			$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor', 'b');
60
+			$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor', 'i');
61 61
 
62 62
 			
63 63
 			//text alignement
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
 			
72 72
 			if ($show_color) {
73 73
 				//color picker
74
-				wp_enqueue_style( 'wp-color-picker' );
75
-				wp_enqueue_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 );
74
+				wp_enqueue_style('wp-color-picker');
75
+				wp_enqueue_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), false, 1);
76 76
 			}
77 77
 			
78 78
 			// click to insert components, not drag and drop
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 			
82 82
 			// custom fields
83 83
 			
84
-			$custom_fields = apply_filters( 'editus_custom_fields', null ); //array('testFieldName' => '#field1');
84
+			$custom_fields = apply_filters('editus_custom_fields', null); //array('testFieldName' => '#field1');
85 85
 
86 86
 
87 87
 
@@ -92,53 +92,53 @@  discard block
 block discarded – undo
92 92
             $delta = time() - $post_date;
93 93
 
94 94
 			$strings = array(
95
-				'save' 				=> __('Save','lasso'),
96
-				'selectText'	  	=> __('Please Select Text First.','lasso'),
97
-				'cancel' 			=> __('Cancel','lasso'),
98
-				'exiteditor' 		=> __('Exit Editor','lasso'),
99
-				'saving' 			=> __('Saving...','lasso'),
100
-				'saved'				=> __('Saved!','lasso'),
101
-				'adding' 			=> __('Adding...','lasso'),
102
-				'added'				=> __('Added!','lasso'),
103
-				'loading' 			=> __('Loading...','lasso'),
104
-				'loadMore'			=> __('Load More','lasso'),
105
-				'close'			=> __('Close','lasso'),
106
-				'noPostsFound'		=> __('No more posts found','lasso'),
107
-				'fetchFail'	    	=> __('Fetching failed.','lasso'),
108
-				'galleryCreated' 	=> __('Gallery Created!','lasso'),
109
-				'galleryUpdated' 	=> __('Gallery Updated!','lasso'),
110
-				'justWrite'			=> __('Just write...','lasso'),
111
-				'chooseImage'		=> __('Choose an image','lasso'),
112
-				'updateImage'		=> __('Update Image','lasso'),
113
-				'insertImage'		=> __('Insert Image','lasso'),
114
-				'selectImage'		=> __('Select Image','lasso'),
115
-				'removeFeatImg'     => __('Remove featured image?','lasso'),
116
-				'updateSelectedImg' => __('Update Selected Image','lasso'),
117
-				'chooseImages'		=> __('Choose images','lasso'),
118
-				'editImage'			=> __('Edit Image','lasso'),
119
-				'addImages'			=> __('Add Images','lasso'),
120
-				'addNewGallery'		=> __('Add New Gallery','lasso'),
121
-				'selectGallery'		=> __('Select Lasso Gallery Image','lasso'),
122
-				'useSelectedImages' => __('Use Selected Images','lasso'),
123
-				'publishPost'		=> __('Publish Post?','lasso'),
124
-				'publishYes'		=> __('Yes, publish it!','lasso'),
125
-				'deletePost'		=> __('Trash Post?','lasso'),
126
-				'deleteYes'			=> __('Yes, trash it!','lasso'),
127
-				'warning'			=> __('Oh snap!','laso'),
128
-				'cancelText'		=> __('O.K. got it!','lasso'),
129
-				'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'),
95
+				'save' 				=> __('Save', 'lasso'),
96
+				'selectText'	  	=> __('Please Select Text First.', 'lasso'),
97
+				'cancel' 			=> __('Cancel', 'lasso'),
98
+				'exiteditor' 		=> __('Exit Editor', 'lasso'),
99
+				'saving' 			=> __('Saving...', 'lasso'),
100
+				'saved'				=> __('Saved!', 'lasso'),
101
+				'adding' 			=> __('Adding...', 'lasso'),
102
+				'added'				=> __('Added!', 'lasso'),
103
+				'loading' 			=> __('Loading...', 'lasso'),
104
+				'loadMore'			=> __('Load More', 'lasso'),
105
+				'close'			=> __('Close', 'lasso'),
106
+				'noPostsFound'		=> __('No more posts found', 'lasso'),
107
+				'fetchFail'	    	=> __('Fetching failed.', 'lasso'),
108
+				'galleryCreated' 	=> __('Gallery Created!', 'lasso'),
109
+				'galleryUpdated' 	=> __('Gallery Updated!', 'lasso'),
110
+				'justWrite'			=> __('Just write...', 'lasso'),
111
+				'chooseImage'		=> __('Choose an image', 'lasso'),
112
+				'updateImage'		=> __('Update Image', 'lasso'),
113
+				'insertImage'		=> __('Insert Image', 'lasso'),
114
+				'selectImage'		=> __('Select Image', 'lasso'),
115
+				'removeFeatImg'     => __('Remove featured image?', 'lasso'),
116
+				'updateSelectedImg' => __('Update Selected Image', 'lasso'),
117
+				'chooseImages'		=> __('Choose images', 'lasso'),
118
+				'editImage'			=> __('Edit Image', 'lasso'),
119
+				'addImages'			=> __('Add Images', 'lasso'),
120
+				'addNewGallery'		=> __('Add New Gallery', 'lasso'),
121
+				'selectGallery'		=> __('Select Lasso Gallery Image', 'lasso'),
122
+				'useSelectedImages' => __('Use Selected Images', 'lasso'),
123
+				'publishPost'		=> __('Publish Post?', 'lasso'),
124
+				'publishYes'		=> __('Yes, publish it!', 'lasso'),
125
+				'deletePost'		=> __('Trash Post?', 'lasso'),
126
+				'deleteYes'			=> __('Yes, trash it!', 'lasso'),
127
+				'warning'			=> __('Oh snap!', 'laso'),
128
+				'cancelText'		=> __('O.K. got it!', 'lasso'),
129
+				'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'),
130 130
 				'missingConfirm'	=> __('Update Settings', 'lasso'),
131
-				'helperText'		=> __('one more letter','lasso'),
131
+				'helperText'		=> __('one more letter', 'lasso'),
132 132
 				'editingBackup'  	=> __('You are currently editing a backup copy of this post.'),
133 133
 				
134 134
 				
135 135
 			);
136 136
 
137
-			$api_url = trailingslashit( home_url() ) . 'lasso-internal-api';
137
+			$api_url = trailingslashit(home_url()).'lasso-internal-api';
138 138
 
139 139
 			$gallery_class = new gallery();
140 140
 			$gallery_nonce_action = $gallery_class->nonce_action;
141
-			$gallery_nonce = wp_create_nonce( $gallery_nonce_action );
141
+			$gallery_nonce = wp_create_nonce($gallery_nonce_action);
142 142
 			
143 143
 			
144 144
             if ($allow_change_date) {
@@ -153,13 +153,13 @@  discard block
 block discarded – undo
153 153
 			  
154 154
 			if (function_exists('rest_url')) {
155 155
 				//$rest_root = esc_url_raw( rest_url());
156
-				$rest_nonce = wp_create_nonce( 'wp_rest' );
157
-				$settings = array( 'root' => $rest_root, 'nonce' => $rest_nonce );
158
-				wp_enqueue_script( 'wp-api', '', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
159
-				wp_localize_script( 'wp-api', 'wpApiSettings', $settings );
160
-				wp_localize_script( 'wp-api', 'WP_API_Settings', $settings );
156
+				$rest_nonce = wp_create_nonce('wp_rest');
157
+				$settings = array('root' => $rest_root, 'nonce' => $rest_nonce);
158
+				wp_enqueue_script('wp-api', '', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true);
159
+				wp_localize_script('wp-api', 'wpApiSettings', $settings);
160
+				wp_localize_script('wp-api', 'WP_API_Settings', $settings);
161 161
 				
162
-				if ( class_exists( 'WP_REST_Controller' )) {
162
+				if (class_exists('WP_REST_Controller')) {
163 163
 					// we are using REST API V2
164 164
 					$using_restapiv2 = true;
165 165
 				}
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
 
168 168
 			// localized objects
169 169
 			$objects = array(
170
-				'ajaxurl' 			=> esc_url( $api_url ),
171
-				'ajaxurl2' 			=> esc_url( admin_url( 'admin-ajax.php' )),
170
+				'ajaxurl' 			=> esc_url($api_url),
171
+				'ajaxurl2' 			=> esc_url(admin_url('admin-ajax.php')),
172 172
 				'rest_root'         => $rest_root,
173 173
 				'rest_nonce'        => $rest_nonce,
174 174
 				'editor' 			=> 'lasso--content', // ID of editable content (without #) DONT CHANGE
@@ -176,13 +176,13 @@  discard block
 block discarded – undo
176 176
 				'featImgClass'		=> $featImgClass,
177 177
 				'titleClass'		=> $titleClass,
178 178
 				'strings'			=> $strings,
179
-				'settingsLink'		=> function_exists('is_multisite') && is_multisite() ? network_admin_url( 'settings.php?page=lasso-editor' ) : admin_url( 'admin.php?page=lasso-editor-settings' ),
180
-				'post_status'		=> get_post_status( $postid ),
179
+				'settingsLink'		=> function_exists('is_multisite') && is_multisite() ? network_admin_url('settings.php?page=lasso-editor') : admin_url('admin.php?page=lasso-editor-settings'),
180
+				'post_status'		=> get_post_status($postid),
181 181
 				'postid'			=> $postid,
182 182
 				'permalink'			=> $permalink,
183 183
 				'edit_others_pages'	=> current_user_can('edit_others_pages') ? true : false,
184 184
 				'edit_others_posts'	=> current_user_can('edit_others_posts') ? true : false,
185
-				'userCanEdit'		=> current_user_can('edit_post', $postid ),
185
+				'userCanEdit'		=> current_user_can('edit_post', $postid),
186 186
 				'can_publish_posts'	=> current_user_can('publish_posts'),
187 187
 				'can_publish_pages'	=> current_user_can('publish_pages'),
188 188
 				'author'			=> is_user_logged_in() ? get_current_user_ID() : false,
@@ -217,26 +217,26 @@  discard block
 block discarded – undo
217 217
 				'postTags'    		=> lasso_get_objects('tag'),
218 218
 				'noResultsDiv'		=> lasso_editor_empty_results(),
219 219
 				'noRevisionsDiv'	=> lasso_editor_empty_results('revision'),
220
-				'mapTileProvider'   => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider( $postid ) : false,
221
-				'mapLocations'		=> get_post_meta( $postid, 'ase_map_component_locations' ),
222
-				'mapStart'			=> get_post_meta( $postid, 'ase_map_component_start_point', true ),
223
-				'mapZoom'			=> get_post_meta( $postid, 'ase_map_component_zoom', true ),
220
+				'mapTileProvider'   => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider($postid) : false,
221
+				'mapLocations'		=> get_post_meta($postid, 'ase_map_component_locations'),
222
+				'mapStart'			=> get_post_meta($postid, 'ase_map_component_start_point', true),
223
+				'mapZoom'			=> get_post_meta($postid, 'ase_map_component_zoom', true),
224 224
 				'revisionModal' 	=> lasso_editor_revision_modal(),
225 225
 				'isMobile'          => wp_is_mobile(),
226
-				'enableAutoSave'    => lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ),
226
+				'enableAutoSave'    => lasso_editor_get_option('enable_autosave', 'lasso_editor'),
227 227
 				'showColor'         => $show_color,
228 228
 				'showAlignment'     => $show_align,
229 229
 				'showIgnoredItems'  => lasso_editor_get_option('show_ignored_items', 'lasso_editor'),
230 230
 				'restapi2'          => $using_restapiv2,
231 231
 				'saveusingrest'     => $using_restapiv2 && !$disableRESTSave,
232
-				'newObjectContent'  => '<p>'.apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso') ).'</p>',
232
+				'newObjectContent'  => '<p>'.apply_filters('lasso_new_object_content', __('Once upon a time...', 'lasso')).'</p>',
233 233
 				'disableSavePost'   => $save_to_post_disabled,
234 234
 				'boldTag'           => $bold_tag,
235 235
 				'iTag'           	=> $i_tag,
236 236
 				'customFields'      => $custom_fields,
237
-				'clickToInsert'     => ($insert_comp_ui !='drag'),
238
-				'buttonOnEmptyP'     => ($insert_comp_ui =='mediumcom'),      // auto show a button to insert components on an empty paragraph           
239
-				'skipToEdit'        =>( $delta < 10 ) // if it's a new post, skip to edit mode
237
+				'clickToInsert'     => ($insert_comp_ui != 'drag'),
238
+				'buttonOnEmptyP'     => ($insert_comp_ui == 'mediumcom'), // auto show a button to insert components on an empty paragraph           
239
+				'skipToEdit'        =>($delta < 10) // if it's a new post, skip to edit mode
240 240
 			);
241 241
 
242 242
 
@@ -245,9 +245,9 @@  discard block
 block discarded – undo
245 245
 			
246 246
 			if (!$using_restapiv2) {
247 247
                // enqueue REST API V1
248
-			   wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
249
-			   $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) );
250
-			   wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings );
248
+			   wp_enqueue_script('wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true);
249
+			   $settings = array('root' => home_url($home_url), 'nonce' => wp_create_nonce('wp_json'));
250
+			   wp_localize_script('wp-api-js', 'WP_API_Settings', $settings);
251 251
 			}
252 252
 			
253 253
 			if ($allow_change_date) {
@@ -256,13 +256,13 @@  discard block
 block discarded – undo
256 256
 				wp_enqueue_style('jquery-ui');
257 257
 			}
258 258
 
259
-			$postfix = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? '' : '.min';
259
+			$postfix = (defined('SCRIPT_DEBUG') && true === SCRIPT_DEBUG) ? '' : '.min';
260 260
 			if ($show_color) {
261
-				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true);
261
+				wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api', 'iris'), LASSO_VERSION, true);
262 262
 			} else {
263
-			    wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
263
+			    wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
264 264
 			}
265
-			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) );
265
+			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects));
266 266
 
267 267
 
268 268
 		}
Please login to merge, or discard this patch.
includes/process/new_object.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -28,26 +28,26 @@  discard block
 block discarded – undo
28 28
 	 *
29 29
 	 * @since 1.0
30 30
 	 */
31
-	public function post( $data ) {
31
+	public function post($data) {
32 32
 
33
-		$title  = $data[ 'story_title' ];
33
+		$title  = $data['story_title'];
34 34
 
35
-		$object = is_null( $data[ 'object'] ) ? false : $data[ 'object' ];
35
+		$object = is_null($data['object']) ? false : $data['object'];
36 36
 
37 37
 		// insert a new post
38 38
 		$args = array(
39 39
 			'post_title'    => $title,
40 40
 			'post_status'   => 'draft',
41 41
 			'post_type'    	=> $object,
42
-			'post_content'  => apply_filters( 'lasso_new_object_content', '<p>'.__( 'Once upon a time...','lasso').'</p>' )
42
+			'post_content'  => apply_filters('lasso_new_object_content', '<p>'.__('Once upon a time...', 'lasso').'</p>')
43 43
 		);
44 44
 
45
-		$postid = wp_insert_post( apply_filters( 'lasso_insert_object_args', $args ) );
45
+		$postid = wp_insert_post(apply_filters('lasso_insert_object_args', $args));
46 46
 
47
-		do_action( 'lasso_new_object', $postid, $object, $title, get_current_user_ID() );
47
+		do_action('lasso_new_object', $postid, $object, $title, get_current_user_ID());
48 48
 
49 49
 		return array(
50
-			'postlink' => get_permalink( $postid )
50
+			'postlink' => get_permalink($postid)
51 51
 		);
52 52
 
53 53
 	}
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
 	 * @return array Array of keys to pull from $_POST per action and their sanitization callback
61 61
 	 */
62 62
 	public static function params() {
63
-		$params[ 'process_new_object_post' ] = array(
64
-			'story_title' => array( 'wp_strip_all_tags', 'trim' ),
63
+		$params['process_new_object_post'] = array(
64
+			'story_title' => array('wp_strip_all_tags', 'trim'),
65 65
 			'object' => 'trim'
66 66
 		);
67 67
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	 * @return array Array of additional functions to use to authorize action.
78 78
 	 */
79 79
 	public static function auth_callbacks() {
80
-		$params[ 'process_new_object_post' ] = array();
80
+		$params['process_new_object_post'] = array();
81 81
 
82 82
 		return $params;
83 83
 
Please login to merge, or discard this patch.