Make WordPress Core

Opened 3 months ago

Closed 5 weeks ago

Last modified 5 weeks ago

#60433 closed enhancement (fixed)

Adding delete_post_{$post->post_type} action hook

Reported by: gerardreches's profile gerardreches Owned by: swissspidy's profile swissspidy
Milestone: 6.6 Priority: normal
Severity: minor Version:
Component: Posts, Post Types Keywords: has-patch
Focuses: Cc:

Description

Is there any reason not to add a delete_post_{$post->post_type} action hook to the core? We have it for save and edit, so why not for delete as well.

Change History (10)

#1 @gerardreches
3 months ago

  • Summary changed from Adding delete_post_{$post->post_type} to Adding delete_post_{$post->post_type} action hook

This ticket was mentioned in PR #6036 on WordPress/wordpress-develop by @benniledl.


2 months ago
#2

  • Keywords has-patch added

added delete_post_{->post_type} and deleted_post_{- >post_type} hook

Trac ticket: https://core.trac.wordpress.org/ticket/60433

@Dargus commented on PR #6036:


2 months ago
#3

@at-benni That would be it 😄

#4 @gerardreches
2 months ago

Could we merge the patch provided by @benniledl , please?

This ticket was mentioned in Slack in #core by gerardreches. View the logs.


5 weeks ago

#6 @swissspidy
5 weeks ago

  • Milestone changed from Awaiting Review to 6.6

Moving to 6.6 for consideration. Patch needs a little updating.

#7 @gerardreches
5 weeks ago

Thank you @swissspidy . Hopefully we can see it implemented by then 😄

#8 @swissspidy
5 weeks ago

  • Owner set to swissspidy
  • Status changed from new to reviewing

#9 @swissspidy
5 weeks ago

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

In 57853:

Posts, Post Types: Introduce delete_post_{$post->post_type} and deleted_post_{$post->post_type} hooks.

The hooks fire before the general delete_post / deleted_post hooks and have the same parameters.

They complement the save_post_{$post->post_type} hook added in [25050] and the edit_post_{$post->post_type} hook added in [43617].

Props benniledl, swissspidy, dargus.
Fixes #60433.

Note: See TracTickets for help on using tickets.