DNT Alerts
// Register Custom Post Type
function alert_post_type() {
$labels = array(
'name' => 'Alerts',
'singular_name' => 'Alert',
'menu_name' => 'Hub Alerts',
'parent_item_colon' => 'Parent alert:',
'all_items' => 'All Alerts',
'view_item' => 'View Alert',
'add_new_item' => 'Add New alert',
'add_new' => 'Add New',
'edit_item' => 'Edit Alert',
'update_item' => 'Update Alert',
'search_items' => 'Search Alert',
'not_found' => 'Not found',
'not_found_in_trash' => 'Not found in Trash',
);
$args = array(
'label' => 'alerts',
'description' => 'Hub Alerts',
'labels' => $labels,
'supports' => array( 'title', 'editor', ),
'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' => false,
'has_archive' => false,
'exclude_from_search' => true,
'publicly_queryable' => true,
'capability_type' => 'page',
);
register_post_type( 'alerts', $args );
}
// Hook into the 'init' action
add_action( 'init', 'alert_post_type', 0 );