[wp-trac] [WordPress Trac] #38339: Add unregister_rest_route helper

WordPress Trac noreply at wordpress.org
Thu Oct 20 10:39:25 UTC 2016


#38339: Add unregister_rest_route helper
-------------------------+-----------------------
 Reporter:  rmccue       |       Owner:  rmccue
     Type:  enhancement  |      Status:  assigned
 Priority:  normal       |   Milestone:  4.7
Component:  REST API     |     Version:  4.4
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+-----------------------

Comment (by flixos90):

 I don't like the idea of adding this function too much, since I feel like
 it would encourage developers to unregister endpoints they don't need.
 This can easily lead to issues with both Core and plugins which might rely
 on these endpoints. It's easy to check for a plugin whether the entire
 REST API has been disabled, but doing these checks for individual
 endpoints would be a pain.

 Since it is already possible to remove endpoints for those who absolutely
 want to do it (just a bit more complicated), I think we're fine like that
 for the above reasons (it's not ''that'' obvious). Yet, for the endpoints
 introduced by Core itself, I think these shouldn't be removed ever. I
 would rather vote for a similar behavior like we do it with the Core post
 types and taxonomies, pass something like a `_builtin` argument to them,
 thus preventing deletion.

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


More information about the wp-trac mailing list