Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is there any way to switch back to the old media uploader in WordPress 3.5? The new one is very slow for me, as I have thousands and thousands of images across my site, and I have a few plugins that only work with the old uploader.

share|improve this question
    
What plugins don't work with WP 3.5? –  NoBugs Jan 30 '13 at 3:19
add comment

1 Answer 1

I just found this gem in WordPress forums, all props to A.Morita.

Is there a way to disable the new Media Manager?

Summing up all the code published, this is it:

/**
 * I WANT THE OLD UPLOADER BACK
 * All code by: A.Morita
 * URL: http://wordpress.org/support/topic/is-there-a-way-to-disable-the-new-media-manager/
 */

/**
 * Old upload Thickbox
 */
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>';
}

/**
 * Featured image
 */
add_action( 'wp_default_scripts', 'unset_media_views', 999, 1 );
add_action( 'admin_head', 'remove_wp_print_media_templates' );

function unset_media_views($scripts)
{
    unset( $scripts->registered['media-views'] );
}

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


/**
 * Adjust Full Screen behavior
 */
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
}

Wrapped as a plugin in Gist.

share|improve this answer
    
Nice, brsofilo! Great way to take a whole thread of give-and-take and boil it down to the essentials. :) –  akTed Jan 20 '13 at 6:28
    
thanks a lot :) –  Ünsal Korkmaz Feb 11 '13 at 10:48
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.