WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#34626 closed enhancement (fixed)

Delete term meta when deleting a term

Reported by: barryceelen Owned by: boonebgorges
Milestone: 4.4 Priority: normal
Severity: normal Version: 4.4
Component: Taxonomy Keywords: has-patch
Focuses: Cc:

Description


Attachments (2)

34626.patch (2.8 KB) - added by barryceelen 5 years ago.
34626.1.patch (4.9 KB) - added by barryceelen 5 years ago.
Fixes incorrect comment on delete_metadata_by_mid(), adds term meta code comment love to other meta functions

Download all attachments as: .zip

Change History (10)

@barryceelen
5 years ago

#1 @barryceelen
5 years ago

  • Keywords has-patch added

#2 @barryceelen
5 years ago

When deleting a post or user its meta values are deleted as well. The patch adds the same behaviour when deleting a term via wp_delete_term().

#3 @boonebgorges
5 years ago

  • Milestone changed from Awaiting Review to 4.4
  • Owner set to boonebgorges
  • Status changed from new to assigned

Welcome to Trac, and thanks very much for the patch, @barryceelen ! Let's get this into 4.4.

#4 @boonebgorges
5 years ago

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

In 35585:

When deleting a term, delete its metadata as well.

Props barryceelen.
Fixes #34626.

#5 @swissspidy
5 years ago

"Type of object metadata is for (e.g., comment, post, meta, or user)."

Meta is wrong, it should be term.

@barryceelen
5 years ago

Fixes incorrect comment on delete_metadata_by_mid(), adds term meta code comment love to other meta functions

#6 @boonebgorges
5 years ago

Groan. Thanks, @swissspidy.

@barryceelen Thanks for the patch. To reduce churn, I'm going to leave these docblocks untouched. The description reads "e.g.", which means "for example". We don't need for the list to be comprehensive, and in fact, it can't be comprehensive since plugins can use these functions for custom metadata.

#7 @boonebgorges
5 years ago

In 35588:

Fix documentation typo introduced in [35585].

Props swissspidy, barryceelen.
See #34626.

#8 @barryceelen
5 years ago

@boonebgorges Sounds good + thanks for accepting my first patch!

Note: See TracTickets for help on using tickets.