This is true, however not a constant occurrence in sleeping elephants. Elephants have been known generally at night to sleep lying down for a couple of hours, however they have also been known to sleep standing up at times. During the day they might be seen standing, taking short naps. Altogether they sleep for about six hours per day.
Because elephants must always be completely alert and aware of their surroundings in the wild, to protect themselves and their young from predators such as lions, they have been known to sleep standing up at times. Sometimes an elephant will lay down for a couple of hours to sleep, although baby elephants are more likely to do this than adult elephants.
Generally most adult elephants that are seen asleep standing up might be just taking a quick nap, or could even be sick. One could say it typically depends on their environment. For instance, If elephants are in kept in an environment such as a zoo where hungry predators are not around, they may be more likely to sleep standing up than say, an elephant who lives in the wild and has lots of predators around.