Dashboard
PHP:
8.0.30
OS:
Linux
User:
hoozgot
/
/
home
/
hoozgot
/
www
/
hoozgot
/
wp-content
/
plugins
/
hoozgot
/
js
📤 Upload
📝 New File
📁 New Folder
Close
Editing: upload.js
jQuery(document).ready(function() { var formfield; jQuery('#upload_image_button').click(function() { jQuery('html').addClass('Image'); formfield = jQuery('#Image').attr('name'); tb_show('', 'media-upload.php?type=image&TB_iframe=true'); return false; }); /* window.send_to_editor = function(html) { if ( jQuery('html').hasClass('Image') ) { imgurl = jQuery('img',html).attr('src'); jQuery('#Image').val(imgurl); tb_remove(); jQuery('html').removeClass('Image'); } }*/ // user inserts file into post. only run custom if user started process using the above process // window.send_to_editor(html) is how wp would normally handle the received data window.original_send_to_editor = window.send_to_editor; window.send_to_editor = function(html){ //if (formfield) { fileurl = jQuery('img',html).attr('src'); jQuery('#Image').val(fileurl); tb_remove(); jQuery('html').removeClass('Image'); } //else { //window.original_send_to_editor(html); //} //}; });
Save
Cancel