Completed
Push — master ( 48ac41...a138b1 )
by
unknown
03:56
created
admin/includes/menus/settings.php 1 patch
Spacing   +55 added lines, -55 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
 
@@ -22,13 +22,13 @@  discard block
 block discarded – undo
22 22
 	 */
23 23
 	function menu() {
24 24
 
25
-		if ( function_exists( 'is_multisite' ) && is_multisite() ) {
25
+		if (function_exists('is_multisite') && is_multisite()) {
26 26
 
27
-			add_submenu_page( 'settings.php', __( 'Editus', 'lasso' ), __( 'Editus', 'lasso' ), 'manage_network', 'lasso-editor', array( $this, 'settings' ) );
27
+			add_submenu_page('settings.php', __('Editus', 'lasso'), __('Editus', 'lasso'), 'manage_network', 'lasso-editor', array($this, 'settings'));
28 28
 
29 29
 		} else {
30 30
 
31
-			add_submenu_page( 'lasso-editor', __( 'Settings', 'lasso' ), __( 'Settings', 'lasso' ), 'manage_options', 'lasso-editor-settings', array( $this, 'settings' ) );
31
+			add_submenu_page('lasso-editor', __('Settings', 'lasso'), __('Settings', 'lasso'), 'manage_options', 'lasso-editor-settings', array($this, 'settings'));
32 32
 
33 33
 		}
34 34
 	}
@@ -51,22 +51,22 @@  discard block
 block discarded – undo
51 51
 	function process_settings() {
52 52
 
53 53
 		// bail out if current user isn't and administrator and they are not logged in
54
-		if ( !current_user_can( 'manage_options' ) || !is_user_logged_in() )
54
+		if (!current_user_can('manage_options') || !is_user_logged_in())
55 55
 			return;
56 56
 
57
-		if ( isset( $_POST['action'] ) && 'lasso-editor-settings' == $_POST['action'] && check_admin_referer( 'nonce', 'lasso_editor_settings' ) ) {
57
+		if (isset($_POST['action']) && 'lasso-editor-settings' == $_POST['action'] && check_admin_referer('nonce', 'lasso_editor_settings')) {
58 58
 
59
-			$options = isset( $_POST['lasso_editor'] ) ? $_POST['lasso_editor'] : false;
59
+			$options = isset($_POST['lasso_editor']) ? $_POST['lasso_editor'] : false;
60 60
 
61
-			$options = array_map( 'sanitize_text_field', $options );
61
+			$options = array_map('sanitize_text_field', $options);
62 62
 
63
-			if ( function_exists( 'is_multisite' ) && is_multisite() ) {
63
+			if (function_exists('is_multisite') && is_multisite()) {
64 64
 
65
-				update_site_option( 'lasso_editor', $options );
65
+				update_site_option('lasso_editor', $options);
66 66
 
67 67
 			} else {
68 68
 
69
-				update_option( 'lasso_editor', $options );
69
+				update_option('lasso_editor', $options);
70 70
 			}
71 71
 
72 72
 			wp_send_json_success();
@@ -88,111 +88,111 @@  discard block
 block discarded – undo
88 88
 	 */
89 89
 	function lasso_editor_settings_form() {
90 90
 
91
-		if ( !is_user_logged_in() )
91
+		if (!is_user_logged_in())
92 92
 			return;
93 93
 
94
-		$article_object   = lasso_editor_get_option( 'article_class', 'lasso_editor' );
95
-		$featImgClass    = lasso_editor_get_option( 'featimg_class', 'lasso_editor' );
96
-		$titleClass    = lasso_editor_get_option( 'title_class', 'lasso_editor' );
94
+		$article_object = lasso_editor_get_option('article_class', 'lasso_editor');
95
+		$featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor');
96
+		$titleClass = lasso_editor_get_option('title_class', 'lasso_editor');
97 97
 
98
-		$post_new_disabled   = lasso_editor_get_option( 'post_adding_disabled', 'lasso_editor' );
99
-		$save_to_post_disabled  = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' );
100
-		$post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' );
101
-		$shortcodify_disabled  = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' );
98
+		$post_new_disabled = lasso_editor_get_option('post_adding_disabled', 'lasso_editor');
99
+		$save_to_post_disabled  = lasso_editor_get_option('post_save_disabled', 'lasso_editor');
100
+		$post_settings_disabled = lasso_editor_get_option('post_settings_disabled', 'lasso_editor');
101
+		$shortcodify_disabled  = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor');
102 102
 
103
-		$toolbar_headings      = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' );
104
-		$objectsNoSave  	= lasso_editor_get_option('dont_save', 'lasso_editor');
103
+		$toolbar_headings      = lasso_editor_get_option('toolbar_headings', 'lasso_editor');
104
+		$objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor');
105 105
 
106 106
 ?>
107 107
 		<div class="wrap">
108 108
 
109
-	    	<h2><?php _e( 'Editus Settings', 'lasso' );?></h2>
109
+	    	<h2><?php _e('Editus Settings', 'lasso'); ?></h2>
110 110
 
111 111
 			<form id="lasso-editor-settings-form" class="lasso--form-settings" method="post" enctype="multipart/form-data">
112 112
 
113
-				<?php do_action('lasso_settings_before');?>
113
+				<?php do_action('lasso_settings_before'); ?>
114 114
 
115 115
 				<div class="lasso-editor-settings--option-wrap">
116 116
 					<div class="lasso-editor-settings--option-inner">
117
-						<label><?php _e( 'Article Class', 'lasso' );?></label>
118
-						<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>
119
-						<input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr( $article_object );?>" placeholder=".entry-content">
117
+						<label><?php _e('Article Class', 'lasso'); ?></label>
118
+						<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>
119
+						<input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr($article_object); ?>" placeholder=".entry-content">
120 120
 					</div>
121 121
 				</div>
122 122
 
123 123
 				<div class="lasso-editor-settings--option-wrap">
124 124
 					<div class="lasso-editor-settings--option-inner">
125
-						<label><?php _e( 'Featured Image Class', 'lasso' );?></label>
126
-						<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>
127
-						<input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr( $featImgClass );?>" placeholder=".entry-content">
125
+						<label><?php _e('Featured Image Class', 'lasso'); ?></label>
126
+						<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>
127
+						<input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr($featImgClass); ?>" placeholder=".entry-content">
128 128
 					</div>
129 129
 				</div>
130 130
 
131 131
 				<div class="lasso-editor-settings--option-wrap">
132 132
 					<div class="lasso-editor-settings--option-inner">
133
-						<label><?php _e( 'Article Title Class', 'lasso' );?></label>
134
-						<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>
135
-						<input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr( $titleClass );?>" placeholder=".entry-content">
133
+						<label><?php _e('Article Title Class', 'lasso'); ?></label>
134
+						<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>
135
+						<input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr($titleClass); ?>" placeholder=".entry-content">
136 136
 					</div>
137 137
 				</div>
138 138
 
139 139
 				<!-- Advanced -->
140 140
 				<div class="lasso-editor-settings--option-wrap">
141 141
 					<div class="lasso-editor-settings--option-inner">
142
-						<label><?php _e( 'Ignored Items to Save', 'lasso' );?></label>
143
-						<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>
144
-						<textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNoSave );?></textarea>
142
+						<label><?php _e('Ignored Items to Save', 'lasso'); ?></label>
143
+						<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>
144
+						<textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr($objectsNoSave); ?></textarea>
145 145
 					</div>
146 146
 				</div>
147 147
 
148 148
 				<div class="lasso-editor-settings--option-wrap">
149 149
 					<div class="lasso-editor-settings--option-inner">
150
-						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked( $toolbar_headings, 'on' );?> >
151
-						<label for="lasso_editor[toolbar_headings]"><?php _e( 'Enable Toolbar Headings', 'lasso' );?></label>
152
-						<span class="lasso--setting-description"><?php _e( 'By default the H2 and H3 options for headings are in the insert HTML area. You may prefer those headings to act just like the underline, and strikethrough, so toggling this will add them to the toolbar.', 'lasso' );?></span>
150
+						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked($toolbar_headings, 'on'); ?> >
151
+						<label for="lasso_editor[toolbar_headings]"><?php _e('Enable Toolbar Headings', 'lasso'); ?></label>
152
+						<span class="lasso--setting-description"><?php _e('By default the H2 and H3 options for headings are in the insert HTML area. You may prefer those headings to act just like the underline, and strikethrough, so toggling this will add them to the toolbar.', 'lasso'); ?></span>
153 153
 
154 154
 					</div>
155 155
 				</div>
156 156
 
157 157
 				<div class="lasso-editor-settings--option-wrap">
158 158
 					<div class="lasso-editor-settings--option-inner">
159
-						<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' );?> >
160
-						<label for="lasso_editor[post_save_disabled]"><?php _e( 'Disable Post Saving', 'lasso' );?></label>
161
-						<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>
159
+						<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'); ?> >
160
+						<label for="lasso_editor[post_save_disabled]"><?php _e('Disable Post Saving', 'lasso'); ?></label>
161
+						<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>
162 162
 
163 163
 					</div>
164 164
 				</div>
165 165
 
166 166
 				<div class="lasso-editor-settings--option-wrap">
167 167
 					<div class="lasso-editor-settings--option-inner">
168
-						<input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked( $post_settings_disabled, 'on' );?> >
169
-						<label for="lasso_editor[post_settings_disabled]"> <?php _e( 'Disable Post Settings', 'lasso' );?></label>
170
-						<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>
168
+						<input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked($post_settings_disabled, 'on'); ?> >
169
+						<label for="lasso_editor[post_settings_disabled]"> <?php _e('Disable Post Settings', 'lasso'); ?></label>
170
+						<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>
171 171
 					</div>
172 172
 				</div>
173 173
 
174 174
 				<div class="lasso-editor-settings--option-wrap">
175 175
 					<div class="lasso-editor-settings--option-inner">
176
-						<input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked( $post_new_disabled, 'on' );?> >
177
-						<label for="lasso_editor[post_adding_disabled]"><?php _e( 'Disable Post Adding', 'lasso' );?></label>
178
-						<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>
176
+						<input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked($post_new_disabled, 'on'); ?> >
177
+						<label for="lasso_editor[post_adding_disabled]"><?php _e('Disable Post Adding', 'lasso'); ?></label>
178
+						<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>
179 179
 					</div>
180 180
 				</div>
181 181
 
182 182
 				<div class="lasso-editor-settings--option-wrap last">
183 183
 					<div class="lasso-editor-settings--option-inner">
184
-						<input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked( $shortcodify_disabled, 'on' );?> >
185
-						<label for="lasso_editor[shortcodify_disabled]"><?php _e( 'Disable Aesop Component Conversion', 'lasso' );?></label>
186
-						<span class="lasso--setting-description"><?php _e( 'Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso' );?></span>
184
+						<input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked($shortcodify_disabled, 'on'); ?> >
185
+						<label for="lasso_editor[shortcodify_disabled]"><?php _e('Disable Aesop Component Conversion', 'lasso'); ?></label>
186
+						<span class="lasso--setting-description"><?php _e('Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso'); ?></span>
187 187
 					</div>
188 188
 				</div>
189 189
 
190
-				<?php do_action('lasso_settings_after');?>
190
+				<?php do_action('lasso_settings_after'); ?>
191 191
 
192 192
 				<div class="lasso-editor-settings--submit">
193 193
 				    <input type="hidden" name="action" value="lasso-editor-settings" />
194
-				    <input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save Settings', 'lasso' );?>" />
195
-					<?php wp_nonce_field( 'nonce', 'lasso_editor_settings' ); ?>
194
+				    <input type="submit" class="button-primary" value="<?php esc_attr_e('Save Settings', 'lasso'); ?>" />
195
+					<?php wp_nonce_field('nonce', 'lasso_editor_settings'); ?>
196 196
 				</div>
197 197
 			</form>
198 198
 
Please login to merge, or discard this patch.