[wp-trac] [WordPress Trac] #50075: Trigger _doing_it_wrong for dangerous REST API endpoint option

WordPress Trac noreply at wordpress.org
Tue Jul 21 02:15:40 UTC 2020


#50075: Trigger _doing_it_wrong for dangerous REST API endpoint option
--------------------------------------+---------------------
 Reporter:  rmccue                    |       Owner:  (none)
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  5.5
Component:  REST API                  |     Version:  4.4
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+---------------------

Comment (by TimothyBlynJacobs):

 Thanks for taking a look @whyisjake! I've added a patch implementing this.
 The error message renders like so:

 {{{
 The REST API route definition for <code>my-ns/my-route</code> is missing
 the required <code>permission_callback</code> argument. For REST API
 routes that are intended to be public, use <code>__return_true</code> as
 the permission callback.
 }}}

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


More information about the wp-trac mailing list