WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#32182 closed defect (bug) (invalid)

register_taxonomy 'fields' hides pages in admin

Reported by: shortye Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.2.1
Component: Taxonomy Keywords:
Focuses: Cc:

Description

Registering a custom taxonomy 'fields' hides the pages list in the admin since 4.2.1 update

$labels = array(

	'name' => _x( 'Markets', 'taxonomy general name', 'mytheme'),
	'singular_name' => _x( 'Market', 'taxonomy singular name', 'mytheme' ),
	'search_items' =>  __( 'Search Market', 'mytheme' ),
	'all_items' => __( 'All Markets', 'mytheme' ),
	'parent_item' => __( 'Parent Market', 'mytheme' ),
	'parent_item_colon' => __( 'Parent Market:', 'mytheme' ),
	'edit_item' => __( 'Edit Market', 'mytheme' ),
	'update_item' => __( 'Update Market', 'mytheme' ),
	'add_new_item' => __( 'Add New Market', 'mytheme' ),
	'new_item_name' => __( 'New Market', 'mytheme' ),
	'menu_name' => __( 'Markets', 'mytheme' )

);

register_taxonomy( 'fields', array('partner'), array(

	'hierarchical' => true,
	'labels' => $labels,
	'show_ui' => true,
	'query_var' => true,
	'public' => true,
	'rewrite' => array( 'slug' => 'markets' ),
));

Using any other taxonomy name works fine.
Tested on a clean install of 4.2.1 with twentyfifteen

Change History (3)

#1 follow-up: @SergeyBiryukov
7 years ago

Confirmed. Caused by $query['fields'] = 'id=>parent' in wp_edit_posts_query() (line 1042).

'fields' is one of WP_Query parameters, I guess it should be added to the list of reserved terms.

#2 in reply to: ↑ 1 ; follow-up: @boonebgorges
7 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Replying to SergeyBiryukov:

Confirmed. Caused by $query['fields'] = 'id=>parent' in wp_edit_posts_query() (line 1042).

'fields' is one of WP_Query parameters, I guess it should be added to the list of reserved terms.

Yeah, good find. I've added 'fields' to the list in the Codex. I guess we don't enforce these reserved terms anywhere; maybe that's a good project for the future. shortye - In the meantime, please use a taxonomy name other than 'fields' :)

#3 in reply to: ↑ 2 @SergeyBiryukov
7 years ago

Replying to boonebgorges:

I guess we don't enforce these reserved terms anywhere; maybe that's a good project for the future.

Related: #12929, #18263, #31154.

Note: See TracTickets for help on using tickets.