equal
deleted
inserted
replaced
156 ); |
156 ); |
157 $allowed_options['misc'] = array(); |
157 $allowed_options['misc'] = array(); |
158 $allowed_options['options'] = array(); |
158 $allowed_options['options'] = array(); |
159 $allowed_options['privacy'] = array(); |
159 $allowed_options['privacy'] = array(); |
160 |
160 |
161 $mail_options = array( 'mailserver_url', 'mailserver_port', 'mailserver_login', 'mailserver_pass' ); |
161 /** |
|
162 * Filters whether the post-by-email functionality is enabled. |
|
163 * |
|
164 * @since 3.0.0 |
|
165 * |
|
166 * @param bool $enabled Whether post-by-email configuration is enabled. Default true. |
|
167 */ |
|
168 if ( apply_filters( 'enable_post_by_email_configuration', true ) ) { |
|
169 $allowed_options['writing'][] = 'mailserver_url'; |
|
170 $allowed_options['writing'][] = 'mailserver_port'; |
|
171 $allowed_options['writing'][] = 'mailserver_login'; |
|
172 $allowed_options['writing'][] = 'mailserver_pass'; |
|
173 } |
162 |
174 |
163 if ( ! is_utf8_charset() ) { |
175 if ( ! is_utf8_charset() ) { |
164 $allowed_options['reading'][] = 'blog_charset'; |
176 $allowed_options['reading'][] = 'blog_charset'; |
165 } |
177 } |
166 |
178 |
178 } |
190 } |
179 |
191 |
180 $allowed_options['general'][] = 'users_can_register'; |
192 $allowed_options['general'][] = 'users_can_register'; |
181 $allowed_options['general'][] = 'default_role'; |
193 $allowed_options['general'][] = 'default_role'; |
182 |
194 |
183 $allowed_options['writing'] = array_merge( $allowed_options['writing'], $mail_options ); |
|
184 if ( '1' === get_option( 'blog_public' ) ) { |
195 if ( '1' === get_option( 'blog_public' ) ) { |
185 $allowed_options['writing'][] = 'ping_sites'; |
196 $allowed_options['writing'][] = 'ping_sites'; |
186 } |
197 } |
187 |
198 |
188 $allowed_options['media'][] = 'uploads_use_yearmonth_folders'; |
199 $allowed_options['media'][] = 'uploads_use_yearmonth_folders'; |
195 if ( get_option( 'upload_url_path' ) |
206 if ( get_option( 'upload_url_path' ) |
196 || get_option( 'upload_path' ) && 'wp-content/uploads' !== get_option( 'upload_path' ) |
207 || get_option( 'upload_path' ) && 'wp-content/uploads' !== get_option( 'upload_path' ) |
197 ) { |
208 ) { |
198 $allowed_options['media'][] = 'upload_path'; |
209 $allowed_options['media'][] = 'upload_path'; |
199 $allowed_options['media'][] = 'upload_url_path'; |
210 $allowed_options['media'][] = 'upload_url_path'; |
200 } |
|
201 } else { |
|
202 /** |
|
203 * Filters whether the post-by-email functionality is enabled. |
|
204 * |
|
205 * @since 3.0.0 |
|
206 * |
|
207 * @param bool $enabled Whether post-by-email configuration is enabled. Default true. |
|
208 */ |
|
209 if ( apply_filters( 'enable_post_by_email_configuration', true ) ) { |
|
210 $allowed_options['writing'] = array_merge( $allowed_options['writing'], $mail_options ); |
|
211 } |
211 } |
212 } |
212 } |
213 |
213 |
214 /** |
214 /** |
215 * Filters the allowed options list. |
215 * Filters the allowed options list. |