Changes between Initial Version and Version 2 of Ticket #62604
- Timestamp:
- 11/29/2024 01:22:52 AM (14 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #62604
- Property Keywords has-patch added
-
Ticket #62604 – Description
initial v2 1 1 Related: https://github.com/WP-API/docs/issues/194 2 2 3 ```php3 {{{#!php 4 4 'type' => 'string', 5 5 'validate_callback' => function( $should_be_date ) { 6 6 return preg_match( '/^\d{4}-\d{2}-\d{2}$/u', $should_be_date ); 7 7 } 8 ``` 8 }}} 9 9 10 10 Above validation expects the parameter should be 'YYYY-MM-DD' format, but actually any string as "valid" because `preg_match()` returns 0(falsy value) for mismatch.