From https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress