Should warnings about not charging your phone at airport/public usb ports be taken seriously? There are many articles on the internet saying that charging at the usb ports available at the airport and public places can cause your phone to get hacked. 

Is there any any truth behind this?

If it is dangerous then why? Are those usb ports connected to some computer? But even if they are, isn't a phone unavailable to computers to that which it is connected to and you need to provide authorization for data transfer to take place?
Yes an no. 

Some years ago this was a very severe security problem, as a lot of devices automatically enabled the MTP mode when connected via USB that allows to access all files in the "sd-card" section. Also some device had ADB enabled by default.

Nowadays MTP and the other file-access protocols provided by Android devices are usually disabled by default and the user is explicitly asked if it should be enabled. And for ADB there is the public key authentication to identify trusted computers.

However this does not mean that there is no risk to use public USB power ports for charging. For example some Samsung devices had an exploit that allowed root access using an exploit in the MTP protocol - and this was possible with disabled MTP and locked screen.

Therefore in my opinion the risk of being attacked by usb ports available at the airport and public places has reduced a but in the last years, however it is still present. 

If you want to use those usb ports and be safe you should use an "USB condom" or some equivalent adapter that does makes it physically impossible to transfer data through it (usually those devices don't connect the USB data lines to the device which makes it impossible to transfer data from/to the device).