A former union leader has been granted bail after facing court on charges over a social media post that prosecutors allege was a "targeted, calculated attack".