Wordpress 媒体库加载慢的解决方法

/**
 * 解决 Wordpress 媒体库加载慢
 */


function doocii_media_script()
{
    ?>
<script>
jQuery(function($) {
    var called = 0;
    $('#wpcontent').ajaxStop(function() {
        if ( 0 == called ) {
            $('[value="uploaded"]').attr( 'selected', true ).parent().trigger('change');
            called = 1;
        }
    });
});
</script>
    <?php
}

add_action( 'admin_footer-post-new.php', 'doocii_media_script' );
add_action( 'admin_footer-post.php', 'doocii_media_script' );