I’m aware that one can add a control to the theme customiser to add an image.
This control returns an image URL however, and I need its attachment ID, not the image URL. Where can I intercept or steal the attachment ID of this image in order to do this? Is there a save hook I can intercept? Or a javascript based method?
The solution, needs a custom control object extending the original image control, and does an SQL query to grab the GUID and associated attachment ID on sanitisation. Not nice, kludgey, but it works