Update save function, wp_footer action, and replace get_post_custom