If you only want that code for one group of users, you could do something like this:
$do = false;
$wholesale_group = 20;
if(version_compare(JVERSION,'1.6.0','<')){
$my =& JFactory::getUser();
if(empty($my->id)){
$group = 29;
}else{
$group = $my->gid;
}
if($wholesale_group==$group){
$do = true;
}
}else{
jimport('joomla.access.access');
$my =& JFactory::getUser();
$groups = JAccess::getGroupsByUser($my->id, false);
if(in_array($wholesale_group,$groups)){
$do = true;
}
}
if($do){
//code to execute only for the user group with the id 20
}
And replace the line //code to execute only for the user group with the id 20 by the previous code and the 20 by the id of your wholesale user group.