Opened 3 months ago
Last modified 3 months ago
#52422 new defect (bug)
Create a draft with the same slug as an existing post, the existing post will be 404.
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | General | Keywords: | needs-patch |
Focuses: | Cc: |
Description
Step-by-step reproduction instructions
- create custom post type. and set
'show_in_rest' => true
<?php function custom_init() { $args = array( 'public' => true, 'label' => 'Books', 'show_in_rest' => true, ); register_post_type( 'book', $args ); } add_action( 'init', 'custom_init' );
- Publish new post of the post type.
- Create draft post of the post type with same slug.
- Go to the published post. but show draft post. if logged out, 404.
Using the block editor, a page can also create drafts with the same slug, which causes the same problem.
Attachments (2)
Change History (5)
#2
@
3 months ago
I've attempted to reproduce this on both 5.6 and trunk without success. I've tried with both a CPT per the original post and standard posts per the follow up comment.
Are either of you able to reproduce this with all plugins disabled and using a default theme such as Twenty Twenty-One?
Note: See
TracTickets for help on using
tickets.
It also happened in default posts.
%postname%
.