API C PvP.IsActiveBattlefield

Returns whether you are currently in a battleground/battlefield.

isActiveBattlefield = C_PvP.IsActiveBattlefield

Returns

 * isActiveBattlefield : Boolean - whether the player is in an active battlefield.