Announcement
if ( ! function_exists('announcement_post_type') ) {
// Register Custom Post Type
function announcement_post_type() {
$labels = array(
'name' => _x( 'Announcement', 'Post Type General Name', 'men-core' ),
'singular_name' => _x( 'Announcement', 'Post Type Singular Name', 'men-core' ),
'menu_name' => __( 'Announcements', 'men-core' ),
'parent_item_colon' => __( 'Parent Item:', 'men-core' ),
'all_items' => __( 'All Items', 'men-core' ),
'view_item' => __( 'View Item', 'men-core' ),
'add_new_item' => __( 'Add New Item', 'men-core' ),
'add_new' => __( 'Add New', 'men-core' ),
'edit_item' => __( 'Edit Item', 'men-core' ),
'update_item' => __( 'Update Item', 'men-core' ),
'search_items' => __( 'Search Item', 'men-core' ),
'not_found' => __( 'Not found', 'men-core' ),
'not_found_in_trash' => __( 'Not found in Trash', 'men-core' ),
);
$args = array(
'label' => __( 'announcement', 'men-core' ),
'description' => __( 'Announcement database', 'men-core' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'excerpt', 'author', 'custom-fields', ),
'taxonomies' => array( 'announcement_category' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'menu_position' => 20,
'menu_icon' => 'dashicons-testimonial',
'can_export' => true,
'has_archive' => false,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'page',
);
register_post_type( 'announcement', $args );
}
// Hook into the 'init' action
add_action( 'init', 'announcement_post_type', 0 );
}