[wp-trac] [WordPress Trac] #54327: Support wp_die from array print
WordPress Trac
noreply at wordpress.org
Thu Oct 28 13:52:07 UTC 2021
#54327: Support wp_die from array print
-------------------------------------+------------------------------
Reporter: myousefi08 | Owner: (none)
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 5.8.1
Severity: normal | Resolution:
Keywords: has-patch needs-testing | Focuses:
-------------------------------------+------------------------------
Comment (by SergeyBiryukov):
Hi there, welcome to WordPress Trac! Thanks for the ticket.
I think the patch might have to be a bit more complex than that, to
support all the current `wp_die()` handlers in core:
* `_default_wp_die_handler()`
* `_ajax_wp_die_handler()`
* `_json_wp_die_handler()`
* `_jsonp_wp_die_handler()`
* `_xmlrpc_wp_die_handler()`
* `_xml_wp_die_handler()`
* `_scalar_wp_die_handler()`
I also think we'd want to avoid using `print_r()` as its output is a bit
too technical, and instead update `_wp_die_process_input()` to use the
first item of the array as the main message, and add the rest to
`$args['additional_errors']`, like we already do if `$message` is a
`WP_Error` object, see [source:tags/5.8.1/src/wp-
includes/functions.php?marks=4065-4076,4088#L4063 lines 4076 and 4088].
--
Ticket URL: <https://core.trac.wordpress.org/ticket/54327#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list