Skip to content

Better support for post__in #110

@renatonascalves

Description

@renatonascalves

Description

If a consumer passes a string, it's likely they can get this error. Mainly because this is what is passed: array_map('absint', '18708892').

[11-Sep-2025 00:24:28 UTC] PHP Fatal error:  Uncaught TypeError: array_map(): Argument #2 ($array) must be of type array, string given in /chroot/var/www/wp-content/mu-plugins/search/es-wp-query/class-es-wp-query-wrapper.php:608

This is present here, but it'd be great to fix in the true source.

My proposal would be to validate if it is an array before passing it to array_map.

Use Case

A query where post__in is a string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions