#39648 closed defect (bug) (invalid)
Wordpress is unable to query post types with hierarchical set to 'true' when there is 'order' registred post type
Reported by: | MateuszP1 | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.7 |
Component: | Posts, Post Types | Keywords: | close |
Focuses: | Cc: |
Description
Problem occurs when you register post type named 'order'
<?php $labels = array( "name" => "Orders", "singular_name" => "Order", ); $args = array( "labels" => $labels, "description" => "", "public" => true, ); register_post_type("order", $args);
it breaks queries of posts types with hierarchical set to true, even 'page' post type.
See:
wp-admin/edit.php?post_type=page
after registering this post type.
Change History (4)
#2
@
8 years ago
- Keywords close added
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed
Hi @MateuszP1, welcome to Trac! Thanks for the ticket.
As noted above, order
is one of the reserved terms and should not be used as a post type key. Try using my-order
or something similar instead.
#3
@
8 years ago
Here's the list of reserved terms btw: https://codex.wordpress.org/Reserved_Terms
Note: See
TracTickets for help on using
tickets.
https://codex.wordpress.org/Reserved_Terms
"order" is a reserved word so post types shoud not rgister with that slug.