[wp-trac] [WordPress Trac] #38583: Support for objects in schema validation and sanitization

WordPress Trac noreply at wordpress.org
Sat Aug 26 23:18:56 UTC 2017


#38583: Support for objects in schema validation and sanitization
-------------------------------------------------+-------------------------
 Reporter:  rachelbaker                          |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Future
Component:  REST API                             |  Release
 Severity:  normal                               |     Version:
 Keywords:  has-patch has-unit-tests dev-        |  Resolution:
  feedback                                       |     Focuses:
-------------------------------------------------+-------------------------
Changes (by TimothyBlynJacobs):

 * keywords:  needs-patch => has-patch has-unit-tests dev-feedback


Comment:

 I've added two separate versions.

 1) Simply adds object validation. For the properties like `content` or
 `title` which can accept either a structured object or a string, the
 `validation_callback` is set to `null` ( matching sanitization ).

 2) Adds object validation and adds support for multiple `type` options. So
 `content` for instance becomes `type => [ 'object', 'string']`.

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


More information about the wp-trac mailing list