The MU forums have moved to WordPress.org

Custom "Add Media" (5 posts)

  1. zappoman
    Member
    Posted 12 years ago #

    I am trying to figure out how to add a custom Add Media type tab in the media uploader for 2.6...

    I'm getting lost in trying to get all the hooks to work correctly.

    The challenge is getting the page to display for the media type..

    Has anyone got this working? I'd love to hear how you did it, check out some sample code.

    Thanks.

  2. musnake
    Member
    Posted 12 years ago #

    http://codex.wordpress.org/Function_Reference/add_filter

    <?add_filter('media_upload_newtab', array(&$this, 'media_upload_mycallback'));?>

    I updated a plugin for WPMu 2.6 that added to the media tabs.

    The original is here.

  3. zappoman
    Member
    Posted 12 years ago #

    This is a good example, but I'm trying to replace the "video type" upload... and that's where things get tricky...

    I know how to add filters, etc... but the key is know which filters get called when...

    I've read and traced through the media-upload.php and media.php code, and it's pretty tricky, considering there all this iframe stuff...

    What I want to do is remove the existing video upload type and replace it with one that allows short urls for services like youtube etc (not unlike wp.com)... I already have the short url content filters (that's easy, no big deal)... but I want to replace the "upload/insert" UI.

    The sample you've given shows how to add a new tab... but I want to replace a existing "type" handler with a new "type" handler implementation.

  4. musnake
    Member
    Posted 12 years ago #

    Ah, *math is hard facial expression*

    And there are no other media service plugins that do something similar to what you need?

    Forgive my channel clutter... This may help the next person searching for mime type stuff...

    http://blog.ftwr.co.uk/wordpress/mime-config/

    http://patchlog.com/wordpress/upload-mime-types-plugin-for-wordpress/
    which had

    ...each time the function wp_check_filetype is called your "filter" function will also be called and it can modify the contents of the $mimes array that holds the approved mime types and extensions...

    less useful: http://wp.uberdose.com/2006/10/15/mime-type-plugin/

    dsader had useful things to share illustrating the replacement of "Add Media" functionality via plugins in WPMu 2.6...

    I hope this helps more than it hinders.

    dsader likes icecream.

  5. zappoman
    Member
    Posted 12 years ago #

    Musnake... thanks for the links... but alas, I am well familiar with these plugins... and they don't do what I'm looking for.

    I will double check to see for sure what Viper's plugin does, but if it's still adding links to the tinyMCE toolbar, then it's not EXACTLY what I want.

    I appreciate that these plugins are all very similar to what I'm looking for, but they don't really scratch the itch...

    Here's why... from a usability perspective, I want to keep the "upload image" and embed video, audio, etc in the same ui. The new 2.6 UI is nice, I just want to tweak it.

    Now, there is clearly a ton of intended flexibility in the way the new uploader/embedder is implemented. And I'm no slouch, I can go through it and figure it out... But if someone else has already figured it out, then it would be cool to check out what they've accomplished.

About this Topic

  • Started 12 years ago by zappoman
  • Latest reply from zappoman