作者:偶们滴小圈子6868 | 来源:互联网 | 2023-10-11 10:09
本文由编程笔记#小编为大家整理,主要介绍了text cl_projects for Camel相关的知识,希望对你有一定的参考价值。
if ( ! function_exists('cpt_projects') ) {
// Register Custom Post Type
function cpt_projects() {
$labels = array(
'name' => 'project',
'singular_name' => 'Project',
'menu_name' => 'Camel Projects',
'name_admin_bar' => 'Post Type',
'archives' => 'Project Archives',
'attributes' => 'Item Attributes',
'parent_item_colon' => 'Parent Item:',
'all_items' => 'All Projects',
'add_new_item' => 'Add New Project',
'add_new' => 'Add New Project',
'new_item' => 'New Project',
'edit_item' => 'Edit Project',
'update_item' => 'Update Item',
'view_item' => 'View Project',
'view_items' => 'View Projects',
'search_items' => 'Search Item',
'not_found' => 'Not found',
'not_found_in_trash' => 'Not found in Trash',
'featured_image' => 'Featured Image',
'set_featured_image' => 'Set featured image',
'remove_featured_image' => 'Remove featured image',
'use_featured_image' => 'Use as featured image',
'insert_into_item' => 'Insert into item',
'uploaded_to_this_item' => 'Uploaded to this item',
'items_list' => 'Items list',
'items_list_navigation' => 'Items list navigation',
'filter_items_list' => 'Filter items list',
);
$rewrite = array(
'slug' => 'project',
'with_front' => true,
'pages' => true,
'feeds' => true,
);
$args = array(
'label' => 'Project',
'description' => 'Camel builds & projects',
'labels' => $labels,
'supports' => array( 'title', 'editor', 'thumbnail', 'revisions' ),
'taxonomies' => array( 'category' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-admin-home',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => 'projects',
'exclude_from_search' => false,
'publicly_queryable' => true,
'rewrite' => $rewrite,
'capability_type' => 'post',
);
register_post_type( 'project', $args );
}
add_action( 'init', 'cpt_projects', 0 );
}