From https://github.com/wp-e-commerce/WP-e-Commerce/blob/master/wpsc-includes/wpsc-meta-util.php