#15428 closed defect (bug) (invalid)
wp_die() filter broken, doesn't pass args
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | General | Version: | 3.0.1 |
| Severity: | normal | Keywords: | wp_die |
| Cc: |
Description
There is a filter to manipulate the output of wp_die(), but it is setup incorrectly. When you hook it, the only arg that is passed is the name of the default handler function, which renders the filter useless, as you can't manipulate the message, title, and other display output.
Here's the fix:
wp-includes/functions.php, line 2661
current:
$function = apply_filters( 'wp_die_handler', '_default_wp_die_handler');
fix:
$function = apply_filters( 'wp_die_handler', $message, $title, $args);
Change History (5)
It's an odd way to do it.
I think it should be transformed into an action and have '_default_wp_die_handler' hooked to it.
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed
Nevermind. Not worth the back-compat hassle.
The reason it is a filter and not an action is we only want one thing to be called.
I'm not convinced a filter should be made available to filter the message/title/args of wp_die.
If you want to do that you can just add you own handler.
Your handler can still call the default function.

That wouldn't allow you to modify the title or args.
The point of the filter is to modify the function callback, which will then allow you to have full pluggable control.