WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#17308 closed defect (bug) (fixed)

In order to use a tag_base as-is, category_base needs to be set

Reported by: markjaquith Owned by: markjaquith
Milestone: 3.2 Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords:
Focuses: Cc:

Description

In order to have a tag_base be used without with_front, you have to set category_base, due to what appears to be a copy/paste error:

	register_taxonomy( 'category', 'post', array(
		'hierarchical' => true,
	 	'update_count_callback' => '_update_post_term_count',
		'query_var' => 'category_name',
		'rewrite' => did_action( 'init' ) ? array(
					'hierarchical' => true,
					'slug' => get_option('category_base') ? get_option('category_base') : 'category',
					'with_front' => ( get_option('category_base') && ! $wp_rewrite->using_index_permalinks() ) ? false : true ) : false,
		'public' => true,
		'show_ui' => true,
		'_builtin' => true,
	) );

	register_taxonomy( 'post_tag', 'post', array(
	 	'hierarchical' => false,
		'update_count_callback' => '_update_post_term_count',
		'query_var' => 'tag',
		'rewrite' => did_action( 'init' ) ? array(
					'slug' => get_option('tag_base') ? get_option('tag_base') : 'tag',
					'with_front' => ( get_option('category_base') && ! $wp_rewrite->using_index_permalinks() ) ? false : true ) : false,
		'public' => true,
		'show_ui' => true,
		'_builtin' => true,
	) );

Expected: it goes off the presence of a tag_base for tags.

Change History (1)

comment:1 @markjaquith4 years ago

  • Owner set to markjaquith
  • Resolution set to fixed
  • Status changed from new to closed

In [17789]:

Use the presence of manually set tax_base, not category_base, to determine whether tags use with_front to craft URLs. fixes #17308

Note: See TracTickets for help on using tickets.