rest_find_any_matching_schema example


function rest_validate_value_from_schema( $value$args$param = '' ) {
    if ( isset( $args['anyOf'] ) ) {
        $matching_schema = rest_find_any_matching_schema( $value$args$param );
        if ( is_wp_error( $matching_schema ) ) {
            return $matching_schema;
        }

        if ( ! isset( $args['type'] ) && isset( $matching_schema['type'] ) ) {
            $args['type'] = $matching_schema['type'];
        }
    }

    if ( isset( $args['oneOf'] ) ) {
        $matching_schema = rest_find_one_matching_schema( $value$args$param );
        
Home | Imprint | This part of the site doesn't use cookies.