0
我是新的WordPress的。WordPress的添加下拉列表中的自定義帖子類型添加/編輯帖子在管理
我已經創造了三個「自定義後」型像
- 兩個惠勒
- 三輪車
我用下面的代碼來創建自定義後類型
function create_post_type_two_wheeler()
{
register_taxonomy_for_object_type('category', 'TwoWheeler'); // Register Taxonomies for Category
register_taxonomy_for_object_type('post_tag', 'TwoWheeler');
register_post_type('client', // Register Custom Post Type
array(
'labels' => array(
'name' => __('TwoWheeler', 'vehicles'), // Rename these to suit
'singular_name' => __('TwoWheeler', 'vehicles'),
'add_new' => __('Add New', 'vehicles'),
'add_new_item' => __('Add New TwoWheeler', 'vehicles'),
'edit' => __('Edit', 'vehicles'),
'edit_item' => __('Edit TwoWheeler', 'vehicles'),
'new_item' => __('New TwoWheeler', 'vehicles'),
'view' => __('View TwoWheeler', 'vehicles'),
'view_item' => __('View TwoWheeler', 'vehicles'),
'search_items' => __('Search TwoWheeler', 'vehicles'),
'not_found' => __('No TwoWheeler found', 'vehicles'),
'not_found_in_trash' => __('No TwoWheeler found in Trash', 'vehicles')
),
'public' => true,
'hierarchical' => true, // Allows your posts to behave like Hierarchy Pages
'has_archive' => true,
'supports' => array(
'title',
'editor',
'excerpt',
'thumbnail'
), // Go to Dashboard Custom HTML5 Blank post for supports
'can_export' => true, // Allows export in Tools > Export
'taxonomies' => array(
'post_tag',
'category'
) // Add Category and Post Tags support
));
}
add_action('init', 'create_post_type_two_wheeler');
現在我想在管理員顯示的下拉添加「兩輪車」自定義後type.so用戶/編輯後可以選擇特定的職位,選項並保存在數據庫中的選項。
任何谷歌鏈接,將幫助我做到這一點? 我需要一種方法開始在此工作。