WoW API: GetNumBattlefieldScores
← WoW API < GetNumBattlefieldScores
Appears to return the number of scores in the battleground/field scoreboard:
local x = GetNumBattlefieldScores();
Which is an effective way of counting the players in a battlefield.