[wp-trac] [WordPress Trac] #34305: Protect the `wp/v[0-9]*` namespace

WordPress Trac noreply at wordpress.org
Tue Oct 20 00:06:15 UTC 2015


#34305: Protect the `wp/v[0-9]*` namespace
--------------------------------------+------------------
 Reporter:  rachelbaker               |       Owner:
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  4.4
Component:  REST API                  |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  dev-feedback needs-patch  |     Focuses:
--------------------------------------+------------------

Comment (by rmccue):

 We [https://wordpress.slack.com/archives/core-restapi/p1445297153000115
 discussed this in Slack]. Our current thoughts are along the lines of: add
 a `_builtin => true` to our routes, and disallow (via `_doing_it_wrong`)
 registering routes under `wp/v*` without the flag.

 Not entirely happy with the approach though. It doesn't solve the
 copypasta issue (if you copy-paste `wp/v2`, you'll probably copy-paste the
 `_builtin` bit too).

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


More information about the wp-trac mailing list