Changeset 7491 for trunk/wp-includes/taxonomy.php
- Timestamp:
- 03/23/2008 05:02:11 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/taxonomy.php
r7481 r7491 146 146 */ 147 147 function register_taxonomy( $taxonomy, $object_type, $args = array() ) { 148 global $wp_taxonomies ;148 global $wp_taxonomies, $wp_rewrite; 149 149 150 150 $defaults = array('hierarchical' => false, 'update_count_callback' => ''); 151 151 $args = wp_parse_args($args, $defaults); 152 153 if ( !empty( $args['rewrite'] ) ) { 154 if ( !is_array($args['rewrite']) ) 155 $args['rewrite'] = array(); 156 if ( !isset($args['rewrite']['slug']) ) 157 $args['rewrite']['slug'] = sanitize_title_with_dashes($taxonomy); 158 $wp_rewrite->add_rewrite_tag("%$taxonomy%", '([^/]+)', "taxonomy=$taxonomy&term="); 159 $wp_rewrite->add_permastruct("{$args['rewrite']['slug']}/%$taxonomy%"); 160 } 152 161 153 162 $args['name'] = $taxonomy;
Note: See TracChangeset
for help on using the changeset viewer.