[wp-trac] [WordPress Trac] #50075: Trigger _doing_it_wrong for dangerous REST API endpoint option
WordPress Trac
noreply at wordpress.org
Mon May 4 16:57:20 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: needs-patch | Focuses:
--------------------------+---------------------
Comment (by rmccue):
Replying to [comment:1 TimothyBlynJacobs]:
> One of the things we discussed is whether we should allow
`permission_callback => true` as a shortcut for `__return_true`.
IMO no, as that's a potential footgun too; if you accidentally cast to
true or something crazy. I think it also complicates the API surface for
no real gain, given `__return_true` already exists.
Note that I'm only suggesting the misspelling here, not the lack of
`permission_callback`; while that would be OK, it's a bit of an API
breakage, and would cause a lot of warnings.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50075#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list