diff --git wp-includes/query.php wp-includes/query.php
index f47a860a..e04682d 100644
|
|
|
class WP_Query { |
| 1699 | 1699 | } |
| 1700 | 1700 | |
| 1701 | 1701 | foreach ( $GLOBALS['wp_taxonomies'] as $taxonomy => $t ) { |
| 1702 | | if ( 'post_tag' == $taxonomy ) |
| 1703 | | continue; // Handled further down in the $q['tag'] block |
| 1704 | | |
| 1705 | | if ( $t->query_var && !empty( $q[$t->query_var] ) ) { |
| | 1702 | if ( $t->query_var_id && !empty( $q[$t->query_var_id] ) ) { |
| | 1703 | $q[$t->query_var_id] = absint( $q[$t->query_var_id] ); |
| | 1704 | $tax_query[] = array( |
| | 1705 | 'taxonomy' => $taxonomy, |
| | 1706 | 'terms' => $q[$t->query_var_id] |
| | 1707 | ); |
| | 1708 | } |
| | 1709 | elseif ( 'post_tag' != $taxonomy && $t->query_var && !empty( $q[$t->query_var] ) ) { |
| 1706 | 1710 | $tax_query_defaults = array( |
| 1707 | 1711 | 'taxonomy' => $taxonomy, |
| 1708 | 1712 | 'field' => 'slug', |
| … |
… |
class WP_Query { |
| 1803 | 1807 | } |
| 1804 | 1808 | } |
| 1805 | 1809 | |
| 1806 | | if ( !empty($q['tag_id']) ) { |
| 1807 | | $q['tag_id'] = absint( $q['tag_id'] ); |
| 1808 | | $tax_query[] = array( |
| 1809 | | 'taxonomy' => 'post_tag', |
| 1810 | | 'terms' => $q['tag_id'] |
| 1811 | | ); |
| 1812 | | } |
| 1813 | | |
| 1814 | 1810 | if ( !empty($q['tag__in']) ) { |
| 1815 | 1811 | $q['tag__in'] = array_map('absint', array_unique( (array) $q['tag__in'] ) ); |
| 1816 | 1812 | $tax_query[] = array( |
diff --git wp-includes/taxonomy.php wp-includes/taxonomy.php
index e231a6c..fc0ad9b 100644
|
|
|
function create_initial_taxonomies() { |
| 34 | 34 | 'hierarchical' => false, |
| 35 | 35 | 'update_count_callback' => '_update_post_term_count', |
| 36 | 36 | 'query_var' => 'tag', |
| | 37 | 'query_var_id' => 'tag_id', |
| 37 | 38 | 'rewrite' => did_action( 'init' ) ? array( |
| 38 | 39 | 'slug' => get_option('tag_base') ? get_option('tag_base') : 'tag', |
| 39 | 40 | 'with_front' => ( get_option('tag_base') && ! $wp_rewrite->using_index_permalinks() ) ? false : true ) : false, |
| … |
… |
function is_taxonomy_hierarchical($taxonomy) { |
| 266 | 267 | * query_var - false to prevent queries, or string to customize query var |
| 267 | 268 | * (?$query_var=$term); default will use $taxonomy as query var. |
| 268 | 269 | * |
| | 270 | * query_var_id - string used to query terms by id, instead of by slug. |
| | 271 | * |
| 269 | 272 | * public - If the taxonomy should be publicly queryable; //@TODO not implemented. |
| 270 | 273 | * defaults to true. |
| 271 | 274 | * |
| … |
… |
function register_taxonomy( $taxonomy, $object_type, $args = array() ) { |
| 301 | 304 | 'update_count_callback' => '', |
| 302 | 305 | 'rewrite' => true, |
| 303 | 306 | 'query_var' => $taxonomy, |
| | 307 | 'query_var_id' => false, |
| 304 | 308 | 'public' => true, |
| 305 | 309 | 'show_ui' => null, |
| 306 | 310 | 'show_tagcloud' => null, |
| … |
… |
function register_taxonomy( $taxonomy, $object_type, $args = array() ) { |
| 318 | 322 | $wp->add_query_var($args['query_var']); |
| 319 | 323 | } |
| 320 | 324 | |
| | 325 | if ( false !== $args['query_var_id'] && !empty($wp) ) { |
| | 326 | $args['query_var_id'] = sanitize_title_with_dashes($args['query_var_id']); |
| | 327 | $wp->add_query_var($args['query_var_id']); |
| | 328 | } |
| | 329 | |
| 321 | 330 | if ( false !== $args['rewrite'] && '' != get_option('permalink_structure') ) { |
| 322 | 331 | $args['rewrite'] = wp_parse_args($args['rewrite'], array( |
| 323 | 332 | 'slug' => sanitize_title_with_dashes($taxonomy), |