Ecommerce Shopify WordPress Discussion

WordPress Users (ACF) : Search User by acf user number field

i am trying to display ACF field in users in admin screen, and i am able to achieve this. Now i want to search user by this ACF field in normal wordpress user search. Is there any Hook / Code snippet is available to achieve this? Code to display ACF field in User listing: function column_register_acf_id($columns) { $columns['memno'] = 'Memno'; return $columns; } add_filter('manage_users_columns', 'column_register_acf_id'); function column_display_acf_id($value, $column_name, $user_id) { $user_info = get_field('memno', 'user_' . $user_id); if ($column_name == 'memno') return $user_info; return $value; } add_filter('manage_users_custom_column', 'column_display_acf_id', 10, 3); Acf field User listing: https://prnt.sc/N-xmnIF-YEzP
You want to use pre_get_posts, like this: add_action( 'pre_get_posts', 'apatel_search_user_meta_for_id' ); function apatel_search_user_meta_for_id( $query ){ if( is_admin() && $query->is_search() ){ // here you will define the meta query and then set it with $query->set } }

January 13, 2024

TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.