SendToEditor problems with 4.4
-
A question in advance: Is there already a difference between 4.4 and 4.5-alpha-35846?
I realized that after updating (to 4.4) some of my upload functions within custom meta boxes are not working anymore.
This is my current js – which still opens the media library but doesn’t send the img src to my input field anymore
……………………….var uploadID = ''; var storeSendToEditor = ''; var newSendToEditor = ''; jQuery('.customupload').live('click', function() { window.send_to_editor = newSendToEditor; uploadID = jQuery(this).prev('input'); wp.media.editor.open(this); return false; }); storeSendToEditor = window.send_to_editor; newSendToEditor = (function(html) { imgurl = jQuery('img',html).attr('src'); uploadID.val(imgurl); tb_remove(); });
…………………….
if I change …
=> wp.media.editor.open(this);… into an elder version (< 3.5) …
=> tb_show( ”, ‘media-upload.php?type=image&TB_iframe=true’ );… it’s working again and the my input is filled with the img src again. (using the old media library style/functions)
I’ve tested the whole thing on a second website, using the latest WP Release (with Beta Tester Plugin) which is “WordPress 4.5-alpha-35846”. Surprisingly every upload function using the first code above is working without any problems.
So is there in fact a difference between these WP versions or am I just doing something completely wrong? And the “sendToEditor” results I’ve seen are somehow random?
Any help or hint is highly appreciated – thanks a lot in advance!
- The topic ‘SendToEditor problems with 4.4’ is closed to new replies.