[ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * Writing settings administration panel. 4 * 5 * @package WordPress 6 * @subpackage Administration 7 */ 8 9 /** WordPress Administration Bootstrap */ 10 require_once __DIR__ . '/admin.php'; 11 12 if ( ! current_user_can( 'manage_options' ) ) { 13 wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) ); 14 } 15 16 // Used in the HTML title tag. 17 $title = __( 'Writing Settings' ); 18 $parent_file = 'options-general.php'; 19 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 ); 28 29 /** This filter is documented in wp-admin/options.php */ 30 if ( apply_filters( 'enable_post_by_email_configuration', true ) ) { 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 ); 38 } 39 40 /** This filter is documented in wp-admin/options-writing.php */ 41 if ( apply_filters( 'enable_update_services_configuration', true ) ) { 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 ); 49 } 50 51 get_current_screen()->set_help_sidebar( 52 '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . 53 '<p>' . __( '<a href="https://wordpress.org/documentation/article/settings-writing-screen/">Documentation on Writing Settings</a>' ) . '</p>' . 54 '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' 55 ); 56 57 wp_enqueue_script( 'user-profile' ); 58 59 require_once ABSPATH . 'wp-admin/admin-header.php'; 60 ?> 61 62 <div class="wrap"> 63 <h1><?php echo esc_html( $title ); ?></h1> 64 65 <form method="post" action="options.php"> 66 <?php settings_fields( 'writing' ); ?> 67 68 <table class="form-table" role="presentation"> 69 <?php if ( get_site_option( 'initial_db_version' ) < 32453 ) : ?> 70 <?php $formatting_title = __( 'Formatting' ); ?> 71 <tr> 72 <th scope="row"><?php echo $formatting_title; ?></th> 73 <td><fieldset><legend class="screen-reader-text"><span><?php echo $formatting_title; ?></span></legend> 74 <label for="use_smilies"> 75 <input name="use_smilies" type="checkbox" id="use_smilies" value="1" <?php checked( '1', get_option( 'use_smilies' ) ); ?> /> 76 <?php _e( 'Convert emoticons like <code>:-)</code> and <code>:-P</code> to graphics on display' ); ?></label><br /> 77 <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> 78 </fieldset></td> 79 </tr> 80 <?php endif; ?> 81 <tr> 82 <th scope="row"><label for="default_category"><?php _e( 'Default Post Category' ); ?></label></th> 83 <td> 84 <?php 85 wp_dropdown_categories( 86 array( 87 'hide_empty' => 0, 88 'name' => 'default_category', 89 'orderby' => 'name', 90 'selected' => get_option( 'default_category' ), 91 'hierarchical' => true, 92 ) 93 ); 94 ?> 95 </td> 96 </tr> 97 <?php 98 $post_formats = get_post_format_strings(); 99 unset( $post_formats['standard'] ); 100 ?> 101 <tr> 102 <th scope="row"><label for="default_post_format"><?php _e( 'Default Post Format' ); ?></label></th> 103 <td> 104 <select name="default_post_format" id="default_post_format"> 105 <option value="0"><?php echo get_post_format_string( 'standard' ); ?></option> 106 <?php foreach ( $post_formats as $format_slug => $format_name ) : ?> 107 <option<?php selected( get_option( 'default_post_format' ), $format_slug ); ?> value="<?php echo esc_attr( $format_slug ); ?>"><?php echo esc_html( $format_name ); ?></option> 108 <?php endforeach; ?> 109 </select> 110 </td> 111 </tr> 112 <?php 113 if ( get_option( 'link_manager_enabled' ) ) : 114 ?> 115 <tr> 116 <th scope="row"><label for="default_link_category"><?php _e( 'Default Link Category' ); ?></label></th> 117 <td> 118 <?php 119 wp_dropdown_categories( 120 array( 121 'hide_empty' => 0, 122 'name' => 'default_link_category', 123 'orderby' => 'name', 124 'selected' => get_option( 'default_link_category' ), 125 'hierarchical' => true, 126 'taxonomy' => 'link_category', 127 ) 128 ); 129 ?> 130 </td> 131 </tr> 132 <?php endif; ?> 133 134 <?php 135 do_settings_fields( 'writing', 'default' ); 136 do_settings_fields( 'writing', 'remote_publishing' ); // A deprecated section. 137 ?> 138 </table> 139 140 <?php 141 /** This filter is documented in wp-admin/options.php */ 142 if ( apply_filters( 'enable_post_by_email_configuration', true ) ) { 143 ?> 144 <h2 class="title"><?php _e( 'Post via email' ); ?></h2> 145 <p> 146 <?php 147 printf( 148 /* translators: 1, 2, 3: Examples of random email addresses. */ 149 __( '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.' ), 150 sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) ), 151 sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) ), 152 sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) ) 153 ); 154 ?> 155 </p> 156 157 <table class="form-table" role="presentation"> 158 <tr> 159 <th scope="row"><label for="mailserver_url"><?php _e( 'Mail Server' ); ?></label></th> 160 <td><input name="mailserver_url" type="text" id="mailserver_url" value="<?php form_option( 'mailserver_url' ); ?>" class="regular-text code" /> 161 <label for="mailserver_port"><?php _e( 'Port' ); ?></label> 162 <input name="mailserver_port" type="text" id="mailserver_port" value="<?php form_option( 'mailserver_port' ); ?>" class="small-text" /> 163 </td> 164 </tr> 165 <tr> 166 <th scope="row"><label for="mailserver_login"><?php _e( 'Login Name' ); ?></label></th> 167 <td><input name="mailserver_login" type="text" id="mailserver_login" value="<?php form_option( 'mailserver_login' ); ?>" class="regular-text ltr" /></td> 168 </tr> 169 <tr class="mailserver-pass-wrap"> 170 <th scope="row"> 171 <label for="mailserver_pass"> 172 <?php _e( 'Password' ); ?> 173 </label> 174 </th> 175 <td> 176 <input type="hidden" value=" " /><!-- #24364 workaround --> 177 <span class="wp-pwd"> 178 <input type="text" name="mailserver_pass" id="mailserver_pass" class="regular-text ltr" autocomplete="off" data-reveal="1" data-pw="<?php echo esc_attr( get_option( 'mailserver_pass' ) ); ?>" /> 179 <button type="button" class="button wp-hide-pw hide-if-no-js" data-toggle="0" data-start-masked="1" aria-label="<?php esc_attr_e( 'Hide password' ); ?>"> 180 <span class="dashicons dashicons-visibility" aria-hidden="true"></span> 181 </button> 182 </span> 183 </td> 184 </tr> 185 <tr> 186 <th scope="row"><label for="default_email_category"><?php _e( 'Default Mail Category' ); ?></label></th> 187 <td> 188 <?php 189 wp_dropdown_categories( 190 array( 191 'hide_empty' => 0, 192 'name' => 'default_email_category', 193 'orderby' => 'name', 194 'selected' => get_option( 'default_email_category' ), 195 'hierarchical' => true, 196 ) 197 ); 198 ?> 199 </td> 200 </tr> 201 <?php do_settings_fields( 'writing', 'post_via_email' ); ?> 202 </table> 203 <?php } ?> 204 205 <?php 206 /** 207 * Filters whether to enable the Update Services section in the Writing settings screen. 208 * 209 * @since 3.0.0 210 * 211 * @param bool $enable Whether to enable the Update Services settings area. Default true. 212 */ 213 if ( apply_filters( 'enable_update_services_configuration', true ) ) { 214 ?> 215 <h2 class="title"><?php _e( 'Update Services' ); ?></h2> 216 217 <?php if ( '1' === get_option( 'blog_public' ) ) : ?> 218 219 <p><label for="ping_sites"> 220 <?php 221 printf( 222 /* translators: %s: Documentation URL. */ 223 __( 'When you publish a new post, WordPress automatically notifies the following site update services. For more about this, see the <a href="%s">Update Services</a> documentation article. Separate multiple service URLs with line breaks.' ), 224 __( 'https://developer.wordpress.org/advanced-administration/wordpress/update-services/' ) 225 ); 226 ?> 227 </label></p> 228 229 <textarea name="ping_sites" id="ping_sites" class="large-text code" rows="3"><?php echo esc_textarea( get_option( 'ping_sites' ) ); ?></textarea> 230 231 <?php else : ?> 232 233 <p> 234 <?php 235 printf( 236 /* translators: 1: Documentation URL, 2: URL to Reading Settings screen. */ 237 __( 'WordPress is not notifying any <a href="%1$s">Update Services</a> because of your site’s <a href="%2$s">visibility settings</a>.' ), 238 __( 'https://developer.wordpress.org/advanced-administration/wordpress/update-services/' ), 239 'options-reading.php' 240 ); 241 ?> 242 </p> 243 244 <?php endif; ?> 245 <?php } // enable_update_services_configuration ?> 246 247 <?php do_settings_sections( 'writing' ); ?> 248 249 <?php submit_button(); ?> 250 </form> 251 </div> 252 253 <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated : Fri Oct 10 08:20:03 2025 | Cross-referenced by PHPXref |