65 | | if ( isset($_POST['category_base']) ) { |
66 | | $category_base = $_POST['category_base']; |
67 | | if (! empty($category_base) ) |
68 | | $category_base = preg_replace('#/+#', '/', '/' . $_POST['category_base']); |
69 | | $wp_rewrite->set_category_base($category_base); |
| 65 | foreach (array('category_base', 'author_base', 'feed_base', 'comments_base') as $base) { |
| 66 | if ( isset($_POST[$base]) ) { |
| 67 | if (! empty($_POST[$base]) ) |
| 68 | $_POST[$base] = preg_replace('#/+#', '/', '/' . $_POST[$base]); |
| 69 | $set_base_func = 'set_' . $base; |
| 70 | $wp_rewrite->$set_base_func($_POST[$base]); |
| 71 | } |
137 | | <?php if ($is_apache) : ?> |
138 | | <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> |
139 | | <?php else : ?> |
140 | | <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> |
141 | | <?php endif; ?> |
142 | | <p> |
143 | | <?php _e('Category base'); ?>: <input name="category_base" type="text" class="code" value="<?php echo $category_base; ?>" size="30" /> |
144 | | </p> |
145 | | <p class="submit"> |
146 | | <input type="submit" name="submit" value="<?php _e('Update Permalink Structure »') ?>" /> |
| 144 | <p><?php _e('Extra options: these following options govern how your different permalinks for categories, authors, feeds and so on are constructed. For example, changing the category base option to \'/taxonomy/tags\' means that the archives for your categories will be at \'/taxonomy/tags/[category name]\'. The feed base will be appended to permalinks to make feed URLs. The comment base will be appended to permalinks then the feed base appended to that to make comment base URLs. If any of these are left blank the defaults will be used.'); ?></p> |
| 145 | <table width="100%" cellspacing="2" cellpadding="5" class="editform"> |
| 146 | <tr valign="top"> |
| 147 | <th width="33%" scope="row"><?php _e('Category Base:') ?></th> |
| 148 | <td><input name="category_base" type="text" class="code" value="<?php echo $category_base; ?>" size="30" /></td> |
| 149 | </tr> |
| 150 | <tr valign="top"> |
| 151 | <th width="33%" scope="row"><?php _e('Author Base:') ?></th> |
| 152 | <td><input name="author_base" type="text" class="code" value="<?php echo $author_base; ?>" size="30" /></td> |
| 153 | </tr> |
| 154 | <tr valign="top"> |
| 155 | <th width="33%" scope="row"><?php _e('Feed Base:') ?></th> |
| 156 | <td><input name="feed_base" type="text" class="code" value="<?php echo $feed_base; ?>" size="30" /></td> |
| 157 | </tr> |
| 158 | <tr valign="top"> |
| 159 | <th width="33%" scope="row"><?php _e('Comments feed Base:') ?></th> |
| 160 | <td><input name="comments_base" type="text" class="code" value="<?php echo $comments_base; ?>" size="30" /></td> |
| 161 | </tr> |
| 162 | </table> |
| 163 | |
| 164 | <input type="submit" name="submit" value="<?php _e('Update Bases »') ?>" /> |