[ 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  __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/support/article/settings-writing-screen/">Documentation on Writing Settings</a>' ) . '</p>' .
  54      '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
  55  );
  56  
  57  require_once ABSPATH . 'wp-admin/admin-header.php';
  58  ?>
  59  
  60  <div class="wrap">
  61  <h1><?php echo esc_html( $title ); ?></h1>
  62  
  63  <form method="post" action="options.php">
  64  <?php settings_fields( 'writing' ); ?>
  65  
  66  <table class="form-table" role="presentation">
  67  <?php if ( get_site_option( 'initial_db_version' ) < 32453 ) : ?>
  68  <tr>
  69  <th scope="row"><?php _e( 'Formatting' ); ?></th>
  70  <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Formatting' ); ?></span></legend>
  71  <label for="use_smilies">
  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>
  75  </fieldset></td>
  76  </tr>
  77  <?php endif; ?>
  78  <tr>
  79  <th scope="row"><label for="default_category"><?php _e( 'Default Post Category' ); ?></label></th>
  80  <td>
  81  <?php
  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  );
  91  ?>
  92  </td>
  93  </tr>
  94  <?php
  95  $post_formats = get_post_format_strings();
  96  unset( $post_formats['standard'] );
  97  ?>
  98  <tr>
  99  <th scope="row"><label for="default_post_format"><?php _e( 'Default Post Format' ); ?></label></th>
 100  <td>
 101      <select name="default_post_format" id="default_post_format">
 102          <option value="0"><?php echo get_post_format_string( 'standard' ); ?></option>
 103  <?php foreach ( $post_formats as $format_slug => $format_name ) : ?>
 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' ) ) :
 111      ?>
 112  <tr>
 113  <th scope="row"><label for="default_link_category"><?php _e( 'Default Link Category' ); ?></label></th>
 114  <td>
 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      ?>
 127  </td>
 128  </tr>
 129  <?php endif; ?>
 130  
 131  <?php
 132  do_settings_fields( 'writing', 'default' );
 133  do_settings_fields( 'writing', 'remote_publishing' ); // A deprecated section.
 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 ) ) {
 140      ?>
 141  <h2 class="title"><?php _e( 'Post via email' ); ?></h2>
 142  <p>
 143      <?php
 144      printf(
 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&#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.' ),
 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>
 153  
 154  <table class="form-table" role="presentation">
 155  <tr>
 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" />
 160  </td>
 161  </tr>
 162  <tr>
 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>
 165  </tr>
 166  <tr>
 167  <th scope="row"><label for="mailserver_pass"><?php _e( 'Password' ); ?></label></th>
 168  <td>
 169  <input name="mailserver_pass" type="text" id="mailserver_pass" value="<?php form_option( 'mailserver_pass' ); ?>" class="regular-text ltr" />
 170  </td>
 171  </tr>
 172  <tr>
 173  <th scope="row"><label for="default_email_category"><?php _e( 'Default Mail Category' ); ?></label></th>
 174  <td>
 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      ?>
 186  </td>
 187  </tr>
 188      <?php do_settings_fields( 'writing', 'post_via_email' ); ?>
 189  </table>
 190  <?php } ?>
 191  
 192  <?php
 193  /**
 194   * Filters whether to enable the Update Services section in the Writing settings screen.
 195   *
 196   * @since 3.0.0
 197   *
 198   * @param bool $enable Whether to enable the Update Services settings area. Default true.
 199   */
 200  if ( apply_filters( 'enable_update_services_configuration', true ) ) {
 201      ?>
 202  <h2 class="title"><?php _e( 'Update Services' ); ?></h2>
 203  
 204      <?php if ( 1 == get_option( 'blog_public' ) ) : ?>
 205  
 206      <p><label for="ping_sites">
 207          <?php
 208          printf(
 209              /* translators: %s: Documentation URL. */
 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.' ),
 211              __( 'https://wordpress.org/support/article/update-services/' )
 212          );
 213          ?>
 214      </label></p>
 215  
 216      <textarea name="ping_sites" id="ping_sites" class="large-text code" rows="3"><?php echo esc_textarea( get_option( 'ping_sites' ) ); ?></textarea>
 217  
 218      <?php else : ?>
 219  
 220      <p>
 221          <?php
 222          printf(
 223              /* translators: 1: Documentation URL, 2: URL to Reading Settings screen. */
 224              __( '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>.' ),
 225              __( 'https://wordpress.org/support/article/update-services/' ),
 226              'options-reading.php'
 227          );
 228          ?>
 229      </p>
 230  
 231      <?php endif; ?>
 232  <?php } // enable_update_services_configuration ?>
 233  
 234  <?php do_settings_sections( 'writing' ); ?>
 235  
 236  <?php submit_button(); ?>
 237  </form>
 238  </div>
 239  
 240  <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?>


Generated: Sat Apr 27 01:00:02 2024 Cross-referenced by PHPXref 0.7.1