我使用 media-categories-2 插件对我的媒体文件进行排序,但我没有在页面->插入媒体模式窗口中对我的媒体文件进行排序,并且我找不到所需的插件。请帮助我
我也一直在尝试找出如何做到这一点。我已经使用这些片段自己创建了类别http://sumtips.com来自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' );
当我弄清楚下一部分时我会更新它!