Changeset 15824
- Timestamp:
- 10/17/2010 04:36:26 AM (13 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/query.php
r15819 r15824 1460 1460 $term = $q[$t->query_var]; 1461 1461 1462 if ( $t-> hierarchical_url) {1462 if ( $t->rewrite['hierarchical'] ) { 1463 1463 $tax_query[] = array_merge( $tax_query_defaults, array( 1464 1464 'terms' => array( basename( $term ) ) -
trunk/wp-includes/taxonomy.php
r15818 r15824 18 18 register_taxonomy( 'category', 'post', array( 19 19 'hierarchical' => true, 20 'hierarchical_url' => true,21 20 'update_count_callback' => '_update_post_term_count', 22 21 'query_var' => 'category_name', … … 287 286 288 287 $defaults = array( 'hierarchical' => false, 289 'hierarchical_url' => false,290 288 'update_count_callback' => '', 291 289 'rewrite' => true, … … 308 306 } 309 307 310 if ( false !== $args['rewrite'] && '' != get_option('permalink_structure') ) {308 if ( false !== $args['rewrite'] && '' != get_option('permalink_structure') && !empty($wp_rewrite) ) { 311 309 $args['rewrite'] = wp_parse_args($args['rewrite'], array( 312 310 'slug' => sanitize_title_with_dashes($taxonomy), 313 311 'with_front' => true, 312 'hierarchical' => false 314 313 )); 315 if ( $args['hierarchical'] && $args['hierarchical_url'] ) 316 $wp_rewrite->add_rewrite_tag("%$taxonomy%", '.*?/?([^/]+)', $args['query_var'] ? "{$args['query_var']}=" : "taxonomy=$taxonomy&term="); 314 315 if ( $args['hierarchical'] && $args['rewrite']['hierarchical'] ) 316 $tag = '(.*?)'; 317 317 else 318 $wp_rewrite->add_rewrite_tag("%$taxonomy%", '([^/]+)', $args['query_var'] ? "{$args['query_var']}=" : "taxonomy=$taxonomy&term="); 318 $tag = '([^/]+)'; 319 320 $wp_rewrite->add_rewrite_tag("%$taxonomy%", $tag, $args['query_var'] ? "{$args['query_var']}=" : "taxonomy=$taxonomy&term="); 319 321 $wp_rewrite->add_permastruct($taxonomy, "{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite']['with_front']); 320 322 } … … 2621 2623 $termlink = home_url($termlink); 2622 2624 } else { 2623 if ( $t-> hierarchical_url) {2625 if ( $t->rewrite['hierarchical'] ) { 2624 2626 $hierarchical_slugs = array(); 2625 2627 $ancestors = get_ancestors($term->term_id, $taxonomy);
Note: See TracChangeset
for help on using the changeset viewer.