Completed
Push — master ( 6c81f1...c7c063 )
by
unknown
03:41
created
lasso.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -18,27 +18,27 @@
 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.9.10.5' );
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.9.10.5');
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
 
Please login to merge, or discard this patch.
admin/includes/menus/settings.php 1 patch
Spacing   +69 added lines, -69 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,22 +45,22 @@  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
-			$options = array_map( 'sanitize_text_field', $options );
55
+			$options = array_map('sanitize_text_field', $options);
56 56
 
57
-			if ( function_exists( 'is_multisite' ) && is_multisite() ) {
57
+			if (function_exists('is_multisite') && is_multisite()) {
58 58
 
59
-				update_site_option( 'lasso_editor', $options );
59
+				update_site_option('lasso_editor', $options);
60 60
 
61 61
 			} else {
62 62
 
63
-				update_option( 'lasso_editor', $options );
63
+				update_option('lasso_editor', $options);
64 64
 			}
65 65
 
66 66
 			wp_send_json_success();
@@ -82,150 +82,150 @@  discard block
 block discarded – undo
82 82
 	 */
83 83
 	function lasso_editor_settings_form() {
84 84
 
85
-		if ( !is_user_logged_in() )
85
+		if (!is_user_logged_in())
86 86
 			return;
87 87
 
88
-		$article_object   = lasso_editor_get_option( 'article_class', 'lasso_editor' );
89
-		$featImgClass    = lasso_editor_get_option( 'featimg_class', 'lasso_editor' );
90
-		$titleClass    = lasso_editor_get_option( 'title_class', 'lasso_editor' );
88
+		$article_object = lasso_editor_get_option('article_class', 'lasso_editor');
89
+		$featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor');
90
+		$titleClass = lasso_editor_get_option('title_class', 'lasso_editor');
91 91
 
92
-		$post_new_disabled   = lasso_editor_get_option( 'post_adding_disabled', 'lasso_editor' );
93
-		$save_to_post_disabled  = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' );
94
-		$post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' );
95
-		$shortcodify_disabled  = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' );
96
-		$enable_autosave  = lasso_editor_get_option( 'enable_autosave', 'lasso_editor' );
92
+		$post_new_disabled = lasso_editor_get_option('post_adding_disabled', 'lasso_editor');
93
+		$save_to_post_disabled  = lasso_editor_get_option('post_save_disabled', 'lasso_editor');
94
+		$post_settings_disabled = lasso_editor_get_option('post_settings_disabled', 'lasso_editor');
95
+		$shortcodify_disabled  = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor');
96
+		$enable_autosave = lasso_editor_get_option('enable_autosave', 'lasso_editor');
97 97
 
98
-		$toolbar_headings      = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' );
99
-		$toolbar_show_color      = lasso_editor_get_option( 'toolbar_show_color', 'lasso_editor' );
100
-		$toolbar_show_alignment  = lasso_editor_get_option( 'toolbar_show_alignment', 'lasso_editor' );
98
+		$toolbar_headings      = lasso_editor_get_option('toolbar_headings', 'lasso_editor');
99
+		$toolbar_show_color      = lasso_editor_get_option('toolbar_show_color', 'lasso_editor');
100
+		$toolbar_show_alignment  = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor');
101 101
 		
102
-		$objectsNoSave  	= lasso_editor_get_option('dont_save', 'lasso_editor');
103
-		$objectsNonEditable  	= lasso_editor_get_option('non_editable', 'lasso_editor');
102
+		$objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor');
103
+		$objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor');
104 104
 
105 105
 ?>
106 106
 		<div class="wrap">
107 107
 
108
-	    	<h2><?php _e( 'Editus Settings', 'lasso' );?></h2>
108
+	    	<h2><?php _e('Editus Settings', 'lasso'); ?></h2>
109 109
 
110 110
 			<form id="lasso-editor-settings-form" class="lasso--form-settings" method="post" enctype="multipart/form-data">
111 111
 
112
-				<?php do_action('lasso_settings_before');?>
112
+				<?php do_action('lasso_settings_before'); ?>
113 113
 
114 114
 				<div class="lasso-editor-settings--option-wrap">
115 115
 					<div class="lasso-editor-settings--option-inner">
116
-						<label><?php _e( 'Article Class', 'lasso' );?></label>
117
-						<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>
118
-						<input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr( $article_object );?>" placeholder=".entry-content">
116
+						<label><?php _e('Article Class', 'lasso'); ?></label>
117
+						<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>
118
+						<input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr($article_object); ?>" placeholder=".entry-content">
119 119
 					</div>
120 120
 				</div>
121 121
 
122 122
 				<div class="lasso-editor-settings--option-wrap">
123 123
 					<div class="lasso-editor-settings--option-inner">
124
-						<label><?php _e( 'Featured Image Class', 'lasso' );?></label>
125
-						<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>
126
-						<input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr( $featImgClass );?>" placeholder=".entry-content">
124
+						<label><?php _e('Featured Image Class', 'lasso'); ?></label>
125
+						<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>
126
+						<input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr($featImgClass); ?>" placeholder=".entry-content">
127 127
 					</div>
128 128
 				</div>
129 129
 
130 130
 				<div class="lasso-editor-settings--option-wrap">
131 131
 					<div class="lasso-editor-settings--option-inner">
132
-						<label><?php _e( 'Article Title Class', 'lasso' );?></label>
133
-						<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>
134
-						<input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr( $titleClass );?>" placeholder=".entry-content">
132
+						<label><?php _e('Article Title Class', 'lasso'); ?></label>
133
+						<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>
134
+						<input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr($titleClass); ?>" placeholder=".entry-content">
135 135
 					</div>
136 136
 				</div>
137 137
 
138 138
 				<!-- Advanced -->
139 139
 				<div class="lasso-editor-settings--option-wrap">
140 140
 					<div class="lasso-editor-settings--option-inner">
141
-						<label><?php _e( 'Ignored Items to Save', 'lasso' );?></label>
142
-						<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>
143
-						<textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNoSave );?></textarea>
141
+						<label><?php _e('Ignored Items to Save', 'lasso'); ?></label>
142
+						<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>
143
+						<textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr($objectsNoSave); ?></textarea>
144 144
 					</div>
145 145
 				</div>
146 146
 				
147 147
 				<div class="lasso-editor-settings--option-wrap">
148 148
 					<div class="lasso-editor-settings--option-inner">
149
-						<label><?php _e( 'Read Only Items', 'lasso' );?></label>
150
-						<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>
151
-						<textarea name="lasso_editor[non_editable]" id="lasso_editor[non_editable]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNonEditable );?></textarea>
149
+						<label><?php _e('Read Only Items', 'lasso'); ?></label>
150
+						<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>
151
+						<textarea name="lasso_editor[non_editable]" id="lasso_editor[non_editable]" placeholder=".classname, .another-class"><?php echo esc_attr($objectsNonEditable); ?></textarea>
152 152
 					</div>
153 153
 				</div>
154 154
 
155 155
 				<div class="lasso-editor-settings--option-wrap">
156 156
 					<div class="lasso-editor-settings--option-inner">
157
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked( $toolbar_headings, 'on' );?> >
158
-						<label for="lasso_editor[toolbar_headings]"><?php _e( 'Enable H2 and H3 Buttons', 'lasso' );?></label>
159
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set H2 and H3 settings.', 'lasso' );?></span>
157
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked($toolbar_headings, 'on'); ?> >
158
+						<label for="lasso_editor[toolbar_headings]"><?php _e('Enable H2 and H3 Buttons', 'lasso'); ?></label>
159
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set H2 and H3 settings.', 'lasso'); ?></span>
160 160
 
161 161
 					</div>
162 162
 				</div>
163 163
 				
164 164
 				<div class="lasso-editor-settings--option-wrap">
165 165
 					<div class="lasso-editor-settings--option-inner">
166
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_color]" id="lasso_editor[toolbar_show_color]" <?php echo checked( $toolbar_show_color, 'on' );?> >
167
-						<label for="lasso_editor[toolbar_show_color]"><?php _e( 'Enable Text Color Buttons', 'lasso' );?></label>
168
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set text colors.', 'lasso' );?></span>
166
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_color]" id="lasso_editor[toolbar_show_color]" <?php echo checked($toolbar_show_color, 'on'); ?> >
167
+						<label for="lasso_editor[toolbar_show_color]"><?php _e('Enable Text Color Buttons', 'lasso'); ?></label>
168
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set text colors.', 'lasso'); ?></span>
169 169
 
170 170
 					</div>
171 171
 				</div>
172 172
 				
173 173
 				<div class="lasso-editor-settings--option-wrap">
174 174
 					<div class="lasso-editor-settings--option-inner">
175
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_alignment]" id="lasso_editor[toolbar_show_alignment]" <?php echo checked( $toolbar_show_alignment, 'on' );?> >
176
-						<label for="lasso_editor[toolbar_show_alignment]"><?php _e( 'Enable Text Align Buttons', 'lasso' );?></label>
177
-						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set text alignment.', 'lasso' );?></span>
175
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_alignment]" id="lasso_editor[toolbar_show_alignment]" <?php echo checked($toolbar_show_alignment, 'on'); ?> >
176
+						<label for="lasso_editor[toolbar_show_alignment]"><?php _e('Enable Text Align Buttons', 'lasso'); ?></label>
177
+						<span class="lasso--setting-description"><?php _e('Show the buttons to set text alignment.', 'lasso'); ?></span>
178 178
 
179 179
 					</div>
180 180
 				</div>
181 181
 
182 182
 				<div class="lasso-editor-settings--option-wrap">
183 183
 					<div class="lasso-editor-settings--option-inner">
184
-						<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' );?> >
185
-						<label for="lasso_editor[post_save_disabled]"><?php _e( 'Disable Post Saving', 'lasso' );?></label>
186
-						<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>
184
+						<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'); ?> >
185
+						<label for="lasso_editor[post_save_disabled]"><?php _e('Disable Post Saving', 'lasso'); ?></label>
186
+						<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>
187 187
 
188 188
 					</div>
189 189
 				</div>
190 190
 
191 191
 				<div class="lasso-editor-settings--option-wrap">
192 192
 					<div class="lasso-editor-settings--option-inner">
193
-						<input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked( $post_settings_disabled, 'on' );?> >
194
-						<label for="lasso_editor[post_settings_disabled]"> <?php _e( 'Disable Post Settings', 'lasso' );?></label>
195
-						<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>
193
+						<input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked($post_settings_disabled, 'on'); ?> >
194
+						<label for="lasso_editor[post_settings_disabled]"> <?php _e('Disable Post Settings', 'lasso'); ?></label>
195
+						<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>
196 196
 					</div>
197 197
 				</div>
198 198
 
199 199
 				<div class="lasso-editor-settings--option-wrap">
200 200
 					<div class="lasso-editor-settings--option-inner">
201
-						<input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked( $post_new_disabled, 'on' );?> >
202
-						<label for="lasso_editor[post_adding_disabled]"><?php _e( 'Disable Post Adding', 'lasso' );?></label>
203
-						<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>
201
+						<input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked($post_new_disabled, 'on'); ?> >
202
+						<label for="lasso_editor[post_adding_disabled]"><?php _e('Disable Post Adding', 'lasso'); ?></label>
203
+						<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>
204 204
 					</div>
205 205
 				</div>
206 206
 
207 207
 				<div class="lasso-editor-settings--option-wrap">
208 208
 					<div class="lasso-editor-settings--option-inner">
209
-						<input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked( $shortcodify_disabled, 'on' );?> >
210
-						<label for="lasso_editor[shortcodify_disabled]"><?php _e( 'Disable Aesop Component Conversion', 'lasso' );?></label>
211
-						<span class="lasso--setting-description"><?php _e( 'Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso' );?></span>
209
+						<input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked($shortcodify_disabled, 'on'); ?> >
210
+						<label for="lasso_editor[shortcodify_disabled]"><?php _e('Disable Aesop Component Conversion', 'lasso'); ?></label>
211
+						<span class="lasso--setting-description"><?php _e('Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso'); ?></span>
212 212
 					</div>
213 213
 				</div>
214 214
 				
215 215
 				<div class="lasso-editor-settings--option-wrap last">
216 216
 					<div class="lasso-editor-settings--option-inner">
217
-						<input type="checkbox" class="checkbox" name="lasso_editor[enable_autosave]" id="lasso_editor[enable_autosave]" <?php echo checked( $enable_autosave, 'on' );?> >
218
-						<label for="lasso_editor[enable_autosave]"><?php _e( 'Enable Auto Save', 'lasso' );?></label>
219
-						<span class="lasso--setting-description"><?php _e( 'Check this box to enable auto save.', 'lasso' );?></span>
217
+						<input type="checkbox" class="checkbox" name="lasso_editor[enable_autosave]" id="lasso_editor[enable_autosave]" <?php echo checked($enable_autosave, 'on'); ?> >
218
+						<label for="lasso_editor[enable_autosave]"><?php _e('Enable Auto Save', 'lasso'); ?></label>
219
+						<span class="lasso--setting-description"><?php _e('Check this box to enable auto save.', 'lasso'); ?></span>
220 220
 					</div>
221 221
 				</div>
222 222
 
223
-				<?php do_action('lasso_settings_after');?>
223
+				<?php do_action('lasso_settings_after'); ?>
224 224
 
225 225
 				<div class="lasso-editor-settings--submit">
226 226
 				    <input type="hidden" name="action" value="lasso-editor-settings" />
227
-				    <input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save Settings', 'lasso' );?>" />
228
-					<?php wp_nonce_field( 'nonce', 'lasso_editor_settings' ); ?>
227
+				    <input type="submit" class="button-primary" value="<?php esc_attr_e('Save Settings', 'lasso'); ?>" />
228
+					<?php wp_nonce_field('nonce', 'lasso_editor_settings'); ?>
229 229
 				</div>
230 230
 			</form>
231 231
 
Please login to merge, or discard this patch.