Data URI in custom fields
Hook on ‘save_post’, and after normal saving metabox routine create the data uri using php functions base64_encode and file_get_contents. With a bit of logic skip saving if not necessary (data uri already_saved). In next example I assume the post thumbnail url is setted in a metabox, and the name of the field is ‘post_thumbnail’. See … Read more