Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /////////////////////////////////////////////////////////////////////////////////
- // Added by Dameian on 4/11/2011 to allow for extraction of the attachment's ID
- // and population of a preview area.
- // Isolate the attachment's ID
- var mediaID = html.match(/wp-image-(.*)"/i);
- mediaID = (mediaID && mediaID[1]) ? mediaID[1] : '' ;
- // Pass the attachment ID to a hidden field with ID #media_id
- $(wpalchemy_mediafield_selector).closest('.wpa_group').find('#media_id').val(mediaID);
- // Send a preview thumb to a preview area
- $(wpalchemy_mediafield_selector).closest('.wpa_group').find('.preview').html(html);
- // Maybe make our media ID global and available to things like AJAX?
- // WPAlchemyMediaID = mediaID;
- /////////////////////////////////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement