Content Library
if ( ! function_exists('register_reports_library') ) {
// Register Custom Post Type
function register_reports_library() {
$labels = array(
'name' => _x( 'Reports', 'Post Type General Name', 'thresher-m3' ),
'singular_name' => _x( 'Report', 'Post Type Singular Name', 'thresher-m3' ),
'menu_name' => __( 'Reports', 'thresher-m3' ),
'name_admin_bar' => __( 'Reports', 'thresher-m3' ),
'archives' => __( 'Report Library', 'thresher-m3' ),
'attributes' => __( 'Report Attributes', 'thresher-m3' ),
'parent_item_colon' => __( 'Parent Report', 'thresher-m3' ),
'all_items' => __( 'All Reports', 'thresher-m3' ),
'add_new_item' => __( 'Add New Report', 'thresher-m3' ),
'add_new' => __( 'Add New', 'thresher-m3' ),
'new_item' => __( 'New Report', 'thresher-m3' ),
'edit_item' => __( 'Edit Report', 'thresher-m3' ),
'update_item' => __( 'Update Report', 'thresher-m3' ),
'view_item' => __( 'View Report', 'thresher-m3' ),
'view_items' => __( 'View Report', 'thresher-m3' ),
'search_items' => __( 'Search Report', 'thresher-m3' ),
'not_found' => __( 'Not Found', 'thresher-m3' ),
'not_found_in_trash' => __( 'Not found in Trash', 'thresher-m3' ),
'featured_image' => __( 'Featured Image', 'thresher-m3' ),
'set_featured_image' => __( 'Set featured image', 'thresher-m3' ),
'remove_featured_image' => __( 'Remove featured image', 'thresher-m3' ),
'use_featured_image' => __( 'Use as featured image', 'thresher-m3' ),
'insert_into_item' => __( 'Insert into report', 'thresher-m3' ),
'uploaded_to_this_item' => __( 'Uploaded to this report', 'thresher-m3' ),
'items_list' => __( 'Reports list', 'thresher-m3' ),
'items_list_navigation' => __( 'Reports list navigation', 'thresher-m3' ),
'filter_items_list' => __( 'Filter reports list', 'thresher-m3' ),
);
$rewrite = array(
'slug' => 'report',
'with_front' => true,
'pages' => true,
'feeds' => true,
);
$args = array(
'label' => __( 'Report', 'thresher-m3' ),
'description' => __( 'The Reports Library', 'thresher-m3' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'revisions', 'page-attributes' ),
'taxonomies' => array( 'report_categories', 'custom_report_clients' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-book-alt',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => 'library',
'exclude_from_search' => false,
'publicly_queryable' => true,
'rewrite' => $rewrite,
'capability_type' => 'page',
);
register_post_type( 'reports', $args );
}
add_action( 'init', 'register_reports_library', 0 );
}