Changeset 1244
- Timestamp:
- 05/09/2004 02:52:27 AM (21 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/options-permalink.php
r1227 r1244 96 96 <input name="permalink_structure" type="text" style="width: 98%;" value="<?php echo $permalink_structure; ?>" /> 97 97 </p> 98 <p><?php _e(' Enter a path without templates for your categories:') ?> FIXME[THIS WORDING MAKES NO SENSE]</p>98 <p><?php _e('If you like, you may enter a custom prefix for your category URIs here. For example, <code>/taxonomy/categorias</code> would make your category links like <code>http://example.org/taxonomy/categorias/general/</code>. If you leave this blank the default will be used.') ?></p> 99 99 <p> 100 100 <input name="category_base" type="text" style="width: 98%;" value="<?php echo $category_base; ?>" /> -
trunk/wp-admin/upgrade-functions.php
r1242 r1244 821 821 // Option for category base 822 822 if(!$wpdb->get_var("SELECT option_id FROM $tableoptions WHERE option_name = 'category_base'")) { 823 $wpdb->query("INSERT INTO $tableoptions (option_name, option_type, option_value, option_admin_level) VALUES ('category_base', 3, ' /category', 8)");823 $wpdb->query("INSERT INTO $tableoptions (option_name, option_type, option_value, option_admin_level) VALUES ('category_base', 3, '', 8)"); 824 824 } 825 825 -
trunk/wp-includes/functions.php
r1239 r1244 332 332 if ('siteurl' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value); 333 333 if ('home' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value); 334 if ('category_base' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value); 334 335 335 336 $all_options->{$option->option_name} = $option->option_value; … … 1279 1280 // Code for nice categories and authors, currently not very flexible 1280 1281 $front = substr($permalink_structure, 0, strpos($permalink_structure, '%')); 1281 $catmatch = get_settings( 'category_base' ) . '/'; 1282 if ( '' == get_settings('category_base') ) 1283 $catmatch = $front . 'category/'; 1284 else 1285 $catmatch = get_settings('category_base') . '/'; 1282 1286 $catmatch = preg_replace('|^/+|', '', $catmatch); 1283 1287 -
trunk/wp-includes/template-functions-category.php
r1235 r1244 25 25 $link = $file.$querystring_start.'cat'.$querystring_equal.$cat_ID; 26 26 } else { 27 $category_nicename = $cache_categories[$category_id]->cat_name; 28 $category_nicename = preg_replace( '|[^a-z0-9-]|i', '', $category_nicename ); 27 $category_nicename = $cache_categories[$category_id]->category_nicename; 29 28 // Get any static stuff from the front 30 29 $front = substr($permalink_structure, 0, strpos($permalink_structure, '%')); 30 if ( '' == get_settings('category_base') ) : 31 $link = get_settings('home') . $front . 'category/'; 32 else : 31 33 $link = get_settings('home') . get_settings('category_base') . '/'; 34 endif; 32 35 if ($parent=$cache_categories[$category_id]->category_parent) $link .= get_category_parents($parent, FALSE, '/', TRUE); 33 36 $link .= $category_nicename . '/';
Note: See TracChangeset
for help on using the changeset viewer.