diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-10-12 16:21:15 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-10-12 16:21:15 +0000 |
commit | 3a4570b0fc8b3d6339bef71d17d7701554e0bbf7 (patch) | |
tree | 2a06e5261263c68d8afd95a6328879dc289cb909 /wp-admin/options-permalink.php | |
parent | b83c34a7010faee0223f6037025c350da12e05e6 (diff) | |
download | wordpress-mu-3a4570b0fc8b3d6339bef71d17d7701554e0bbf7.tar.gz wordpress-mu-3a4570b0fc8b3d6339bef71d17d7701554e0bbf7.tar.xz wordpress-mu-3a4570b0fc8b3d6339bef71d17d7701554e0bbf7.zip |
Merge with WP 2.3 - testing use only!
Move pluggable functions out of wpmu-functions and into pluggable.php, fixes #439
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1069 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/options-permalink.php')
-rw-r--r-- | wp-admin/options-permalink.php | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/wp-admin/options-permalink.php b/wp-admin/options-permalink.php index 75792db..e4361b1 100644 --- a/wp-admin/options-permalink.php +++ b/wp-admin/options-permalink.php @@ -79,10 +79,21 @@ if ( isset($_POST['permalink_structure']) || isset($_POST['category_base']) ) { } $wp_rewrite->set_category_base($category_base); } + + if ( isset($_POST['tag_base']) ) { + $tag_base = $_POST['tag_base']; + if (! empty($tag_base) ) + $tag_base = preg_replace('#/+#', '/', '/' . $_POST['tag_base']); + if( $tag_base != '' && $current_site->domain.$current_site->path == $current_blog->domain.$current_blog->path ) { + $tag_base = '/blog' . $tag_base; + } + $wp_rewrite->set_tag_base($tag_base); + } } $permalink_structure = get_option('permalink_structure'); $category_base = get_option('category_base'); +$tag_base = get_option( 'tag_base' ); if ( (!file_exists($home_path.'.htaccess') && is_writable($home_path)) || is_writable($home_path.'.htaccess') ) $writable = true; @@ -99,16 +110,16 @@ $wp_rewrite->flush_rules(); <?php if (isset($_POST['submit'])) : ?> <div id="message" class="updated fade"><p><?php -if ($writable) - _e('Permalink structure updated.'); +if ( $permalink_structure && !$usingpi && !$writable ) + _e('You should update your .htaccess now.'); else - _e('You should update your .htaccess now.'); + _e('Permalink structure updated.'); ?></p></div> <?php endif; ?> -<div class="wrap"> - <h2><?php _e('Customize Permalink Structure') ?></h2> -<form name="form" action="options-permalink.php" method="post"> +<div class="wrap"> + <h2><?php _e('Customize Permalink Structure') ?></h2> +<form name="form" action="options-permalink.php" method="post"> <?php wp_nonce_field('update-permalink') ?> <p class="submit"><input type="submit" name="submit" value="<?php _e('Update Permalink Structure »') ?>" /></p> <p><?php _e('By default WordPress uses web <abbr title="Universal Resource Locator">URL</abbr>s which have question marks and lots of numbers in them, however WordPress offers you the ability to create a custom URL structure for your permalinks and archives. This can improve the aesthetics, usability, and forward-compatibility of your links. A <a href="http://codex.wordpress.org/Using_Permalinks">number of tags are available</a>, and here are some examples to get you started.'); ?></p> @@ -153,17 +164,20 @@ checked="checked" <h3><?php _e('Optional'); ?></h3> <?php if ($is_apache) : ?> - <p><?php _e('If you like, you may enter a custom prefix for your category <abbr title="Universal Resource Locator">URL</abbr>s 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> + <p><?php _e('If you like, you may enter custom bases for your category and tag <abbr title="Universal Resource Locator">URL</abbr>s here. For example, using <code>/topics/</code> as your category base would make your category links like <code>http://example.org/topics/uncategorized/</code>. If you leave these blank the defaults will be used.') ?></p> <?php else : ?> - <p><?php _e('If you like, you may enter a custom prefix for your category <abbr title="Universal Resource Locator">URL</abbr>s 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> + <p><?php _e('If you like, you may enter custom bases for your category and tag <abbr title="Universal Resource Locator">URL</abbr>s here. For example, using <code>/topics/</code> as your category base would make your category links like <code>http://example.org/index.php/topics/uncategorized/</code>. If you leave these blank the defaults will be used.') ?></p> <?php endif; ?> - <p> - <?php _e('Category base'); ?>: <?php if( $current_site->domain.$current_site->path == $current_blog->domain.$current_blog->path ) { echo "/blog"; $category_base = str_replace( "/blog", "", $category_base ); }?><input name="category_base" type="text" class="code" value="<?php echo attribute_escape( $category_base ); ?>" size="30" /> - </p> - <p class="submit"> - <input type="submit" name="submit" value="<?php _e('Update Permalink Structure »') ?>" /> - </p> - </form> + <p> + <?php _e('Category base'); ?>: <?php if( $current_site->domain.$current_site->path == $current_blog->domain.$current_blog->path ) { echo "/blog"; $category_base = str_replace( "/blog", "", $category_base ); }?><input name="category_base" type="text" class="code" value="<?php echo attribute_escape( $category_base ); ?>" size="30" /> + </p> + <p> + <?php _e('Tag base'); ?>: <?php if( $current_site->domain.$current_site->path == $current_blog->domain.$current_blog->path ) { echo "/blog"; $tag_base = str_replace( "/blog", "", $tag_base ); }?> <input name="tag_base" id="tag_base" type="text" class="code" value="<?php echo attribute_escape($tag_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> <form action="options-permalink.php" method="post"> |