WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#19637 closed defect (bug) (fixed)

Update hierarchy when deleting hierarchical CPT

Reported by: duck_ Owned by: duck_
Milestone: 3.4 Priority: normal
Severity: normal Version: 3.0
Component: General Keywords: has-patch
Focuses: Cc:

Description

When deleting a CPT post which is hierarchical its children don't have their post_parent properties updated. This updating code should be split out of the page specific branches into an is_post_type_hierarchical() check.

Noticed when patching #19636.

Attachments (1)

19637.diff (1.9 KB) - added by duck_ 4 years ago.

Download all attachments as: .zip

Change History (4)

@duck_4 years ago

comment:1 @duck_4 years ago

Patch switches to clean_post_cache() from clean_page_cache() for is_post_type_hierarchical() children. This is because the page clean function does some page specific stuff that doesn't need to occur for each child or for non-page content types, and clean_post_cache() does the recursive cleaning normally anyway.

comment:2 @scribu4 years ago

  • Cc scribu added

comment:3 @duck_4 years ago

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

In [19734]:

Update hierarchy for all hierarchical post types when deleting a parent post, not just for pages. Fixes #19637.

Note: See TracTickets for help on using tickets.