Sorting wordpress 3.5在插入媒体模式窗口中按媒体类别排序

Sorting wordpress 3.5在插入媒体模式窗口中按媒体类别排序,sorting,wordpress,modal-dialog,media,Sorting,Wordpress,Modal Dialog,Media,我使用插件对我的媒体文件进行排序,但我没有在页面->插入媒体模式窗口中对我的媒体文件进行排序,我找不到需要的插件。请帮帮我,我也一直在想怎么做。我已经使用functions.php中的这些代码片段创建了类别 add_action('init', 'create_media_categories'); function create_media_categories() { $labels = array( 'name' => 'Media Category' ); $a

我使用插件对我的媒体文件进行排序,但我没有在页面->插入媒体模式窗口中对我的媒体文件进行排序,我找不到需要的插件。请帮帮我,我也一直在想怎么做。我已经使用functions.php中的这些代码片段创建了类别

    add_action('init', 'create_media_categories');

function create_media_categories() {
$labels = array(
    'name' => 'Media Category'
);

$args = array(
    'labels' => $labels,
    'public' => true
);

register_taxonomy('imagetype', 'attachment', $args);
}
之后,我想出了如何在“插入媒体”框中创建一个新选项:

function custom_media_upload_tab_name( $tabs ) {
    $newtab = array( 'tab_slug' => 'Your Tab Name' );
    return array_merge( $tabs, $newtab );
}

add_filter( 'media_upload_tabs', 'custom_media_upload_tab_name' );

function custom_media_upload_tab_content() {
    // I haven't gotten to this part yet
}
add_action( 'media_upload_tab_slug', 'custom_media_upload_tab_content' );
当我弄清楚下一部分时,我会更新它