- This topic has 9 replies, 2 voices, and was last updated 6 days, 16 hours ago by .
I am building my first custom field type and its not so easy as I first thought. I cant seem to find much information on this subject in the forum, fb etc.
I am basically building a input field file which allows the user to upload a single or multiple images using FileReader (Web API) and output them as base64 so I can pass the data on .
This is a general demo I found which I am basing my code off https://bootsnipp.com/snippets/2eNKz. The demo allows you to upload images and reorder them, but generates a base64 preview of the image locally within the browser.
Example of where I am at is below, any help would be great.
- Am I correctly enqueued JS file? I need this for the FileReader script. Or will it be easier to put this into a template? or within the class?
- I have included the input field but I can't work out how to pass the base64 stings over to $meta after the images have been encoded and exist in the DOM? do I have to call it via JS? or include an array somewhere so Metabox can use it automatically?
- You must be logged in to reply to this topic.