Skip to content

Instantly share code, notes, and snippets.

@tenman
Created April 13, 2010 03:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tenman/364283 to your computer and use it in GitHub Desktop.
Save tenman/364283 to your computer and use it in GitHub Desktop.
<?php
/**
* wordPress taxonomy sample
*
* theme/functions.php
**/
register_taxonomy(
'sky',#項目追加
'attachment:image',#コンテンツの種類
array(
'label' => '天気',#項目ラベル
'helps' => '天気を入力して下さい。'#項目説明
)
);
register_taxonomy(
'place',#項目追加
'attachment:image',#コンテンツの種類
array(
'label' => '場所',#項目ラベル
'helps' => '車じゃないといけない、バスで行ける、電車でいける、'#項目説明
)
);
register_taxonomy(
'animal',
'post',
array(
'hierarchical' => true, 'label' => '動物',
'update_count_callback' => '_update_post_term_count')
);
register_taxonomy(
'taste',
'post',
array(
'hierarchical' => false,
'label' => 'おいしさ',
'update_count_callback' => '_update_post_term_count')
);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment