By searching google I have found references to the acf/fields/user/search_columns/ filter – but I am really having a hard time understanding how to use it.
Here is the post that references this filter: https://support.advancedcustomfields.com/forums/topic/user-field-select2-doesnt-search-for-names/
Do I do somehow use this within the WordPress “user_search_columns” filter?
thank you
It is used just like the WP core user_search_columns filter https://codex.wordpress.org/Plugin_API/Filter_Reference/user_search_columns
The only real difference is that using the acf/fields/user/search_columns allows you to target only searches being done for an ACF field or specific fields based on field name or field key
Okay, so I was misunderstanding what the purpose of this was for. It is only for ACF fields.
What I’m trying to accomplish and I think you know from my other post, is to modify the user_search_columns to include a ACF field/meta key.
Is this possible? It seems with the WordPress hook ‘user_search_columns’ only works with default user meta keys.
There isn’t any way to use this filter for what you want or to include meta fields in what WP is doing here. You’d need to construct your own user query to do it. https://wordpress.stackexchange.com/questions/179304/searching-user-meta-using-wp-user-query