1shiharat
3/19/2014 - 3:49 AM

custom taxonomy create.

custom taxonomy create.

// Register Custom Taxonomy
function news_custom_taxonomy() {

	$labels = array(
		'name'                       => _x( 'ニュースカテゴリ', 'Taxonomy General Name', 'text_domain' ),
		'singular_name'              => _x( 'ニュースカテゴリ', 'Taxonomy Singular Name', 'text_domain' ),
		'menu_name'                  => __( 'ニュースカテゴリ', 'text_domain' ),
		'all_items'                  => __( 'すべてのニュースカテゴリ', 'text_domain' ),
		'parent_item'                => __( '親カテゴリ', 'text_domain' ),
		'parent_item_colon'          => __( '親カテゴリ:', 'text_domain' ),
		'new_item_name'              => __( '新しいカテゴリ', 'text_domain' ),
		'add_new_item'               => __( '新しいカテゴリを追加', 'text_domain' ),
		'edit_item'                  => __( 'カテゴリを編集', 'text_domain' ),
		'update_item'                => __( 'カテゴリを更新', 'text_domain' ),
		'separate_items_with_commas' => __( 'アイテムをカンマで区切る', 'text_domain' ),
		'search_items'               => __( 'カテゴリを検索', 'text_domain' ),
		'add_or_remove_items'        => __( '追加、または削除', 'text_domain' ),
		'choose_from_most_used'      => __( 'Choose from the most used items', 'text_domain' ),
		'not_found'                  => __( '見つかりませんでした。', 'text_domain' ),
	);
	$args = array(
		'labels'                     => $labels,
		'hierarchical'               => false,
		'public'                     => true,
		'show_ui'                    => true,
		'show_admin_column'          => true,
		'show_in_nav_menus'          => true,
		'show_tagcloud'              => true,
	);
	register_taxonomy( 'news_category', array( 'news' ), $args );

}

// Hook into the 'init' action
add_action( 'init', 'news_custom_taxonomy', 0 );