WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 9 months ago

#19205 new defect (bug)

Orphaned categories can be created by accident

Reported by: dzver Owned by:
Milestone: Awaiting Review Priority: normal
Severity: minor Version:
Component: Taxonomy Keywords: has-patch
Focuses: Cc:

Description

There are two ways to do that.

  1. You can work on category tree from two browser windows.
  • In window one, delete a category
  • In window two, add a child to the category that has been deleted.

wp_insert_term needs to check if the parent exists.

  1. If you delete a couple of categories with bulk-delete, a third level child node can become orphan.

wp_delete_term uses get_term to find the parent node and can retrieve cached data.

Attachments (1)

19205.diff (625 bytes) - added by dlh 9 months ago.

Download all attachments as: .zip

Change History (3)

dlh9 months ago

comment:2 dlh9 months ago

  • Keywords has-patch added

Diff attempts to address issue (1). After the $args are parsed, checks term_exists() if needed.

Note: See TracTickets for help on using tickets.