Sometimes you might need to look up the attachment id for an imported image (or other media library file) to accommodate a third party plugin. You can use this code in the function editor.
/* Returns attachment ID for the given filename, path or URL. Argument can be a
* URL or local file path because this will only look at the file basename. Ex - These
* would return the same thing:
* $id = img_id("myfile.jpg");
* $id = img_id("http://domain.com/images/myfile.jpg");
*/
function att_id($image_filename) {