[ 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 <tr> 71 <th scope="row"><?php _e( 'Formatting' ); ?></th> 72 <td><fieldset><legend class="screen-reader-text"><span> 73 <?php 74 /* translators: Hidden accessibility text. */ 75 _e( 'Formatting' ); 76 ?> 77 </span></legend> 78 <label for="use_smilies"> 79 <input name="use_smilies" type="checkbox" id="use_smilies" value="1" <?php checked( '1', get_option( 'use_smilies' ) ); ?> /> 80 <?php _e( 'Convert emoticons like <code>:-)</code> and <code>:-P</code> to graphics on display' ); ?></label><br /> 81 <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> 82 </fieldset></td> 83 </tr> 84 <?php endif; ?> 85 <tr> 86 <th scope="row"><label for="default_category"><?php _e( 'Default Post Category' ); ?></label></th> 87 <td> 88 <?php 89 wp_dropdown_categories( 90 array( 91 'hide_empty' => 0, 92 'name' => 'default_category', 93 'orderby' => 'name', 94 'selected' => get_option( 'default_category' ), 95 'hierarchical' => true, 96 ) 97 ); 98 ?> 99 </td> 100 </tr> 101 <?php 102 $post_formats = get_post_format_strings(); 103 unset( $post_formats['standard'] ); 104 ?> 105 <tr> 106 <th scope="row"><label for="default_post_format"><?php _e( 'Default Post Format' ); ?></label></th> 107 <td> 108 <select name="default_post_format" id="default_post_format"> 109 <option value="0"><?php echo get_post_format_string( 'standard' ); ?></option> 110 <?php foreach ( $post_formats as $format_slug => $format_name ) : ?> 111 <option<?php selected( get_option( 'default_post_format' ), $format_slug ); ?> value="<?php echo esc_attr( $format_slug ); ?>"><?php echo esc_html( $format_name ); ?></option> 112 <?php endforeach; ?> 113 </select> 114 </td> 115 </tr> 116 <?php 117 if ( get_option( 'link_manager_enabled' ) ) : 118 ?> 119 <tr> 120 <th scope="row"><label for="default_link_category"><?php _e( 'Default Link Category' ); ?></label></th> 121 <td> 122 <?php 123 wp_dropdown_categories( 124 array( 125 'hide_empty' => 0, 126 'name' => 'default_link_category', 127 'orderby' => 'name', 128 'selected' => get_option( 'default_link_category' ), 129 'hierarchical' => true, 130 'taxonomy' => 'link_category', 131 ) 132 ); 133 ?> 134 </td> 135 </tr> 136 <?php endif; ?> 137 138 <?php 139 do_settings_fields( 'writing', 'default' ); 140 do_settings_fields( 'writing', 'remote_publishing' ); // A deprecated section. 141 ?> 142 </table> 143 144 <?php 145 /** This filter is documented in wp-admin/options.php */ 146 if ( apply_filters( 'enable_post_by_email_configuration', true ) ) { 147 ?> 148 <h2 class="title"><?php _e( 'Post via email' ); ?></h2> 149 <p> 150 <?php 151 printf( 152 /* translators: 1, 2, 3: Examples of random email addresses. */ 153 __( '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.' ), 154 sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) ), 155 sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) ), 156 sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) ) 157 ); 158 ?> 159 </p> 160 161 <table class="form-table" role="presentation"> 162 <tr> 163 <th scope="row"><label for="mailserver_url"><?php _e( 'Mail Server' ); ?></label></th> 164 <td><input name="mailserver_url" type="text" id="mailserver_url" value="<?php form_option( 'mailserver_url' ); ?>" class="regular-text code" /> 165 <label for="mailserver_port"><?php _e( 'Port' ); ?></label> 166 <input name="mailserver_port" type="text" id="mailserver_port" value="<?php form_option( 'mailserver_port' ); ?>" class="small-text" /> 167 </td> 168 </tr> 169 <tr> 170 <th scope="row"><label for="mailserver_login"><?php _e( 'Login Name' ); ?></label></th> 171 <td><input name="mailserver_login" type="text" id="mailserver_login" value="<?php form_option( 'mailserver_login' ); ?>" class="regular-text ltr" /></td> 172 </tr> 173 <tr class="mailserver-pass-wrap"> 174 <th scope="row"> 175 <label for="mailserver_pass"> 176 <?php _e( 'Password' ); ?> 177 </label> 178 </th> 179 <td> 180 <input type="hidden" value=" " /><!-- #24364 workaround --> 181 <span class="wp-pwd"> 182 <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' ) ); ?>" /> 183 <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' ); ?>"> 184 <span class="dashicons dashicons-visibility" aria-hidden="true"></span> 185 </button> 186 </span> 187 </td> 188 </tr> 189 <tr> 190 <th scope="row"><label for="default_email_category"><?php _e( 'Default Mail Category' ); ?></label></th> 191 <td> 192 <?php 193 wp_dropdown_categories( 194 array( 195 'hide_empty' => 0, 196 'name' => 'default_email_category', 197 'orderby' => 'name', 198 'selected' => get_option( 'default_email_category' ), 199 'hierarchical' => true, 200 ) 201 ); 202 ?> 203 </td> 204 </tr> 205 <?php do_settings_fields( 'writing', 'post_via_email' ); ?> 206 </table> 207 <?php } ?> 208 209 <?php 210 /** 211 * Filters whether to enable the Update Services section in the Writing settings screen. 212 * 213 * @since 3.0.0 214 * 215 * @param bool $enable Whether to enable the Update Services settings area. Default true. 216 */ 217 if ( apply_filters( 'enable_update_services_configuration', true ) ) { 218 ?> 219 <h2 class="title"><?php _e( 'Update Services' ); ?></h2> 220 221 <?php if ( '1' === get_option( 'blog_public' ) ) : ?> 222 223 <p><label for="ping_sites"> 224 <?php 225 printf( 226 /* translators: %s: Documentation URL. */ 227 __( '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.' ), 228 __( 'https://developer.wordpress.org/advanced-administration/wordpress/update-services/' ) 229 ); 230 ?> 231 </label></p> 232 233 <textarea name="ping_sites" id="ping_sites" class="large-text code" rows="3"><?php echo esc_textarea( get_option( 'ping_sites' ) ); ?></textarea> 234 235 <?php else : ?> 236 237 <p> 238 <?php 239 printf( 240 /* translators: 1: Documentation URL, 2: URL to Reading Settings screen. */ 241 __( 'WordPress is not notifying any <a href="%1$s">Update Services</a> because of your site’s <a href="%2$s">visibility settings</a>.' ), 242 __( 'https://developer.wordpress.org/advanced-administration/wordpress/update-services/' ), 243 'options-reading.php' 244 ); 245 ?> 246 </p> 247 248 <?php endif; ?> 249 <?php } // enable_update_services_configuration ?> 250 251 <?php do_settings_sections( 'writing' ); ?> 252 253 <?php submit_button(); ?> 254 </form> 255 </div> 256 257 <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated : Thu Nov 21 08:20:01 2024 | Cross-referenced by PHPXref |