Forums

Using media uploader elsewhere (2 posts)

  1. mlok
    Member
    Posted 2 years ago #

    I'm trying to put the media uploader into the wp-events plugin's add event page, so that I can easily upload an image and include it in the event description (I've included the tinymce editor)

    It all works fine, expect for when it comes to inserting the image into the editor. I get the Javascript error message
    "win.send_to_editor is not a function"

    I know it's a hack and the media upload part of wordpress isn't intended to be used like this :) But does anyone know what the problem could be?

  2. apljdi
    Member
    Posted 2 years ago #

    Old post but... this is what I load to get the media editor working.

    wp_enqueue_script('post');
         wp_enqueue_script('media-upload');
         wp_enqueue_script('word-count');
         wp_enqueue_script('schedule');
         wp_enqueue_script('editor');
         add_thickbox();
         wp_admin_css('thickbox');
    if (function_exists('wp_tiny_mce')) wp_tiny_mce();

    Both blocks above are inside functions that control where they load. The first block is hooked to 'admin_menu'; the second block is hooked to 'admin_head'.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags