Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #55942, comment 58


Ignore:
Timestamp:
04/30/2023 07:33:56 PM (3 years ago)
Author:
azaozz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #55942, comment 58

    initial v1  
    22> 'number' should be treated as union type int|float (PHP 8.0) and pass the `is_numeric()` test.
    33
    4 The problem here is how to match PHP data types to REST data types (as implemented in WP). Seems REST's `number` should match PHP's `float`. So when retrieving registered meta of type `number`, it will have to do `get_metadata( $meta_type, $object_id, $meta_key, $single, 'float' );`
     4The problem here is how to match PHP data types to REST data types (as implemented in WP). Seems REST's `number` should match PHP's `float`. So when retrieving registered meta of type `number`, it will have to do `get_metadata( $meta_type, $object_id, $meta_key, $single, 'float' );` at the lower level.
    55
    66(It's a bit confusing that the REST data types (as used in WP) seem to come from JSON data types, however JSON doesn't have `integer` type according to [https://www.rfc-editor.org/rfc/rfc8259.html#section-1 RFC 8259].)