custum_post_type_cast
// Register Custom Post Type
function register_cpt_cast() {
$labels = array(
'name' => '出演者',
'singular_name' => '出演者',
'menu_name' => '出演者',
'parent_item_colon' => '親のアイテム',
'all_items' => 'すべての出演者をみる',
'view_item' => '出演者を見る',
'add_new_item' => '新しい出演者を追加',
'add_new' => '新規追加',
'edit_item' => '出演者を編集',
'update_item' => 'アップデート',
'search_items' => '検索',
'not_found' => '出演者が見つかりません',
'not_found_in_trash' => 'ゴミ箱に出演者はありませんんでした。',
);
$rewrite = array(
'slug' => 'cast',
'with_front' => true,
'pages' => true,
'feeds' => true,
);
$capabilities = array(
'edit_post' => 'edit_post',
'read_post' => 'read_post',
'delete_post' => 'delete_post',
'edit_posts' => 'edit_posts',
'edit_others_posts' => 'edit_others_posts',
'publish_posts' => 'publish_posts',
'read_private_posts' => 'read_private_posts',
);
$args = array(
'label' => 'cast',
'description' => '出演者の情報を登録します。',
'labels' => $labels,
'supports' => array( 'custom-fields', ),
'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'menu_position' => 10,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'query_var' => 'cast',
'rewrite' => $rewrite,
'capabilities' => $capabilities,
);
register_post_type( 'cast', $args );
}
// Hook into the 'init' action
add_action( 'init', 'register_cpt_cast', 0 );