Created
August 24, 2012 08:07
-
-
Save s-hiroshi/3447335 to your computer and use it in GitHub Desktop.
WordPress > snippets > custom taxonomy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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