[wp-trac] [WordPress Trac] #27671: wp_die() handler for admin-post.php

WordPress Trac noreply at wordpress.org
Sun Feb 19 08:50:33 UTC 2023


#27671: wp_die() handler for admin-post.php
----------------------------------------+------------------------------
 Reporter:  danielbachhuber             |       Owner:  (none)
     Type:  enhancement                 |      Status:  assigned
 Priority:  normal                      |   Milestone:  Awaiting Review
Component:  Administration              |     Version:
 Severity:  normal                      |  Resolution:
 Keywords:  good-first-bug needs-patch  |     Focuses:
----------------------------------------+------------------------------
Changes (by ajfleming):

 * keywords:  good-first-bug has-patch => good-first-bug needs-patch


Comment:

 I edited `wp_die()` to add a condition for `admin-post.php` requests and a
 filter to hook a custom handler. PR [https://github.com/WordPress
 /wordpress-develop/pull/4101 #4101] contains the changes.

 I reused the existing `_default_wp_die_handler` as the filter value
 because it seemed an appropriate default response in this situation. Is
 there a specific response we need in this situation that means we should
 also write a handler?

 We could also argue that a similar outcome could be achieved without this
 change by hooking `_default_wp_die_handler` and identifying the `admin-
 post.php` requests in the callback. Is the use case for this strong enough
 to make this change to WordPress core?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/27671#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list