WordPress.org

Ready to get started?Download WordPress

Forums

Drag & Drop for Post Thumbnails
[resolved] Can we drag an image in from another website? (5 posts)

  1. RonStrilaeff
    Member
    Posted 1 year ago #

    Tobias,

    I'm going to start working with your plugin. Thanks for all your hard work. I would like to use it on my frontend to enable my visitors to upload an image for a post they are creating using an html input form on one of my pages.

    Can you see the possibility of an enhancement of dragging an image from a different website into your drop area?

    Thanks again, Ron

    http://wordpress.org/extend/plugins/drag-drop-for-post-thumbnails/

  2. RonStrilaeff
    Member
    Posted 1 year ago #

    Well, I know that this is outside of the scope of your plugin, but I'm trying to pull out the essential code for the upload form into my own page template for visitors to upload images using drag and drop.

    But I'm getting this error when it wants to call the media_upload_form function.

    Fatal error: Call to undefined function media_upload_form()

    It does not change anything if I include this code

    include_once(ABSPATH . WPINC . '/media.php' );

    at the top of my page template file.

    Can you straighten me out if you have the time or point me in the direction of a premium plugin that does drag and drop uploading and cropping (using plupload and jcrop maybe)? I read here that they are included in wp so it seems a natural to use them. That is what I really want but I don't have the php and js expertise to make it happen.

    Thanks, Ron

  3. Tobias Nygren
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Ron!

    I'm not sure this is any help but take a look at media.php in the admin. There you can see how wp is using plupload internally.

    That's probably a good start. Let me know how it goes!

  4. RonStrilaeff
    Member
    Posted 1 year ago #

    Thanks,

    Yeah I'm going to have to go back to the basics and roll my own. Once I get the uploaded image in hand I can figure out the jCopy stuff.

    It seems the trickiest part right now is is getting the javascript plupload.full.js to even be available. Is WP supposed to have that already loaded or does every php file have to enqueue it?

    Ron

  5. RonStrilaeff
    Member
    Posted 1 year ago #

    I think I found the answer to my question. The plupload.js and jcrop.js javascript code (and jquery.js since everything is dependendt on it) is included automatically by wordpress in wp-includes/script-loader.php

    And the media_upload_form is not needed by my custom input/upload form. I just need the most basic plupload drag and drop and upload functionality of which there are numerous examples (in bits and pieces) on the web.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.