[wp-trac] [WordPress Trac] #51748: Allow customization of permission_callback errors
WordPress Trac
noreply at wordpress.org
Tue Nov 10 16:35:30 UTC 2020
#51748: Allow customization of permission_callback errors
-------------------------+------------------------------
Reporter: plucmtl | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version: 4.7
Severity: normal | Resolution:
Keywords: needs-patch | Focuses:
-------------------------+------------------------------
Comment (by TimothyBlynJacobs):
@plucmtl In that case, I'd recommend just returning a `WP_REST_Response`
object instead of a `WP_Error`. Then you can implement your error response
in any way you'd like.
I think it is important that a `WP_Error` object can be successfully
converted back and forth using those two API methods.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/51748#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list