prepare( " SELECT DISTINCT p.post_author FROM {$wpdb->posts} p WHERE p.post_type IN ({$placeholders}) AND p.post_status = 'publish' GROUP BY p.post_author ", ...$post_type ); } else { // Single post type - use the original logic $query = $wpdb->prepare( " SELECT DISTINCT p.post_author FROM {$wpdb->posts} p WHERE p.post_type = %s AND p.post_status = 'publish' GROUP BY p.post_author ", $post_type ); } // Fetch results as an array of objects $results = $wpdb->get_results( $query ); // Use wp_list_pluck to extract only the 'post_author' field $author_ids = map_deep( wp_list_pluck( $results ?? [], 'post_author' ), 'absint' ); // Return the array of IDs return $author_ids ?? []; }