#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: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Posts, Post Types | Version: | 4.7 |
| Severity: | normal | Keywords: | close |
| Cc: | Focuses: |
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
@
10 years ago
- Keywords close added
- Milestone Awaiting Review
- Resolution → invalid
- Status new → 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
@
10 years ago
Here's the list of reserved terms btw: https://codex.wordpress.org/Reserved_Terms
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
https://codex.wordpress.org/Reserved_Terms
"order" is a reserved word so post types shoud not rgister with that slug.