If you are only using a USB cable for charging and not to connect to a PC then it only needs the black and red power wires inside to be connected and not the data ones (green and white).
Only partially true:
The USB charging standard makes use of the data lines to identify a device as a 'dumb charger'. Such a device (typically a wall-wart, but also battery packs and the like) will join the data lines together through a token low-value resistor (IIRC the spec says 120ohm).
A power-hungry device like a phone can then tell it's connected to a charger with more than the USB standard 500mA current limit available and can charge at a decent rate. This avoids the need for a microcontroller to act as a USB host and do the full power level negotiation, as would happen when plugged into a computer.
Typically, a device following the spec will refuse to charge or only charge at a very low current if connected to a power source with the data lines left floating. Of course, not all devices follow the spec - some are cheap and nasty and make assumptions, and some don't pull enough current to have to bother.
Apple, in their infinite capacity for evil, have their own variation of the standard, where they put specific voltages on the data lines to identify an Apple charger. Hence various iProducts may be extra-fussy about what they charge from.
Oh, and FWIW: the colours in a USB cable *are* standardised as Feline says, but I have come across (cheap, nasty) cables with non-standard colours.