[ Index ]

PHP Cross Reference of WordPress

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( dirname( __FILE__ ) . '/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  $title       = __( 'Writing Settings' );
  17  $parent_file = 'options-general.php';
  18  
  19  get_current_screen()->add_help_tab(
  20      array(
  21          'id'      => 'overview',
  22          'title'   => __( 'Overview' ),
  23          '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>' .
  24              '<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>',
  25      )
  26  );
  27  
  28  /** This filter is documented in wp-admin/options.php */
  29  if ( apply_filters( 'enable_post_by_email_configuration', true ) ) {
  30      get_current_screen()->add_help_tab(
  31          array(
  32              'id'      => 'options-postemail',
  33              'title'   => __( 'Post Via Email' ),
  34              '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>',
  35          )
  36      );
  37  }
  38  
  39  /** This filter is documented in wp-admin/options-writing.php */
  40  if ( apply_filters( 'enable_update_services_configuration', true ) ) {
  41      get_current_screen()->add_help_tab(
  42          array(
  43              'id'      => 'options-services',
  44              'title'   => __( 'Update Services' ),
  45              'content' => '<p>' . __( 'If desired, WordPress will automatically alert various services of your new posts.' ) . '</p>',
  46          )
  47      );
  48  }
  49  
  50  get_current_screen()->set_help_sidebar(
  51      '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
  52      '<p>' . __( '<a href="https://wordpress.org/support/article/settings-writing-screen/">Documentation on Writing Settings</a>' ) . '</p>' .
  53      '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
  54  );
  55  
  56  include( ABSPATH . 'wp-admin/admin-header.php' );
  57  ?>
  58  
  59  <div class="wrap">
  60  <h1><?php echo esc_html( $title ); ?></h1>
  61  
  62  <form method="post" action="options.php">
  63  <?php settings_fields( 'writing' ); ?>
  64  
  65  <table class="form-table" role="presentation">
  66  <?php if ( get_site_option( 'initial_db_version' ) < 32453 ) : ?>
  67  <tr>
  68  <th scope="row"><?php _e( 'Formatting' ); ?></th>
  69  <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Formatting' ); ?></span></legend>
  70  <label for="use_smilies">
  71  <input name="use_smilies" type="checkbox" id="use_smilies" value="1" <?php checked( '1', get_option( 'use_smilies' ) ); ?> />
  72      <?php _e( 'Convert emoticons like <code>:-)</code> and <code>:-P</code> to graphics on display' ); ?></label><br />
  73  <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>
  74  </fieldset></td>
  75  </tr>
  76  <?php endif; ?>
  77  <tr>
  78  <th scope="row"><label for="default_category"><?php _e( 'Default Post Category' ); ?></label></th>
  79  <td>
  80  <?php
  81  wp_dropdown_categories(
  82      array(
  83          'hide_empty'   => 0,
  84          'name'         => 'default_category',
  85          'orderby'      => 'name',
  86          'selected'     => get_option( 'default_category' ),
  87          'hierarchical' => true,
  88      )
  89  );
  90  ?>
  91  </td>
  92  </tr>
  93  <?php
  94  $post_formats = get_post_format_strings();
  95  unset( $post_formats['standard'] );
  96  ?>
  97  <tr>
  98  <th scope="row"><label for="default_post_format"><?php _e( 'Default Post Format' ); ?></label></th>
  99  <td>
 100      <select name="default_post_format" id="default_post_format">
 101          <option value="0"><?php echo get_post_format_string( 'standard' ); ?></option>
 102  <?php foreach ( $post_formats as $format_slug => $format_name ) : ?>
 103          <option<?php selected( get_option( 'default_post_format' ), $format_slug ); ?> value="<?php echo esc_attr( $format_slug ); ?>"><?php echo esc_html( $format_name ); ?></option>
 104  <?php endforeach; ?>
 105      </select>
 106  </td>
 107  </tr>
 108  <?php
 109  if ( get_option( 'link_manager_enabled' ) ) :
 110      ?>
 111  <tr>
 112  <th scope="row"><label for="default_link_category"><?php _e( 'Default Link Category' ); ?></label></th>
 113  <td>
 114      <?php
 115      wp_dropdown_categories(
 116          array(
 117              'hide_empty'   => 0,
 118              'name'         => 'default_link_category',
 119              'orderby'      => 'name',
 120              'selected'     => get_option( 'default_link_category' ),
 121              'hierarchical' => true,
 122              'taxonomy'     => 'link_category',
 123          )
 124      );
 125      ?>
 126  </td>
 127  </tr>
 128  <?php endif; ?>
 129  
 130  <?php
 131  do_settings_fields( 'writing', 'default' );
 132  do_settings_fields( 'writing', 'remote_publishing' ); // A deprecated section.
 133  ?>
 134  </table>
 135  
 136  <?php
 137  /** This filter is documented in wp-admin/options.php */
 138  if ( apply_filters( 'enable_post_by_email_configuration', true ) ) {
 139      ?>
 140  <h2 class="title"><?php _e( 'Post via email' ); ?></h2>
 141  <p>
 142      <?php
 143      printf(
 144          /* translators: 1, 2, 3: Examples of random email addresses. */
 145          __( '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.' ),
 146          sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) ),
 147          sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) ),
 148          sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) )
 149      );
 150      ?>
 151  </p>
 152  
 153  <table class="form-table" role="presentation">
 154  <tr>
 155  <th scope="row"><label for="mailserver_url"><?php _e( 'Mail Server' ); ?></label></th>
 156  <td><input name="mailserver_url" type="text" id="mailserver_url" value="<?php form_option( 'mailserver_url' ); ?>" class="regular-text code" />
 157  <label for="mailserver_port"><?php _e( 'Port' ); ?></label>
 158  <input name="mailserver_port" type="text" id="mailserver_port" value="<?php form_option( 'mailserver_port' ); ?>" class="small-text" />
 159  </td>
 160  </tr>
 161  <tr>
 162  <th scope="row"><label for="mailserver_login"><?php _e( 'Login Name' ); ?></label></th>
 163  <td><input name="mailserver_login" type="text" id="mailserver_login" value="<?php form_option( 'mailserver_login' ); ?>" class="regular-text ltr" /></td>
 164  </tr>
 165  <tr>
 166  <th scope="row"><label for="mailserver_pass"><?php _e( 'Password' ); ?></label></th>
 167  <td>
 168  <input name="mailserver_pass" type="text" id="mailserver_pass" value="<?php form_option( 'mailserver_pass' ); ?>" class="regular-text ltr" />
 169  </td>
 170  </tr>
 171  <tr>
 172  <th scope="row"><label for="default_email_category"><?php _e( 'Default Mail Category' ); ?></label></th>
 173  <td>
 174      <?php
 175      wp_dropdown_categories(
 176          array(
 177              'hide_empty'   => 0,
 178              'name'         => 'default_email_category',
 179              'orderby'      => 'name',
 180              'selected'     => get_option( 'default_email_category' ),
 181              'hierarchical' => true,
 182          )
 183      );
 184      ?>
 185  </td>
 186  </tr>
 187      <?php do_settings_fields( 'writing', 'post_via_email' ); ?>
 188  </table>
 189  <?php } ?>
 190  
 191  <?php
 192  /**
 193   * Filters whether to enable the Update Services section in the Writing settings screen.
 194   *
 195   * @since 3.0.0
 196   *
 197   * @param bool $enable Whether to enable the Update Services settings area. Default true.
 198   */
 199  if ( apply_filters( 'enable_update_services_configuration', true ) ) {
 200      ?>
 201  <h2 class="title"><?php _e( 'Update Services' ); ?></h2>
 202  
 203      <?php if ( 1 == get_option( 'blog_public' ) ) : ?>
 204  
 205      <p><label for="ping_sites">
 206          <?php
 207          printf(
 208              /* translators: %s: Codex URL. */
 209              __( '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.' ),
 210              __( 'https://codex.wordpress.org/Update_Services' )
 211          );
 212          ?>
 213      </label></p>
 214  
 215      <textarea name="ping_sites" id="ping_sites" class="large-text code" rows="3"><?php echo esc_textarea( get_option( 'ping_sites' ) ); ?></textarea>
 216  
 217      <?php else : ?>
 218  
 219      <p>
 220          <?php
 221          printf(
 222              /* translators: 1: Codex URL, 2: URL to Reading Settings screen. */
 223              __( '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>.' ),
 224              __( 'https://codex.wordpress.org/Update_Services' ),
 225              'options-reading.php'
 226          );
 227          ?>
 228      </p>
 229  
 230      <?php endif; ?>
 231  <?php } // enable_update_services_configuration ?>
 232  
 233  <?php do_settings_sections( 'writing' ); ?>
 234  
 235  <?php submit_button(); ?>
 236  </form>
 237  </div>
 238  
 239  <?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>


Generated: Mon Dec 9 01:00:03 2019 Cross-referenced by PHPXref 0.7.1