-<form name="form" action="options-permalink.php" method="post">
-<h3><?php _e('Common options:'); ?></h3>
-<p>
- <label>
-<input name="selection" type="radio" value="" class="tog" <?php checked('', $permalink_structure); ?> />
-<?php _e('Default'); ?><br /> <span> » <code><?php echo get_settings('home'); ?>/?p=123</code></span>
- </label>
-</p>
-<p>
- <label>
-<input name="selection" type="radio" value="<?php echo $structures[1]; ?>" class="tog" <?php checked($structures[1], $permalink_structure); ?> />
-<?php _e('Date and name based'); ?><br /> <span> » <code><?php echo get_settings('home') . $prefix . '/' . date('Y') . '/' . date('m') . '/' . date('d') . '/sample-post/'; ?></code></span>
- </label>
-</p>
-<p>
- <label>
-<input name="selection" type="radio" value="<?php echo $structures[2]; ?>" class="tog" <?php checked($structures[2], $permalink_structure); ?> />
-<?php _e('Numeric'); ?><br /> <span> » <code><?php echo get_settings('home') . $prefix ; ?>/archives/123</code></span>
- </label>
-</p>
-<p>
-<label>
-<input name="selection" id="custom_selection" type="radio" value="custom" class="tog"
-<?php if ( !in_array($permalink_structure, $structures) ) { ?>
-checked="checked"
-<?php } ?>
- />
-<?php _e('Custom, specify below'); ?>
-</label>
-<br />
-</p>
-<p id="customstructure"><?php _e('Custom structure'); ?>: <input name="permalink_structure" id="permalink_structure" type="text" class="code" style="width: 60%;" value="<?php echo $permalink_structure; ?>" size="50" /></p>
-
-<h3><?php _e('Optional'); ?></h3>
-<?php if ($is_apache) : ?>
- <p><?php _e('If you like, you may enter a custom prefix for your category URIs here. For example, <code>/taxonomy/tags</code> would make your category links like <code>http://example.org/taxonomy/tags/uncategorized/</code>. If you leave this blank the default will be used.') ?></p>
-<?php else : ?>
- <p><?php _e('If you like, you may enter a custom prefix for your category URIs here. For example, <code>/index.php/taxonomy/tags</code> would make your category links like <code>http://example.org/index.php/taxonomy/tags/uncategorized/</code>. If you leave this blank the default will be used.') ?></p>
-<?php endif; ?>
- <p>
- <?php _e('Category base'); ?>: <input name="category_base" type="text" class="code" value="<?php echo $category_base; ?>" size="30" />
- </p>
- <p class="submit">
- <input type="submit" name="submit" value="<?php _e('Update Permalink Structure »') ?>" />
- </p>
- </form>
-<?php if ( $permalink_structure && !$usingpi && !$writable ) : ?>
- <p><?php _e('If your <code>.htaccess</code> file were <a href="http://codex.wordpress.org/Make_a_Directory_Writable">writable</a>, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your <code>.htaccess</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all.') ?></p>
+<h2 class="title"><?php _e('Common Settings'); ?></h2>
+<table class="form-table permalink-structure">
+ <tr>
+ <th><label><input name="selection" type="radio" value="" <?php checked('', $permalink_structure); ?> /> <?php _e( 'Plain' ); ?></label></th>
+ <td><code><?php echo get_option('home'); ?>/?p=123</code></td>
+ </tr>
+ <tr>
+ <th><label><input name="selection" type="radio" value="<?php echo esc_attr($structures[1]); ?>" <?php checked($structures[1], $permalink_structure); ?> /> <?php _e('Day and name'); ?></label></th>
+ <td><code><?php echo get_option('home') . $blog_prefix . $prefix . '/' . date('Y') . '/' . date('m') . '/' . date('d') . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/'; ?></code></td>
+ </tr>
+ <tr>
+ <th><label><input name="selection" type="radio" value="<?php echo esc_attr($structures[2]); ?>" <?php checked($structures[2], $permalink_structure); ?> /> <?php _e('Month and name'); ?></label></th>
+ <td><code><?php echo get_option('home') . $blog_prefix . $prefix . '/' . date('Y') . '/' . date('m') . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/'; ?></code></td>
+ </tr>
+ <tr>
+ <th><label><input name="selection" type="radio" value="<?php echo esc_attr($structures[3]); ?>" <?php checked($structures[3], $permalink_structure); ?> /> <?php _e('Numeric'); ?></label></th>
+ <td><code><?php echo get_option('home') . $blog_prefix . $prefix . '/' . _x( 'archives', 'sample permalink base' ) . '/123'; ?></code></td>
+ </tr>
+ <tr>
+ <th><label><input name="selection" type="radio" value="<?php echo esc_attr($structures[4]); ?>" <?php checked($structures[4], $permalink_structure); ?> /> <?php _e('Post name'); ?></label></th>
+ <td><code><?php echo get_option('home') . $blog_prefix . $prefix . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/'; ?></code></td>
+ </tr>
+ <tr>
+ <th>
+ <label><input name="selection" id="custom_selection" type="radio" value="custom" <?php checked( !in_array($permalink_structure, $structures) ); ?> />
+ <?php _e('Custom Structure'); ?>
+ </label>
+ </th>
+ <td>
+ <code><?php echo get_option('home') . $blog_prefix; ?></code>
+ <input name="permalink_structure" id="permalink_structure" type="text" value="<?php echo esc_attr($permalink_structure); ?>" class="regular-text code" />
+ </td>
+ </tr>
+</table>
+
+<h2 class="title"><?php _e('Optional'); ?></h2>
+<p><?php
+/* translators: %s is a placeholder that must come at the start of the URL. */
+printf( __( 'If you like, you may enter custom structures for your category and tag URLs here. For example, using <code>topics</code> as your category base would make your category links like <code>%s/topics/uncategorized/</code>. If you leave these blank the defaults will be used.' ), get_option( 'home' ) . $blog_prefix . $prefix ); ?></p>
+
+<table class="form-table">
+ <tr>
+ <th><label for="category_base"><?php /* translators: prefix for category permalinks */ _e('Category base'); ?></label></th>
+ <td><?php echo $blog_prefix; ?> <input name="category_base" id="category_base" type="text" value="<?php echo esc_attr( $category_base ); ?>" class="regular-text code" /></td>
+ </tr>
+ <tr>
+ <th><label for="tag_base"><?php _e('Tag base'); ?></label></th>
+ <td><?php echo $blog_prefix; ?> <input name="tag_base" id="tag_base" type="text" value="<?php echo esc_attr($tag_base); ?>" class="regular-text code" /></td>
+ </tr>
+ <?php do_settings_fields('permalink', 'optional'); ?>
+</table>
+
+<?php do_settings_sections('permalink'); ?>
+
+<?php submit_button(); ?>
+ </form>
+<?php if ( !is_multisite() ) { ?>
+<?php if ( $iis7_permalinks ) :
+ if ( isset($_POST['submit']) && $permalink_structure && ! $usingpi && ! $writable ) :
+ if ( file_exists($home_path . 'web.config') ) : ?>
+<p><?php _e('If your <code>web.config</code> file were <a href="https://codex.wordpress.org/Changing_File_Permissions">writable</a>, we could do this automatically, but it isn’t so this is the url rewrite rule you should have in your <code>web.config</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all. Then insert this rule inside of the <code>/<configuration>/<system.webServer>/<rewrite>/<rules></code> element in <code>web.config</code> file.') ?></p>
+<form action="options-permalink.php" method="post">
+<?php wp_nonce_field('update-permalink') ?>
+ <p><textarea rows="9" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_textarea( $wp_rewrite->iis7_url_rewrite_rules() ); ?></textarea></p>
+</form>
+<p><?php _e('If you temporarily make your <code>web.config</code> file writable for us to generate rewrite rules automatically, do not forget to revert the permissions after rule has been saved.') ?></p>
+ <?php else : ?>
+<p><?php _e('If the root directory of your site were <a href="https://codex.wordpress.org/Changing_File_Permissions">writable</a>, we could do this automatically, but it isn’t so this is the url rewrite rule you should have in your <code>web.config</code> file. Create a new file, called <code>web.config</code> in the root directory of your site. Click in the field and press <kbd>CTRL + a</kbd> to select all. Then insert this code into the <code>web.config</code> file.') ?></p>
+<form action="options-permalink.php" method="post">
+<?php wp_nonce_field('update-permalink') ?>
+ <p><textarea rows="18" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_textarea( $wp_rewrite->iis7_url_rewrite_rules(true) ); ?></textarea></p>
+</form>
+<p><?php _e('If you temporarily make your site’s root directory writable for us to generate the <code>web.config</code> file automatically, do not forget to revert the permissions after the file has been created.') ?></p>
+ <?php endif; ?>
+ <?php endif; ?>
+<?php elseif ( $is_nginx ) : ?>
+ <p><?php _e( '<a href="https://codex.wordpress.org/Nginx">Documentation on Nginx configuration</a>.' ); ?></p>
+<?php else:
+ if ( $permalink_structure && ! $usingpi && ! $writable && $update_required ) : ?>
+<p><?php _e('If your <code>.htaccess</code> file were <a href="https://codex.wordpress.org/Changing_File_Permissions">writable</a>, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your <code>.htaccess</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all.') ?></p>