• Resolved SchuminWeb

    (@schuminweb)


    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?

Viewing 15 replies - 1 through 15 (of 29 total)
  • also want to know how to disable it

    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.

    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 ) . ‘‘;
    }

    Thread Starter SchuminWeb

    (@schuminweb)

    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.

    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 )

    Thread Starter SchuminWeb

    (@schuminweb)

    Perfect! Thanks much.

    Thread Starter SchuminWeb

    (@schuminweb)

    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?

    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.

    Thread Starter SchuminWeb

    (@schuminweb)

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

    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).

    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.

    Thread Starter SchuminWeb

    (@schuminweb)

    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.

    Thanks for you reply SchuminWeb. Posted here lookink for a plugin:
    https://www.ads-software.com/support/topic/needed-old-media-manager-as-plugin?replies=1

    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

    Thread Starter SchuminWeb

    (@schuminweb)

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

Viewing 15 replies - 1 through 15 (of 29 total)
  • The topic ‘Is there a way to disable the new Media Manager?’ is closed to new replies.