WordPress.org

Ready to get started?Download WordPress

Forums

Native Image Uploader doesn't work anymore after adding custom image uploader (2 posts)

  1. TheodoreNaiv
    Member
    Posted 1 year ago #

    Hi Everyone,

    I developed for a client a wordpress theme with custom admin panels and custom fields, both the functionality uses a custom image uploader, after created the custom image uploader the native uploader add Media (that i call when i click add media, the button above the editor) doesn't work anymore, i can access to library, choose the pic but when i click "insert into page" the pic is not added in the content. The pic is anyway presents in the gallery, so then i think it's a problem with my custom image uploader script, because when i disable it, the add media works well.

    Here is my code:

    function upload_scripts() {
    wp_enqueue_script('media-upload');
    wp_enqueue_script('thickbox');
    wp_register_script('my-upload', get_template_directory_uri(__FILE__) . '/inc/uploader/upload.js', array('jquery','media-upload','thickbox'));
    wp_enqueue_script('my-upload');
    }
    function thickbox_styles() {
    wp_enqueue_style('thickbox');
    }
    add_action('admin_print_scripts', 'upload_scripts');
    add_action('admin_print_styles', 'thickbox_styles');

    Thanks in advance for help me,
    Theo

  2. TheodoreNaiv
    Member
    Posted 1 year ago #

    Sorry, I have forget to say that i wrote this code in the functions.php

Topic Closed

This topic has been closed to new replies.

About this Topic