Make WordPress Core

Ticket #51131: 51131.1.diff

File 51131.1.diff, 1.1 KB (added by stoyangeorgiev, 4 years ago)

Changed param type and schema type

  • wp-includes/rest-api/endpoints/class-wp-rest-search-controller.php

     
    140140                        );
    141141                }
    142142
    143                 $ids = array_map( 'absint', $result[ WP_REST_Search_Handler::RESULT_IDS ] );
     143                $ids = $result[ WP_REST_Search_Handler::RESULT_IDS ];
    144144
    145145                $results = array();
    146146
     
    186186         *
    187187         * @since 5.0.0
    188188         *
    189          * @param int             $id      ID of the item to prepare.
     189         * @param int|string $id ID of the item to prepare.
    190190         * @param WP_REST_Request $request Request object.
    191191         * @return WP_REST_Response Response object.
    192192         */
     
    245245                        'properties' => array(
    246246                                self::PROP_ID      => array(
    247247                                        'description' => __( 'Unique identifier for the object.' ),
    248                                         'type'        => 'integer',
     248                                        'type'        => array( 'integer', 'string' ),
    249249                                        'context'     => array( 'view', 'embed' ),
    250250                                        'readonly'    => true,
    251251                                ),