post_type-2014.07.02-postgallery
if ( ! function_exists('post_gallery') ) {
// Register Custom Post Type
function post_gallery() {
$labels = array(
'name' => _x( 'PostGallerys', 'Post Type General Name', 'cbs' ),
'singular_name' => _x( 'PostGallery', 'Post Type Singular Name', 'cbs' ),
'menu_name' => __( 'PostGallery2014', 'cbs' ),
'parent_item_colon' => __( '上级项目:', 'cbs' ),
'all_items' => __( '全部项目', 'cbs' ),
'view_item' => __( '查看项目', 'cbs' ),
'add_new_item' => __( '新增项目', 'cbs' ),
'add_new' => __( '新增内容', 'cbs' ),
'edit_item' => __( '编辑项目', 'cbs' ),
'update_item' => __( '更新项目', 'cbs' ),
'search_items' => __( '搜索项目', 'cbs' ),
'not_found' => __( '没有结果', 'cbs' ),
'not_found_in_trash' => __( '垃圾箱没有找到内容', 'cbs' ),
);
$rewrite = array(
'slug' => 'gallery',
'with_front' => true,
'pages' => true,
'feeds' => true,
);
$args = array(
'label' => __( 'post_gallery', 'cbs' ),
'description' => __( 'custom PostGallery', 'cbs' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'author', 'custom-fields', 'page-attributes', 'post-formats', ),
'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' => 5,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => true,
'publicly_queryable' => true,
'rewrite' => $rewrite,
'capability_type' => 'page',
);
register_post_type( 'post_gallery', $args );
}
// Hook into the 'init' action
add_action( 'init', 'post_gallery', 0 );
}