0

メディア ファイルの並べ替えにmedia-categories-2プラグインを使用していますが、ページ -> メディア モーダル ウィンドウの挿入でメディア ファイルを並べ替えず、必要なプラグインが見つかりません。私を助けてください

4

1 に答える 1

0

私もこれを行う方法を理解しようとしてきました。これらのスニペット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' );

次のパートがわかったら更新します!

于 2013-03-23T18:10:50.307 に答える