Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#27577 closed enhancement (wontfix)

Inconsistent hook names in `wp_trash_post()` and `wp_untrash_post()`

Reported by: denis-de-bernardy's profile Denis-de-Bernardy Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.9
Component: Posts, Post Types Keywords:
Focuses: Cc:

Description

In wp_trash_post(), they are:

  • wp_trash_post
  • trashed_post

But in wp_untrash_post(), they are:

  • untrash_post
  • untrashed_post

Change History (3)

#1 @nacin
10 years ago

  • Version changed from 3.8.1 to 2.9

That's because 'trash' is a status and thus wp_transition_post_status() generates a 'trash_post' hook dynamically.

I wouldn't have tiptoed around it with "wp_trash_post" (I would have done all of them a different way that would have allowed for consistency), but these just barely predated my involvement in core.

#2 @Denis-de-Bernardy
10 years ago

It's admittedly very minor, so I mostly wanted to highlight it. Perhaps rename untrash_post or introduce wp_untrash_post? Or should we leave things as is and close?

#3 @wonderboymusic
10 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Let's leave them and close.

Note: See TracTickets for help on using tickets.