ElasticPressLabs icon indicating copy to clipboard operation
ElasticPressLabs copied to clipboard

WP_User_Query: has_published_posts is not working

Open yarovikov opened this issue 1 year ago • 1 comments

Describe the bug

Hi there. Seems, has_published_posts is not working. I'm getting different count of users when ep_integrate false and or true. In my case ~9000 users vs ~1 mil

Steps to Reproduce

Use this code

$args = [
  'has_published_posts' => ['post'],
  'ep_integrate' => true,
];

$query = new WP_User_Query($args);

$user_count = $query->get_total(); // check count with ep_integrate  false and true

Screenshots, screen recording, code snippet

No response

Environment information

No response

WordPress information

WP 6.7.1 ElasticPress 5.4.1 ElasticPress Labs 2.3.1

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

yarovikov avatar Dec 16 '24 16:12 yarovikov

It is a known issue; we still need to add support to it (see here).

Pull Requests are welcome!

felipeelia avatar Nov 13 '25 11:11 felipeelia