author | ymh <ymh.work@gmail.com> |
Tue, 27 Sep 2022 16:37:53 +0200 | |
changeset 19 | 3d72ae0968f4 |
parent 18 | be944660c56a |
child 21 | 48c4eec2b7e6 |
permissions | -rw-r--r-- |
0 | 1 |
<?php |
2 |
/** |
|
3 |
* Writing settings administration panel. |
|
4 |
* |
|
5 |
* @package WordPress |
|
6 |
* @subpackage Administration |
|
7 |
*/ |
|
8 |
||
9 |
/** WordPress Administration Bootstrap */ |
|
16 | 10 |
require_once __DIR__ . '/admin.php'; |
0 | 11 |
|
9 | 12 |
if ( ! current_user_can( 'manage_options' ) ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
13 |
wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) ); |
9 | 14 |
} |
0 | 15 |
|
19 | 16 |
// Used in the HTML title tag. |
9 | 17 |
$title = __( 'Writing Settings' ); |
0 | 18 |
$parent_file = 'options-general.php'; |
19 |
||
9 | 20 |
get_current_screen()->add_help_tab( |
21 |
array( |
|
22 |
'id' => 'overview', |
|
23 |
'title' => __( 'Overview' ), |
|
24 |
'content' => '<p>' . __( 'You can submit content in several different ways; this screen holds the settings for all of them. The top section controls the editor within the dashboard, while the rest control external publishing methods. For more information on any of these methods, use the documentation links.' ) . '</p>' . |
|
25 |
'<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>', |
|
26 |
) |
|
27 |
); |
|
0 | 28 |
|
29 |
/** This filter is documented in wp-admin/options.php */ |
|
30 |
if ( apply_filters( 'enable_post_by_email_configuration', true ) ) { |
|
9 | 31 |
get_current_screen()->add_help_tab( |
32 |
array( |
|
33 |
'id' => 'options-postemail', |
|
34 |
'title' => __( 'Post Via Email' ), |
|
35 |
'content' => '<p>' . __( 'Post via email settings allow you to send your WordPress installation an email with the content of your post. You must set up a secret email account with POP3 access to use this, and any mail received at this address will be posted, so it’s a good idea to keep this address very secret.' ) . '</p>', |
|
36 |
) |
|
37 |
); |
|
0 | 38 |
} |
39 |
||
5 | 40 |
/** This filter is documented in wp-admin/options-writing.php */ |
0 | 41 |
if ( apply_filters( 'enable_update_services_configuration', true ) ) { |
9 | 42 |
get_current_screen()->add_help_tab( |
43 |
array( |
|
44 |
'id' => 'options-services', |
|
45 |
'title' => __( 'Update Services' ), |
|
46 |
'content' => '<p>' . __( 'If desired, WordPress will automatically alert various services of your new posts.' ) . '</p>', |
|
47 |
) |
|
48 |
); |
|
0 | 49 |
} |
50 |
||
51 |
get_current_screen()->set_help_sidebar( |
|
9 | 52 |
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' . |
16 | 53 |
'<p>' . __( '<a href="https://wordpress.org/support/article/settings-writing-screen/">Documentation on Writing Settings</a>' ) . '</p>' . |
9 | 54 |
'<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>' |
0 | 55 |
); |
56 |
||
16 | 57 |
require_once ABSPATH . 'wp-admin/admin-header.php'; |
0 | 58 |
?> |
59 |
||
60 |
<div class="wrap"> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
61 |
<h1><?php echo esc_html( $title ); ?></h1> |
0 | 62 |
|
63 |
<form method="post" action="options.php"> |
|
9 | 64 |
<?php settings_fields( 'writing' ); ?> |
0 | 65 |
|
9 | 66 |
<table class="form-table" role="presentation"> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
67 |
<?php if ( get_site_option( 'initial_db_version' ) < 32453 ) : ?> |
5 | 68 |
<tr> |
9 | 69 |
<th scope="row"><?php _e( 'Formatting' ); ?></th> |
70 |
<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Formatting' ); ?></span></legend> |
|
0 | 71 |
<label for="use_smilies"> |
9 | 72 |
<input name="use_smilies" type="checkbox" id="use_smilies" value="1" <?php checked( '1', get_option( 'use_smilies' ) ); ?> /> |
73 |
<?php _e( 'Convert emoticons like <code>:-)</code> and <code>:-P</code> to graphics on display' ); ?></label><br /> |
|
74 |
<label for="use_balanceTags"><input name="use_balanceTags" type="checkbox" id="use_balanceTags" value="1" <?php checked( '1', get_option( 'use_balanceTags' ) ); ?> /> <?php _e( 'WordPress should correct invalidly nested XHTML automatically' ); ?></label> |
|
0 | 75 |
</fieldset></td> |
76 |
</tr> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
77 |
<?php endif; ?> |
5 | 78 |
<tr> |
9 | 79 |
<th scope="row"><label for="default_category"><?php _e( 'Default Post Category' ); ?></label></th> |
0 | 80 |
<td> |
81 |
<?php |
|
9 | 82 |
wp_dropdown_categories( |
83 |
array( |
|
84 |
'hide_empty' => 0, |
|
85 |
'name' => 'default_category', |
|
86 |
'orderby' => 'name', |
|
87 |
'selected' => get_option( 'default_category' ), |
|
88 |
'hierarchical' => true, |
|
89 |
) |
|
90 |
); |
|
0 | 91 |
?> |
92 |
</td> |
|
93 |
</tr> |
|
94 |
<?php |
|
95 |
$post_formats = get_post_format_strings(); |
|
96 |
unset( $post_formats['standard'] ); |
|
97 |
?> |
|
5 | 98 |
<tr> |
9 | 99 |
<th scope="row"><label for="default_post_format"><?php _e( 'Default Post Format' ); ?></label></th> |
0 | 100 |
<td> |
101 |
<select name="default_post_format" id="default_post_format"> |
|
102 |
<option value="0"><?php echo get_post_format_string( 'standard' ); ?></option> |
|
9 | 103 |
<?php foreach ( $post_formats as $format_slug => $format_name ) : ?> |
0 | 104 |
<option<?php selected( get_option( 'default_post_format' ), $format_slug ); ?> value="<?php echo esc_attr( $format_slug ); ?>"><?php echo esc_html( $format_name ); ?></option> |
105 |
<?php endforeach; ?> |
|
106 |
</select> |
|
107 |
</td> |
|
108 |
</tr> |
|
109 |
<?php |
|
110 |
if ( get_option( 'link_manager_enabled' ) ) : |
|
9 | 111 |
?> |
5 | 112 |
<tr> |
9 | 113 |
<th scope="row"><label for="default_link_category"><?php _e( 'Default Link Category' ); ?></label></th> |
0 | 114 |
<td> |
9 | 115 |
<?php |
116 |
wp_dropdown_categories( |
|
117 |
array( |
|
118 |
'hide_empty' => 0, |
|
119 |
'name' => 'default_link_category', |
|
120 |
'orderby' => 'name', |
|
121 |
'selected' => get_option( 'default_link_category' ), |
|
122 |
'hierarchical' => true, |
|
123 |
'taxonomy' => 'link_category', |
|
124 |
) |
|
125 |
); |
|
126 |
?> |
|
0 | 127 |
</td> |
128 |
</tr> |
|
129 |
<?php endif; ?> |
|
130 |
||
131 |
<?php |
|
9 | 132 |
do_settings_fields( 'writing', 'default' ); |
133 |
do_settings_fields( 'writing', 'remote_publishing' ); // A deprecated section. |
|
0 | 134 |
?> |
135 |
</table> |
|
136 |
||
137 |
<?php |
|
138 |
/** This filter is documented in wp-admin/options.php */ |
|
139 |
if ( apply_filters( 'enable_post_by_email_configuration', true ) ) { |
|
9 | 140 |
?> |
141 |
<h2 class="title"><?php _e( 'Post via email' ); ?></h2> |
|
142 |
<p> |
|
143 |
<?php |
|
144 |
printf( |
|
16 | 145 |
/* translators: 1, 2, 3: Examples of random email addresses. */ |
146 |
__( 'To post to WordPress by email, you must set up a secret email account with POP3 access. Any mail received at this address will be posted, so it’s a good idea to keep this address very secret. Here are three random strings you could use: %1$s, %2$s, %3$s.' ), |
|
9 | 147 |
sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) ), |
148 |
sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) ), |
|
149 |
sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) ) |
|
150 |
); |
|
151 |
?> |
|
152 |
</p> |
|
0 | 153 |
|
9 | 154 |
<table class="form-table" role="presentation"> |
5 | 155 |
<tr> |
9 | 156 |
<th scope="row"><label for="mailserver_url"><?php _e( 'Mail Server' ); ?></label></th> |
157 |
<td><input name="mailserver_url" type="text" id="mailserver_url" value="<?php form_option( 'mailserver_url' ); ?>" class="regular-text code" /> |
|
158 |
<label for="mailserver_port"><?php _e( 'Port' ); ?></label> |
|
159 |
<input name="mailserver_port" type="text" id="mailserver_port" value="<?php form_option( 'mailserver_port' ); ?>" class="small-text" /> |
|
0 | 160 |
</td> |
161 |
</tr> |
|
5 | 162 |
<tr> |
9 | 163 |
<th scope="row"><label for="mailserver_login"><?php _e( 'Login Name' ); ?></label></th> |
164 |
<td><input name="mailserver_login" type="text" id="mailserver_login" value="<?php form_option( 'mailserver_login' ); ?>" class="regular-text ltr" /></td> |
|
0 | 165 |
</tr> |
5 | 166 |
<tr> |
9 | 167 |
<th scope="row"><label for="mailserver_pass"><?php _e( 'Password' ); ?></label></th> |
0 | 168 |
<td> |
9 | 169 |
<input name="mailserver_pass" type="text" id="mailserver_pass" value="<?php form_option( 'mailserver_pass' ); ?>" class="regular-text ltr" /> |
0 | 170 |
</td> |
171 |
</tr> |
|
5 | 172 |
<tr> |
9 | 173 |
<th scope="row"><label for="default_email_category"><?php _e( 'Default Mail Category' ); ?></label></th> |
0 | 174 |
<td> |
9 | 175 |
<?php |
176 |
wp_dropdown_categories( |
|
177 |
array( |
|
178 |
'hide_empty' => 0, |
|
179 |
'name' => 'default_email_category', |
|
180 |
'orderby' => 'name', |
|
181 |
'selected' => get_option( 'default_email_category' ), |
|
182 |
'hierarchical' => true, |
|
183 |
) |
|
184 |
); |
|
185 |
?> |
|
0 | 186 |
</td> |
187 |
</tr> |
|
9 | 188 |
<?php do_settings_fields( 'writing', 'post_via_email' ); ?> |
0 | 189 |
</table> |
190 |
<?php } ?> |
|
191 |
||
192 |
<?php |
|
5 | 193 |
/** |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
194 |
* Filters whether to enable the Update Services section in the Writing settings screen. |
5 | 195 |
* |
196 |
* @since 3.0.0 |
|
197 |
* |
|
198 |
* @param bool $enable Whether to enable the Update Services settings area. Default true. |
|
199 |
*/ |
|
0 | 200 |
if ( apply_filters( 'enable_update_services_configuration', true ) ) { |
9 | 201 |
?> |
202 |
<h2 class="title"><?php _e( 'Update Services' ); ?></h2> |
|
0 | 203 |
|
9 | 204 |
<?php if ( 1 == get_option( 'blog_public' ) ) : ?> |
0 | 205 |
|
9 | 206 |
<p><label for="ping_sites"> |
207 |
<?php |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
208 |
printf( |
18 | 209 |
/* translators: %s: Documentation URL. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
210 |
__( 'When you publish a new post, WordPress automatically notifies the following site update services. For more about this, see <a href="%s">Update Services</a> on the Codex. Separate multiple service URLs with line breaks.' ), |
18 | 211 |
__( 'https://wordpress.org/support/article/update-services/' ) |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
212 |
); |
9 | 213 |
?> |
214 |
</label></p> |
|
0 | 215 |
|
9 | 216 |
<textarea name="ping_sites" id="ping_sites" class="large-text code" rows="3"><?php echo esc_textarea( get_option( 'ping_sites' ) ); ?></textarea> |
0 | 217 |
|
9 | 218 |
<?php else : ?> |
0 | 219 |
|
9 | 220 |
<p> |
221 |
<?php |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
222 |
printf( |
18 | 223 |
/* translators: 1: Documentation URL, 2: URL to Reading Settings screen. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
224 |
__( 'WordPress is not notifying any <a href="%1$s">Update Services</a> because of your site’s <a href="%2$s">visibility settings</a>.' ), |
18 | 225 |
__( 'https://wordpress.org/support/article/update-services/' ), |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
226 |
'options-reading.php' |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
227 |
); |
9 | 228 |
?> |
229 |
</p> |
|
0 | 230 |
|
9 | 231 |
<?php endif; ?> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
232 |
<?php } // enable_update_services_configuration ?> |
0 | 233 |
|
9 | 234 |
<?php do_settings_sections( 'writing' ); ?> |
0 | 235 |
|
236 |
<?php submit_button(); ?> |
|
237 |
</form> |
|
238 |
</div> |
|
239 |
||
16 | 240 |
<?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?> |