Make WordPress Core

Changes between Initial Version and Version 2 of Ticket #62604


Ignore:
Timestamp:
11/29/2024 01:22:52 AM (14 months ago)
Author:
dd32
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #62604

    • Property Keywords has-patch added
  • Ticket #62604 – Description

    initial v2  
    11Related: https://github.com/WP-API/docs/issues/194
    22
    3 ```php
     3{{{#!php
    44'type' => 'string',
    55'validate_callback' => function( $should_be_date ) {
    66     return preg_match( '/^\d{4}-\d{2}-\d{2}$/u', $should_be_date );
    77}
    8 ```
     8}}}
    99
    1010Above 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.