WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Is there a way to disable the new Media Manager? (30 posts)

  1. SchuminWeb
    Member
    Posted 1 year ago #

    I upgraded to 3.5 in my "sandbox" site, and the question has come up: Does anyone know of a way to disable the new Media Manager, or, more specifically, revert back to the version that existed in 3.4 without having to do a manual downgrade of the whole system? The new 3.5 is otherwise fine except for the new Media Manager, thus trying to avoid a manual downgrade.

    I manage my site's images outside of my WordPress installation for a number of reasons, and thus I use the "From URL" feature a lot, and the new Media Manager destroyed a lot of the functionality that I rely on (thus my production sites are staying on 3.4 for now).

    I have a feeling that the old version of the Media Manager still exists somewhere, because if one goes in to edit an image, one gets the old dialog box from 3.4.

    Does anyone know how to do/find this?

  2. teenstarsworld
    Member
    Posted 1 year ago #

    also want to know how to disable it

  3. BeautyPirate
    Member
    Posted 1 year ago #

    I donĀ“t think they are going to change that so soon. Working around it now means that you would have to do that again after every update which, trust me... WILL be a P.I.T.A.! ;-)

    Find a way to work with the new Media Center, OR write a plugin (or wait for it to be made...) which gives you that functionality back. This would not have to be edited again and again unless theres a major change made.

  4. A.Morita
    Member
    Posted 1 year ago #

    Paste below to function.php file in your theme folder.

    add_action('admin_head', 'remove_media_buttons');
    function remove_media_buttons(){
    remove_action('media_buttons','media_buttons');
    add_action('media_buttons', 'old_media_buttons');
    }

    function old_media_buttons($editor_id = 'content') {
    $context = apply_filters('media_buttons_context', __('Upload/Insert %s'));

    $img = '<img src="' . esc_url( admin_url( 'images/media-button.png?ver=20111005' ) ) . '" width="15" height="15" />';

    echo '' . sprintf( $context, $img ) . '';
    }

  5. SchuminWeb
    Member
    Posted 1 year ago #

    A.Morita, first of all, thank you for the code.

    I put it in, and unfortunately, the button does not work. There's no link on the button to make the dialog box come up. I got the same result in both Firefox and Chrome. I copied the code with no modification other than adding the obligatory PHP open and close.

  6. A.Morita
    Member
    Posted 1 year ago #

    Sorry, try this.

    add_action('admin_head', 'remove_media_buttons');
    function remove_media_buttons(){
    remove_action('media_buttons','media_buttons');
    add_action('media_buttons', 'old_media_buttons');
    }
    
    function old_media_buttons($editor_id = 'content') {
    $context = apply_filters('media_buttons_context', __('Upload/Insert %s'));
    $img = '<img src="' . esc_url( admin_url( 'images/media-button.png?ver=20111005' ) ) . '" width="15" height="15" />';
    echo '<a href="' . esc_url( get_upload_iframe_src() ) . '" class="thickbox add_media" id="' . esc_attr( $editor_id ) . '-add_media" title="' . esc_attr__( 'Add Media' ) . '" onclick="return false;">' . sprintf( $context, $img ) . '</a>';
    }

    (The above function is just quoted from 'media_buttons' of WP3.4 located in yoursite.com/wp-admin/includes/media.php )

  7. SchuminWeb
    Member
    Posted 1 year ago #

    Perfect! Thanks much.

  8. SchuminWeb
    Member
    Posted 1 year ago #

    Actually, I spoke too soon. It works perfectly on the regular editor screen, but not when you take it to fullscreen, unfortunately. That still shows the new box.

    I tinkered around with the code a bit based on your suggestion, but unfortunately wasn't able to come up with anything that worked for fullscreen.

    Any ideas?

  9. A.Morita
    Member
    Posted 1 year ago #

    Try this.

    add_action('after_wp_tiny_mce', 'fullscreen_media_button');
    function fullscreen_media_button(){
    ?>
    <script type="text/javascript">
    fullscreen.medialib = function() {
    var href = jQuery('div#wp-content-media-buttons a.thickbox').attr('href') || '';
    tb_show('', href);
    }
    </script>
    <?php
    }

    This js code/function is quoted from 'medialib' located in
    yoursite.com/wp-admin/js/wp-fullscreen.js of WP3.4 and made a bit of alterations.

  10. SchuminWeb
    Member
    Posted 1 year ago #

    Works perfectly. Thanks much! I now can upgrade my sites to 3.5 and not lose any functionality.

  11. A.Morita
    Member
    Posted 1 year ago #

    I found that the screen of the Set Featured Image also having been updated.
    If you prefer it's previouse version, add the following code.

    add_action( 'wp_default_scripts', 'unset_media_views',999, 1 );
    function unset_media_views($scripts){
    unset($scripts->registered['media-views']);
    }

    The hook of wp_default_scripts is located in yoursite.com/wp-includes/class.wp-scripts.php(WP3.5), and hooked in yoursite.com/wp-includes/script-loader.php(WP3.5) in order to set/enqueue default scripts.

    You can remove js codes printed in footer area for use in
    Set Featured Image (and for use in something??) of WP3.5
    by the following code.

    add_action('admin_head', 'remove_wp_print_media_templates');
    function remove_wp_print_media_templates(){
    remove_action( 'admin_footer', 'wp_print_media_templates' );
    remove_action( 'wp_footer', 'wp_print_media_templates' );
    }

    The function wp_print_media_templates is defined at yoursite.com/wp-includes/media-template.php(WP3.5), and it hooked in yoursite.com/wp-includes/media.php(WP3.5).

  12. Abdelhadi
    Member
    Posted 1 year ago #

    Thanks A.Morita for your code, but it seems not working on my website (it's in arabic and using wp 3.5). I still see the new media manager I don't like.
    Any idea? Can you make the old media manager as plugin? I think many poeple will like it :)
    Thanks again.

  13. SchuminWeb
    Member
    Posted 1 year ago #

    I would agree that wrapping these changes up as a plugin would be wonderful (since I'm sure we're not the only ones to think about this), but I'm not sure if this is actually the venue where we're supposed to do that.

    That brings the question: what is the proper venue for "plugin wanted" types of requests? Obviously we can cite this thread in that request, but not sure exactly where it needs to go.

  14. Abdelhadi
    Member
    Posted 1 year ago #

    Thanks for you reply SchuminWeb. Posted here lookink for a plugin:
    http://wordpress.org/support/topic/needed-old-media-manager-as-plugin?replies=1

  15. brasofilo
    Member
    Posted 1 year ago #

    Wow, A.Morita, yours is an only and a heck of a participation in the forum.
    Kudos for that!
    ;)

    I summed up all code in WordPress StackExchange and also wrapped it as a plugin:
    (: hope you don't mind, there are props to you all over the place :)

    https://gist.github.com/4570587

  16. SchuminWeb
    Member
    Posted 1 year ago #

    That's awesome! Is this plugin available in the official WordPress plugin directory yet?

  17. brasofilo
    Member
    Posted 1 year ago #

    @SchuminWeb,
    nope, this was A.Morita magic and I don't have any plan on putting this in the Repo.

    It is as is, I've just joined all the parts in a working plugin.

    Copy, tweak, install, welcome to open source!

  18. sch0k
    Member
    Posted 1 year ago #

    I find the new Media Manager so sluggish, so I included all your suggestions @A.Morita. Most things work well enough, except the following:

    For files uploaded through the old media manager re-activated this way, I can only insert the smallest (150x150) and the original image size.

    For files uploaded through the new media manager, I can use all usual sizes to insert - regardless whether I do this then through the new or old interface, as long as I did use the new interface for the upload itself.

    Any ideas what this could be, and how this could be fixed?

  19. Andrew
    Member
    Posted 1 year ago #

    Thanks @brasofilo !!! Works perfectly. Brilliant.

  20. Unsal Korkmaz
    Member
    Posted 1 year ago #

    Anyone have any idea why they ruined media manager so much in 3.5?

  21. wunderdojo
    Member
    Posted 1 year ago #

    Just wanted to say thanks for the plugin -- I've had clients freaking out over the new media manager. They can't figure out how to order the pix in a gallery and they don't like the interface. This is a life saver.

  22. christopheran
    Member
    Posted 1 year ago #

    Thank you all very much for your work on this!!!

    I just upgraded today and when I saw the new add media box, I knew it was going to be a disaster for my users.

    This fixed it up great :)

    Thanks again,

    Chris

  23. brody13
    Member
    Posted 1 year ago #

    Tried it. It Works. @Brasofilo your the man!!

  24. peepntom
    Member
    Posted 1 year ago #

    you saved my bacon

  25. brasofilo
    Member
    Posted 1 year ago #

    @all

    I've updated the plugin. It was executing in all admin pages when it only needs to run in the pages post.php and post-new.php (and they cover all post types).

    This was producing a conflict in another plugin page, so updating is highly encouraged.

    Version 1.1 at the same address:
    https://gist.github.com/brasofilo/4570587

  26. wadewest
    Member
    Posted 1 year ago #

    hey brasofilo, how do i install that php file you uploaded? i don't know much about gist or even what to do with it.

    i'm taking php in college, so i'm pretty new at this. if it's something that would take a while to explain, do you have any links to help me out with what to do?

    anything would really help. i really want this plugin you made lol

  27. wadewest
    Member
    Posted 1 year ago #

    actually, nevermind.

    i completely solved the shitty lagging issue without using your code. the new media manager runs perfectly, therefore i don't have a need to switch back to the old.

    here's what i did.

    1. set my global php version on my host to 5.4
    2. added this code to admin-ajax.php and async-upload.php

    ini_set("display_errors", 0);
    ini_set("error_reporting", 0);
    error_reporting(0);

    i also installed this plugin to do image resizing automatically (or manually if you want)
    http://wordpress.org/extend/plugins/imsanity/

    that's literally all i did. now the media manager works great, just like it does when i run it locally on my computer (problem only came up when i uploaded onto my host)

    ps i'm also getting 0 errors on uploading files as well. everything is smooth

    cheers

  28. brasofilo
    Member
    Posted 1 year ago #

    Hi wadewest,
    this code doesn't solve any bug. It a matter of User Interface, it's for people who doesn't like the new uploader.

    You seem to have edited core files. Don't do that. Everything you need to modify in WP has to (and can) be done through the files .htaccess, wp-config.php and everything inside /wp-content/, leave the rest alone. The code you're showing goes inside wp-config.

    best regards :)

  29. NickStrong
    Member
    Posted 1 year ago #

    Thank you brasofilo, that's helped me too.

  30. BrunoSousa
    Member
    Posted 1 year ago #

    Hi ...

    brasofilo, thanks for this code, I think this is exactly that I need. However, I am an graphic designer who ventures in wordpress, and I don't have any idea how to install your code. Can you help-me with an step-by-step?

    Thanks in advance!

Topic Closed

This topic has been closed to new replies.

About this Topic