• Resolved brings

    (@brings)


    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!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter brings

    (@brings)

    Sometimes little things cause big confusions ?? – the solution was very very simple:
    The “attachment display setting” (link to) is set to “none” by default in WP 4.4. As far as I remember it was always set to “media file” before. Of course the img src cannot be delivered if there is none.

    Everything works fine!

    I’d like to thank you very much, this solved my problem too XD.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘SendToEditor problems with 4.4’ is closed to new replies.