<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[15824] trunk/wp-includes: Move hierarchical_url to $args['rewrite']['
hierarchical']</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/15824">15824</a></dd>
<dt>Author</dt> <dd>dd32</dd>
<dt>Date</dt> <dd>2010-10-17 04:36:26 +0000 (Sun, 17 Oct 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Move hierarchical_url to $args['rewrite']['hierarchical']</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludesqueryphp">trunk/wp-includes/query.php</a></li>
<li><a href="#trunkwpincludestaxonomyphp">trunk/wp-includes/taxonomy.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludesqueryphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/query.php (15823 => 15824)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/query.php        2010-10-16 23:50:09 UTC (rev 15823)
+++ trunk/wp-includes/query.php        2010-10-17 04:36:26 UTC (rev 15824)
</span><span class="lines">@@ -1459,7 +1459,7 @@
</span><span class="cx">
</span><span class="cx">                                 $term = $q[$t->query_var];
</span><span class="cx">
</span><del>-                                if ( $t->hierarchical_url ) {
</del><ins>+                                if ( $t->rewrite['hierarchical'] ) {
</ins><span class="cx">                                         $tax_query[] = array_merge( $tax_query_defaults, array(
</span><span class="cx">                                                 'terms' => array( basename( $term ) )
</span><span class="cx">                                         ) );
</span></span></pre></div>
<a id="trunkwpincludestaxonomyphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/taxonomy.php (15823 => 15824)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/taxonomy.php        2010-10-16 23:50:09 UTC (rev 15823)
+++ trunk/wp-includes/taxonomy.php        2010-10-17 04:36:26 UTC (rev 15824)
</span><span class="lines">@@ -17,7 +17,6 @@
</span><span class="cx"> function create_initial_taxonomies() {
</span><span class="cx">         register_taxonomy( 'category', 'post', array(
</span><span class="cx">                 'hierarchical' => true,
</span><del>-                'hierarchical_url' => true,
</del><span class="cx">                  'update_count_callback' => '_update_post_term_count',
</span><span class="cx">                 'query_var' => 'category_name',
</span><span class="cx">                 'rewrite' => false,
</span><span class="lines">@@ -286,7 +285,6 @@
</span><span class="cx">                 $wp_taxonomies = array();
</span><span class="cx">
</span><span class="cx">         $defaults = array(        'hierarchical' => false,
</span><del>-                                                 'hierarchical_url' => false,
</del><span class="cx">                                                 'update_count_callback' => '',
</span><span class="cx">                                                 'rewrite' => true,
</span><span class="cx">                                                 'query_var' => $taxonomy,
</span><span class="lines">@@ -307,15 +305,19 @@
</span><span class="cx">                 $wp->add_query_var($args['query_var']);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if ( false !== $args['rewrite'] && '' != get_option('permalink_structure') ) {
</del><ins>+        if ( false !== $args['rewrite'] && '' != get_option('permalink_structure') && !empty($wp_rewrite) ) {
</ins><span class="cx">                 $args['rewrite'] = wp_parse_args($args['rewrite'], array(
</span><span class="cx">                         'slug' => sanitize_title_with_dashes($taxonomy),
</span><span class="cx">                         'with_front' => true,
</span><ins>+                        'hierarchical' => false
</ins><span class="cx">                 ));
</span><del>-                if ( $args['hierarchical'] && $args['hierarchical_url'] )
-                        $wp_rewrite->add_rewrite_tag("%$taxonomy%", '.*?/?([^/]+)', $args['query_var'] ? "{$args['query_var']}=" : "taxonomy=$taxonomy&term=");
</del><ins>+
+                if ( $args['hierarchical'] && $args['rewrite']['hierarchical'] )
+                        $tag = '(.*?)';
</ins><span class="cx">                 else
</span><del>-                        $wp_rewrite->add_rewrite_tag("%$taxonomy%", '([^/]+)', $args['query_var'] ? "{$args['query_var']}=" : "taxonomy=$taxonomy&term=");
</del><ins>+                        $tag = '([^/]+)';
+
+                $wp_rewrite->add_rewrite_tag("%$taxonomy%", $tag, $args['query_var'] ? "{$args['query_var']}=" : "taxonomy=$taxonomy&term=");
</ins><span class="cx">                 $wp_rewrite->add_permastruct($taxonomy, "{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite']['with_front']);
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -2620,7 +2622,7 @@
</span><span class="cx">                         $termlink = "?taxonomy=$taxonomy&term=$slug";
</span><span class="cx">                 $termlink = home_url($termlink);
</span><span class="cx">         } else {
</span><del>-                if ( $t->hierarchical_url ) {
</del><ins>+                if ( $t->rewrite['hierarchical'] ) {
</ins><span class="cx">                         $hierarchical_slugs = array();
</span><span class="cx">                         $ancestors = get_ancestors($term->term_id, $taxonomy);
</span><span class="cx">                         foreach ( (array)$ancestors as $ancestor ) {
</span></span></pre>
</div>
</div>
</body>
</html>