[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-admin/ -> options-writing.php (source)

   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&#8217;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  <tr>
 113  <th scope="row"><?php _e( 'Collaboration' ); ?></th>
 114  <td>
 115      <?php if ( wp_is_collaboration_allowed() ) : ?>
 116          <label for="wp_collaboration_enabled">
 117              <input name="wp_collaboration_enabled" type="checkbox" id="wp_collaboration_enabled" value="1" <?php checked( '1', (bool) get_option( 'wp_collaboration_enabled' ) ); ?> />
 118              <?php _e( "Enable early access to real-time collaboration. Real-time collaboration may affect your website's performance." ); ?>
 119          </label>
 120      <?php else : ?>
 121          <div class="notice notice-warning inline">
 122              <p><?php _e( '<strong>Note:</strong> Real-time collaboration has been disabled.' ); ?></p>
 123          </div>
 124      <?php endif; ?>
 125  </td>
 126  </tr>
 127  <?php
 128  if ( get_option( 'link_manager_enabled' ) ) :
 129      ?>
 130  <tr>
 131  <th scope="row"><label for="default_link_category"><?php _e( 'Default Link Category' ); ?></label></th>
 132  <td>
 133      <?php
 134      wp_dropdown_categories(
 135          array(
 136              'hide_empty'   => 0,
 137              'name'         => 'default_link_category',
 138              'orderby'      => 'name',
 139              'selected'     => get_option( 'default_link_category' ),
 140              'hierarchical' => true,
 141              'taxonomy'     => 'link_category',
 142          )
 143      );
 144      ?>
 145  </td>
 146  </tr>
 147  <?php endif; ?>
 148  
 149  <?php
 150  do_settings_fields( 'writing', 'default' );
 151  do_settings_fields( 'writing', 'remote_publishing' ); // A deprecated section.
 152  ?>
 153  </table>
 154  
 155  <?php
 156  /** This filter is documented in wp-admin/options.php */
 157  if ( apply_filters( 'enable_post_by_email_configuration', true ) ) {
 158      ?>
 159  <h2 class="title"><?php _e( 'Post via email' ); ?></h2>
 160  <p>
 161      <?php
 162      printf(
 163          /* translators: 1, 2, 3: Examples of random email addresses. */
 164          __( '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&#8217;s a good idea to keep this address very secret. Here are three random strings you could use: %1$s, %2$s, %3$s.' ),
 165          sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) ),
 166          sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) ),
 167          sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) )
 168      );
 169      ?>
 170  </p>
 171  
 172  <table class="form-table" role="presentation">
 173  <tr>
 174  <th scope="row"><label for="mailserver_url"><?php _e( 'Mail Server' ); ?></label></th>
 175  <td><input name="mailserver_url" type="text" id="mailserver_url" value="<?php form_option( 'mailserver_url' ); ?>" class="regular-text code" />
 176  <label for="mailserver_port"><?php _e( 'Port' ); ?></label>
 177  <input name="mailserver_port" type="text" id="mailserver_port" value="<?php form_option( 'mailserver_port' ); ?>" class="small-text" />
 178  </td>
 179  </tr>
 180  <tr>
 181  <th scope="row"><label for="mailserver_login"><?php _e( 'Login Name' ); ?></label></th>
 182  <td><input name="mailserver_login" type="text" id="mailserver_login" value="<?php form_option( 'mailserver_login' ); ?>" class="regular-text ltr" /></td>
 183  </tr>
 184  <tr class="mailserver-pass-wrap">
 185      <th scope="row">
 186          <label for="mailserver_pass">
 187              <?php _e( 'Password' ); ?>
 188          </label>
 189      </th>
 190      <td>
 191          <input type="hidden" value=" " /><!-- #24364 workaround -->
 192          <span class="wp-pwd">
 193              <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' ) ); ?>" />
 194              <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' ); ?>">
 195                  <span class="dashicons dashicons-visibility" aria-hidden="true"></span>
 196              </button>
 197          </span>
 198      </td>
 199  </tr>
 200  <tr>
 201  <th scope="row"><label for="default_email_category"><?php _e( 'Default Mail Category' ); ?></label></th>
 202  <td>
 203      <?php
 204      wp_dropdown_categories(
 205          array(
 206              'hide_empty'   => 0,
 207              'name'         => 'default_email_category',
 208              'orderby'      => 'name',
 209              'selected'     => get_option( 'default_email_category' ),
 210              'hierarchical' => true,
 211          )
 212      );
 213      ?>
 214  </td>
 215  </tr>
 216      <?php do_settings_fields( 'writing', 'post_via_email' ); ?>
 217  </table>
 218  <?php } ?>
 219  
 220  <?php
 221  /**
 222   * Filters whether to enable the Update Services section in the Writing settings screen.
 223   *
 224   * @since 3.0.0
 225   *
 226   * @param bool $enable Whether to enable the Update Services settings area. Default true.
 227   */
 228  if ( apply_filters( 'enable_update_services_configuration', true ) ) {
 229      ?>
 230  <h2 class="title"><?php _e( 'Update Services' ); ?></h2>
 231  
 232      <?php if ( '1' === get_option( 'blog_public' ) ) : ?>
 233  
 234      <p><label for="ping_sites">
 235          <?php
 236          printf(
 237              /* translators: %s: Documentation URL. */
 238              __( '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.' ),
 239              __( 'https://developer.wordpress.org/advanced-administration/wordpress/update-services/' )
 240          );
 241          ?>
 242      </label></p>
 243  
 244      <textarea name="ping_sites" id="ping_sites" class="large-text code" rows="3"><?php echo esc_textarea( get_option( 'ping_sites' ) ); ?></textarea>
 245  
 246      <?php else : ?>
 247  
 248      <p>
 249          <?php
 250          printf(
 251              /* translators: 1: Documentation URL, 2: URL to Reading Settings screen. */
 252              __( 'WordPress is not notifying any <a href="%1$s">Update Services</a> because of your site&#8217;s <a href="%2$s">visibility settings</a>.' ),
 253              __( 'https://developer.wordpress.org/advanced-administration/wordpress/update-services/' ),
 254              'options-reading.php'
 255          );
 256          ?>
 257      </p>
 258  
 259      <?php endif; ?>
 260  <?php } // enable_update_services_configuration ?>
 261  
 262  <?php do_settings_sections( 'writing' ); ?>
 263  
 264  <?php submit_button(); ?>
 265  </form>
 266  </div>
 267  
 268  <?php require_once  ABSPATH . 'wp-admin/admin-footer.php'; ?>


Generated : Wed May 6 08:20:15 2026 Cross-referenced by PHPXref