#32182 closed defect (bug) (invalid)
register_taxonomy 'fields' hides pages in admin
| Reported by: | shortye | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Taxonomy | Version: | 4.2.1 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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)
#2
in reply to: ↑ 1
;
follow-up:
↓ 3
@
11 years ago
- Milestone Awaiting Review
- Resolution → invalid
- Status new → closed
Replying to SergeyBiryukov:
Confirmed. Caused by
$query['fields'] = 'id=>parent'inwp_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' :)
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Confirmed. Caused by
$query['fields'] = 'id=>parent'inwp_edit_posts_query()(line 1042).'fields'is one of WP_Query parameters, I guess it should be added to the list of reserved terms.