Changes between Version 6 and Version 7 of Ticket #59841, comment 2
- Timestamp:
- 11/08/2023 05:41:41 PM (13 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #59841, comment 2
v6 v7 6 6 7 7 To be clear this happens on WP 6.3, when you directly call the function, but I noticed that `class-wp-rest-template-revisions-controller.php` was newly added on 6.4. In that class, `get_registered_fields()` is called now, which calls `rest_default_additional_properties_to_false()`. I wasn't sure if ya'll wanted to do any additional handling for unexpected formatted schemas? 8 9 {{{ 10 register_post_meta( 11 'example_post_type', 12 'example_meta_key', 13 array( 14 'type' => 'array', 15 'description' => 'Array of strings', 16 'sanitize_callback' => function ( $urls ) { 17 return array_map( fn( $url ) => sanitize_text_field( $url ), $urls ); 18 }, 19 'show_in_rest' => array( 20 'schema' => array( 21 'type' => 'array', 22 'items' => 'string', 23 ), 24 ), 25 ) 26 ); 27 }}}