Custom filtering of the customers search

I just started playing with you plugin and it's a nice and smart piece of work 🙂

I'm looking at the possibility to filter the customer search.
Each user capable of doing the switch will need have a different list of customers.

The filter will be based on a user meta that customers have in common.
I would have loved a filter on the wp_user_query arguments but there is none.

It looks like I can't override the  woocommerce_json_shop_as_customers_search  action neither.

What would be the best way to override the query ?

Thanks Michael

Add Comment
2 Answer(s)


I simply hooked to the pre_user_query and added the filters needed.
It works perfectly fine.

I just hoped I could have got a reply earlier since it has been 4 days since I posted the request 🙁



Answered on September 5, 2016.
Add Comment

Hi Michael,

Thanks for getting in touch and thanks for the answer. Sorry we couldn't reply sooner. Glad you have found a solution to your issue.



Answered on September 5, 2016.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.