內容簡介
這個外掛擴展了預設的分類功能,將其擴展到使用者身上,同時自動化所有樣板代碼。
啟用後,您可以使用以下程式碼註冊使用者分類:
register_taxonomy('profession', 'user', array(
'public' =>true,
'labels' =>array(
'name' =>'職業',
'singular_name' =>'職業',
'menu_name' =>'職業',
'search_items' =>'搜尋職業',
'popular_items' =>'熱門職業',
'all_items' =>'所有職業',
'edit_item' =>'編輯職業',
'update_item' =>'更新職業',
'add_new_item' =>'新增職業',
'new_item_name' =>'新職業名稱',
'separate_items_with_commas'=>'用逗號分隔職業',
'add_or_remove_items' =>'新增或移除職業',
'choose_from_most_used' =>'從最常用的職業選擇',
),
'rewrite' =>array(
'with_front' =>true,
'slug' =>'author/profession',
),
'capabilities' => array(
'manage_terms' =>'edit_users',
'edit_terms' =>'edit_users',
'delete_terms' =>'edit_users',
'assign_terms' =>'read',
),
));
在代碼條目中閱讀有關註冊分類的更多詳細信息。
這是受先前由Justin Tadlock的工作強烈啟發而來。
外掛標籤
開發者團隊
原文外掛簡介
This plugin extends the default taxonomy functionality and extends it to users, while automating all the boilerplate code.
Once activated, you can register user taxonomies using the following code:
register_taxonomy('profession', 'user', array(
'public' =>true,
'labels' =>array(
'name' =>'Professions',
'singular_name' =>'Profession',
'menu_name' =>'Professions',
'search_items' =>'Search Professions',
'popular_items' =>'Popular Professions',
'all_items' =>'All Professions',
'edit_item' =>'Edit Profession',
'update_item' =>'Update Profession',
'add_new_item' =>'Add New Profession',
'new_item_name' =>'New Profession Name',
'separate_items_with_commas'=>'Separate professions with commas',
'add_or_remove_items' =>'Add or remove professions',
'choose_from_most_used' =>'Choose from the most popular professions',
),
'rewrite' =>array(
'with_front' =>true,
'slug' =>'author/profession',
),
'capabilities' => array(
'manage_terms' =>'edit_users',
'edit_terms' =>'edit_users',
'delete_terms' =>'edit_users',
'assign_terms' =>'read',
),
));
Read more about registering taxonomies in the codex
This is heavily inspired by previous work by Justin Tadlock
