diff --git a/wp-admin/options-permalink.php b/wp-admin/options-permalink.php index 222fa1fc7..331687156 100644 --- a/wp-admin/options-permalink.php +++ b/wp-admin/options-permalink.php @@ -95,7 +95,7 @@ if ($_POST['submit']) {

-

FIXME[THIS WORDING MAKES NO SENSE]

+

/taxonomy/categorias would make your category links like http://example.org/taxonomy/categorias/general/. If you leave this blank the default will be used.') ?>

diff --git a/wp-admin/upgrade-functions.php b/wp-admin/upgrade-functions.php index bba5c9c0f..f94a7317f 100644 --- a/wp-admin/upgrade-functions.php +++ b/wp-admin/upgrade-functions.php @@ -820,7 +820,7 @@ function upgrade_110() { // Option for category base if(!$wpdb->get_var("SELECT option_id FROM $tableoptions WHERE option_name = 'category_base'")) { - $wpdb->query("INSERT INTO $tableoptions (option_name, option_type, option_value, option_admin_level) VALUES ('category_base', 3, '/category', 8)"); + $wpdb->query("INSERT INTO $tableoptions (option_name, option_type, option_value, option_admin_level) VALUES ('category_base', 3, '', 8)"); } // Delete unused options diff --git a/wp-includes/functions.php b/wp-includes/functions.php index d6a77d706..8196caa08 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -331,6 +331,7 @@ function get_alloptions() { // never underestimate the ingenuity of the fools :)" if ('siteurl' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value); if ('home' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value); + if ('category_base' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value); $all_options->{$option->option_name} = $option->option_value; } @@ -1278,7 +1279,10 @@ function rewrite_rules($matches = '', $permalink_structure = '') { // Code for nice categories and authors, currently not very flexible $front = substr($permalink_structure, 0, strpos($permalink_structure, '%')); - $catmatch = get_settings( 'category_base' ) . '/'; + if ( '' == get_settings('category_base') ) + $catmatch = $front . 'category/'; + else + $catmatch = get_settings('category_base') . '/'; $catmatch = preg_replace('|^/+|', '', $catmatch); $catfeedmatch = $catmatch . '(.*)/' . $feedregex; diff --git a/wp-includes/template-functions-category.php b/wp-includes/template-functions-category.php index ba0d3e5f5..117adfd61 100644 --- a/wp-includes/template-functions-category.php +++ b/wp-includes/template-functions-category.php @@ -24,11 +24,14 @@ function get_category_link($echo = false, $category_id, $category_nicename) { $file = get_settings('home') . '/' . get_settings('blogfilename'); $link = $file.$querystring_start.'cat'.$querystring_equal.$cat_ID; } else { - $category_nicename = $cache_categories[$category_id]->cat_name; - $category_nicename = preg_replace( '|[^a-z0-9-]|i', '', $category_nicename ); + $category_nicename = $cache_categories[$category_id]->category_nicename; // Get any static stuff from the front $front = substr($permalink_structure, 0, strpos($permalink_structure, '%')); + if ( '' == get_settings('category_base') ) : + $link = get_settings('home') . $front . 'category/'; + else : $link = get_settings('home') . get_settings('category_base') . '/'; + endif; if ($parent=$cache_categories[$category_id]->category_parent) $link .= get_category_parents($parent, FALSE, '/', TRUE); $link .= $category_nicename . '/'; }