WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] WordPress 3.5 : How to allow PDF/ICO file upload in media uploader (2 posts)

  1. Kwayy Infotech
    Member
    Posted 1 year ago #

    Hello,

    I have created a theme and added icon (.ico file) upload feature so anyone can select icon file for Favicon. The old code works perfectly.

    But after updating to WP 3.5, I updated my old code with this new one:

    jQuery(document).ready(function($){
    var _custom_media = true,
    _orig_send_attachment = wp.media.editor.send.attachment;
    $("#myupload_button").click(function(e) {
    var send_attachment_bkp = wp.media.editor.send.attachment;
    var button = $(this);
    var id = button.attr("id").replace("_button", "");
    _custom_media = true;
    wp.media.editor.send.attachment = function(props, attachment){
    if ( _custom_media ) {
    $("#"+id).val(attachment.url);
    } else {
    return _orig_send_attachment.apply( this, [props, attachment] );
    };
    }
    wp.media.editor.open(button);
    return false;
    });
    $(".add_media").on("click", function(){
    _custom_media = false;
    });
    });

    But not it doesn't allow me to upload ICO file and only allow me to upload PNG/JPG imgages.

    I want to upload ICO file and than want to get ICO file URL in a textarea.

    So how can I configure to upload ICO file too?

  2. Kwayy Infotech
    Member
    Posted 1 year ago #

    This is now working with same code. I don't know how but it's working without any change.

Topic Closed

This topic has been closed to new replies.

About this Topic