CRM NetDVSit
if ( ! function_exists('crm') ) {
// Register Custom Post Type
function crm() {
$labels = array(
'name' => 'Customers',
'singular_name' => 'Customer',
'menu_name' => 'Customers',
'name_admin_bar' => 'Customers',
'archives' => 'Customer Archives',
'attributes' => 'Customer Attributes',
'parent_item_colon' => 'Parent Customer:',
'all_items' => 'All Customers',
'add_new_item' => 'Add New Customer',
'add_new' => 'Add New Customer',
'new_item' => 'New Customer',
'edit_item' => 'Edit Customer',
'update_item' => 'Update Customer',
'view_item' => 'View Customer',
'view_items' => 'View Customers',
'search_items' => 'Search Customer',
'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 customer',
'uploaded_to_this_item' => 'Uploaded to this customer',
'items_list' => 'Customers list',
'items_list_navigation' => 'Customers list navigation',
'filter_items_list' => 'Filter customers list',
);
$capabilities = array(
'edit_post' => 'edit_customer',
'read_post' => 'read_customer',
'delete_post' => 'delete_customer',
'edit_posts' => 'edit_customers',
'edit_others_posts' => 'edit_others_customers',
'publish_posts' => 'publish_customer',
'read_private_posts' => 'read_private_customer',
);
$args = array(
'label' => 'Customer',
'description' => 'Customer Address Book',
'labels' => $labels,
'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'custom-fields', 'post-formats', ),
'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 70,
'menu_icon' => 'dashicons-businessman',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => true,
'publicly_queryable' => false,
'capabilities' => $capabilities,
'show_in_rest' => true,
'rest_base' => 'crm',
'rest_controller_class' => 'WP_REST_CRM_Controller',
);
register_post_type( 'crm', $args );
}
add_action( 'init', 'crm', 0 );
}