Merge Category/Tag URL creation/rewriting into general Taxonomy system. Removes the legacy handling for these url's. See #12659

git-svn-id: https://develop.svn.wordpress.org/trunk@15825 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse
2010-10-17 05:41:22 +00:00
parent a47b78e95b
commit d7b230ca26
5 changed files with 47 additions and 145 deletions

View File

@@ -1457,13 +1457,15 @@ class WP_Query extends WP_Object_Query {
'operator' => 'IN'
);
if ( $t->rewrite['hierarchical'] ) {
$q[$t->query_var] = basename($q[$t->query_var]);
if ( $taxonomy == $q['taxonomy'] )
$q['term'] = basename($q['term']);
}
$term = $q[$t->query_var];
if ( $t->rewrite['hierarchical'] ) {
$tax_query[] = array_merge( $tax_query_defaults, array(
'terms' => array( basename( $term ) )
) );
} elseif ( strpos($term, '+') !== false ) {
if ( strpos($term, '+') !== false ) {
$terms = preg_split( '/[+\s]+/', $term );
foreach ( $terms as $term ) {
$tax_query[] = array_merge( $tax_query_defaults, array(