WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#40181 closed defect (bug) (invalid)

Custom Post Type with post type = 'post_type'

Reported by: displaynone Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.7.3
Component: Posts, Post Types Keywords:
Focuses: administration Cc:

Description

When I create a CPT this way:

<?php
register_post_type( 'post_type', $args );

No posts, CPTs, ... are shown, but the posts count is correct

Change History (2)

#1 @swissspidy
3 years ago

There's a long list of reserved terms in WordPress core, which can be found here: https://codex.wordpress.org/Reserved_Terms

There's a ticket for preventing post types with such names from being registered as well, see #31154.

#2 @SergeyBiryukov
3 years ago

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

Hi @displaynone, welcome to WordPress Trac! Thanks for the report.

As noted above, post_type is one of the reserved terms that cannot be used as an actual post type name.

Note: See TracTickets for help on using tickets.