WordPress.org

Make WordPress Core

Opened 16 months ago

Closed 10 months ago

Last modified 6 months ago

#48061 closed enhancement (fixed)

Do an action when a 404 is triggered

Reported by: johnbillion Owned by: johnbillion
Milestone: 5.5 Priority: normal
Severity: normal Version:
Component: Query Keywords: has-patch has-dev-note
Focuses: Cc:

Description

For debugging purposes it would be great to be able to determine what triggered a 404.

If a plugin manually calls $wp_query->set_404() it can cause much head scratching. If an action was fired within this method, it would allow debugging plugins to inspect the stack trace and determine what triggered it.

Attachments (1)

48061.diff (523 bytes) - added by johnbillion 16 months ago.

Download all attachments as: .zip

Change History (6)

@johnbillion
16 months ago

#1 @johnbillion
16 months ago

  • Keywords has-patch added; needs-patch removed

#2 @johnbillion
11 months ago

  • Milestone changed from Awaiting Review to 5.5
  • Owner set to johnbillion
  • Status changed from new to accepted

#3 @johnbillion
10 months ago

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

In 47509:

Query: Introduce an action which gets fired when a 404 is triggered.

Fixes #48061

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


9 months ago

#5 @desrosj
6 months ago

  • Keywords has-dev-note added

This received a call out in the Miscellaneous Developer Changes in 5.5 dev note: https://make.wordpress.org/core/2020/07/29/miscellaneous-developer-focused-changes-in-wordpress-5-5/.

Note: See TracTickets for help on using tickets.