10up / ElasticPress

A fast and flexible search and query engine for WordPress.
https://elasticpress.io
GNU General Public License v2.0
1.23k stars 312 forks source link

BUG: Status report page breaks when ep_indexable_post_types returns empty array #3909

Closed furai closed 2 months ago

furai commented 2 months ago

Describe the bug

When ep_indexable_post_types filter returns an empty array the get_post_count_group function throws error about not returning array.

Steps to Reproduce

  1. Use in your hooks this code snippet:
    add_filter('ep_indexable_post_types', function () {
        return [];
    });
  2. Go to Status Report tab in WrodPress ElasticPress plugin section.
  3. Error happens.

Screenshots, screen recording, code snippet

No response

Environment information

No response

WordPress and ElasticPress information

No response

Code of Conduct