How to allow searching a custom meta key in admin list table?
After posting the same question to multiple AI chatbots, CoPilot finally gave me an answer that works for both: add_action( ‘pre_get_posts’, ‘filter_files_admin_columns’ ); function filter_files_admin_columns( $query ) { if ( !is_admin() || ‘eri-files’ !== $query->get( ‘post_type’ ) ) { return; } add_filter( ‘posts_search’, ‘custom_search_query’, 10, 2 ); function custom_search_query( $search, $wp_query ) { global $wpdb; … Read more