Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WordPress > snippets > custom taxonomy
<?php
// カスタムタクソノミーを登録
register_taxonomy(
'example_tax', // カスタムタクソノミー名
'example', // 投稿タイプの指定
array(
'hierarchical' => true, // trueの場合はカテゴリーのように表示
'update_count_callback' => '_update_post_term_count',
'label' => '分類',
'singular_label' => '分類',
'public' => true,
)
);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.