Open thefrosty opened 3 years ago
Quick fix:
<?php
$taxonomies = \get_taxonomies();
$fixQueryParams = static function (array $query_params): array {
if (
isset($query_params['post']) &&
(isset($query_params['post']['type']) && \strcasecmp($query_params['post']['type'], 'integer') === 0) &&
(isset($query_params['post']['type']) && \gettype($query_params['post']['type']) !== 'array')
) {
$query_params['post']['type'] = [$query_params['post']['type'], 'null'];
}
return $query_params;
};
\array_walk(
$taxonomies,
fn(string $taxonomy): bool => \add_filter("rest_{$taxonomy}_collection_params", $fixQueryParams)
);
Found another issue on the same plane as #4, this one for taxonomies.
Running a curl on my local WordPress install:
Returns: