[wp-trac] [WordPress Trac] #38446: Deprecate the rest_enabled filter

WordPress Trac noreply at wordpress.org
Wed Feb 1 21:03:17 UTC 2017


#38446: Deprecate the rest_enabled filter
-------------------------------------------------+-------------------------
 Reporter:  pento                                |       Owner:  pento
     Type:  task (blessed)                       |      Status:  closed
 Priority:  normal                               |   Milestone:  4.7
Component:  REST API                             |     Version:  4.7
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  needs-docs needs-dev-note commit     |     Focuses:
  has-unit-tests has-patch                       |
-------------------------------------------------+-------------------------

Comment (by jnylen0):

 Noting that `rest_request_before_callbacks` ([https://github.com/WordPress
 /wordpress-develop/blob/4.7.2/src/wp-includes/rest-api/class-wp-rest-
 server.php#L876-L892 ref]) is probably a better filter to use than
 `rest_authentication_errors`, because it gets access to the `$request`
 object.

 This makes it really easy to only restrict, for example, the built-in
 `wp/v2` endpoints by checking the beginning of `$request->get_route()`.

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


More information about the wp-trac mailing list