Opened 7 years ago
Last modified 20 months ago
#27671 assigned enhancement
wp_die() handler for admin-post.php
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Administration | Keywords: | good-first-bug has-patch needs-testing |
Focuses: | Cc: |
Description
Similar to how admin-ajax.php
has _ajax_wp_die_handler
, it would be nice if admin-post.php
had a custom wp_die()
handler for errors.
Attachments (1)
Change History (8)
#3
@
6 years ago
I looked in admin-ajax.php
but couldn't find any handlers. The only place I found _ajax_wp_die_handler
was in class-wp-customize-manager.php
.
#5
@
6 years ago
I was taking a look at this ticket and found out that the _ajax_wp_die_handler
has moved to wp-includes/functions.php
.
#7
@
20 months ago
Following the basic tutorial on https://codex.wordpress.org/Plugin_API/Action_Reference/admin_post_(action) and replacing the die()
in the example with wp_die()
, the wp_die()
function triggers _ajax_wp_die_handler
located in wp-includes/functions.php
.
I'm new in contributing to WP Core but from my perspective, it would not be necessary to extend admin_post.php
. If we were to, we'd at least need to avoid redeclaring _ajax_wp_die_handler()
.
This was done specifically so our AJAX methods would become testable. What would be the benefit to admin-post.php? Same?