WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#13183 closed defect (bug) (fixed)

unused post_types show in search and cannot be deleted

Reported by: thomask Owned by:
Milestone: 3.0 Priority: high
Severity: blocker Version: 3.0
Component: Posts, Post Types Keywords: has-patch dev-feedback
Focuses: Cc:

Description

when you create some posts with custom post_type and then delete the custom post_type definition, the posts are still visible in search (typicaly title+excerpt, but they throw 404 when clicked).

Second problem is, that you cannot delete them (only via e.g. phpmyadmin) - first it is hard to find them, but even when you know the ID a try to direct edit it, it shows "you are not allowed to edit this item", even when I am administrator with all rights.

Attachments (1)

13183.diff (787 bytes) - added by sivel 4 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 sivel4 years ago

  • Severity changed from normal to blocker

comment:2 nacin4 years ago

The issue, we're discussing, is that for both post types and stati, we loop through post types that are registered with exclude_from_search = true, and remove them from search.

Instead, it should start from nothing and add only registered post types where exclude_from_search = false.

sivel4 years ago

comment:3 sivel4 years ago

  • Keywords has-patch dev-feedback added

First pass to *include* the registered post types that are included in search rather than excluding post types that are not included in the search...that really sounds confusing.

comment:4 ryan4 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [14419]) White list instead of black list post types when searching. Props sivel. fixes #13183

Note: See TracTickets for help on using tickets.