[wp-trac] [WordPress Trac] #51255: REST API: Support request level validation

WordPress Trac noreply at wordpress.org
Sat Sep 5 16:51:00 UTC 2020


#51255: REST API: Support request level validation
-------------------------------+--------------------
 Reporter:  TimothyBlynJacobs  |      Owner:  (none)
     Type:  enhancement        |     Status:  new
 Priority:  normal             |  Milestone:  5.6
Component:  REST API           |    Version:  4.4
 Severity:  normal             |   Keywords:
  Focuses:                     |
-------------------------------+--------------------
 Splitting this off from #50244.

 We could also support a validate_callback in the register_rest_route on
 the same level as callback and permission_callback that would take a
 WP_REST_Request object and do validation for it. This would be helpful for
 cases where validation has to be done with all the fields together as
 context, not just individual field validation. We'd do the parameter
 validation first, and then call validate_callback on the whole request.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51255>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list