Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#27577 closed enhancement (wontfix)

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

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

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
12 years ago

  • Version 3.8.12.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
12 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
12 years ago

  • Milestone Awaiting Review
  • Resolutionwontfix
  • Status newclosed

Let's leave them and close.

Note: See TracTickets for help on using tickets.