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

WordPress Trac noreply at wordpress.org
Fri Nov 4 23:17:17 UTC 2016


#38531: Support for arrays in schema validation and sanitization
-------------------------+--------------------------
 Reporter:  joehoyle     |       Owner:  rachelbaker
     Type:  enhancement  |      Status:  assigned
 Priority:  normal       |   Milestone:  4.7
Component:  REST API     |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  2nd-opinion  |     Focuses:
-------------------------+--------------------------

Comment (by tharsheblows):

 If you want to use `rest_validate_value_from_schema` for meta values,
 empty values need to be ok as they're included in the response.

 Attached is that change with meta using `rest_validate_value_from_schema`
 and `rest_sanitize_value_from_schema` and allowing arrays, including
 multiple meta keys with `type='array'`. The allowed types are whitelisted
 in `WP_REST_Meta_Fields` so it fixes this too https://github.com/WP-API
 /WP-API/issues/2798

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


More information about the wp-trac mailing list