[wp-trac] [WordPress Trac] #51748: Allow customization of permission_callback errors

WordPress Trac noreply at wordpress.org
Tue Nov 10 16:37:29 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 plucmtl):

 @TimothyBlynJacobs that's not possible, because `permission_callback`'s
 return must be true, false or a WP_Error. We cannot return something
 custom in that method because it would otherwise mislabel the actual
 authorization outcome - i'm assuming that's where you're suggesting we
 return a manually crafted WP_REST_Response.

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


More information about the wp-trac mailing list