Hmm. In terms of string operations, that’s certainly not the most efficient way of adding the custom tvs to the beginning of the list: Each line probably requires copying the string to a new place in memory - but I find it hard to believe that would be the cause of slow page loads. Are you sure that you don’t get slow page loads when you use the original mm_rules code (in other words, with the custom multilingual tvs appearing after the standard ones)?
How about replacing the block where $tvString is constructed with this:
// Convert to list...
$tvString = '';
if ( $nCustomTVs > 0 )
{
$tvString .= implode( ',', $customTVs );
}
if ( $nStandardTVs > 0 )
{
if ( $nCustomTVs > 0 )
{
$tvString .= ',';
}
$tvString .= implode( ',', $standardTVs );
}
It’s equivalent to the existing code, but puts the custom TVs in front of the standard TVs.