Deals
// Register Custom Post Type
function deal() {
$labels = array(
'name' => 'Deals',
'singular_name' => 'Deal',
'menu_name' => 'Post Type',
'name_admin_bar' => 'Post Type',
'parent_item_colon' => 'Parent Item:',
'all_items' => 'All Deals',
'add_new_item' => 'Add New Deal',
'add_new' => 'Add New',
'new_item' => 'New Deal',
'edit_item' => 'Edit Deal',
'update_item' => 'Update Deal',
'view_item' => 'View Deal',
'search_items' => 'Search Deals',
'not_found' => 'These deals were so good, they're gone!',
'not_found_in_trash' => 'These deals have left the building.',
);
$rewrite = array(
'slug' => 'deal',
'with_front' => true,
'pages' => true,
'feeds' => true,
);
$capabilities = array(
'edit_post' => 'edit_deal',
'read_post' => 'read_deal',
'delete_post' => 'delete_deals',
'edit_posts' => 'edit_deals',
'edit_others_posts' => 'edit_others_deals',
'publish_posts' => 'publish_deals',
'read_private_posts' => 'read_private_deals',
);
$args = array(
'label' => 'deal',
'description' => 'Manage your daily, and first time patient deals. ',
'labels' => $labels,
'supports' => array( 'title', 'editor', 'author', 'revisions', ),
'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-tag',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => false,
'exclude_from_search' => true,
'publicly_queryable' => true,
'rewrite' => $rewrite,
'capabilities' => $capabilities,
);
register_post_type( 'deal', $args );
}
// Hook into the 'init' action
add_action( 'init', 'deal', 0 );