Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Extra Content

// Register Custom Post Type
function InitializeBonusContent() {

	$labels = array(
		'name'                  => _x( 'Extra Content', 'Post Type General Name', 'br8kthru_translate' ),
		'singular_name'         => _x( 'Extra Content', 'Post Type Singular Name', 'br8kthru_translate' ),
		'menu_name'             => __( 'Extra Content', 'br8kthru_translate' ),
		'name_admin_bar'        => __( 'Extra Content', 'br8kthru_translate' ),
		'archives'              => __( 'Extra Content Archives', 'br8kthru_translate' ),
		'attributes'            => __( 'Extra Content Attributes', 'br8kthru_translate' ),
		'parent_item_colon'     => __( 'Parent Extra Content:', 'br8kthru_translate' ),
		'all_items'             => __( 'All Extra Content', 'br8kthru_translate' ),
		'add_new_item'          => __( 'Add New Extra Content', 'br8kthru_translate' ),
		'add_new'               => __( 'Add New', 'br8kthru_translate' ),
		'new_item'              => __( 'New Extra Content', 'br8kthru_translate' ),
		'edit_item'             => __( 'Edit Extra Content', 'br8kthru_translate' ),
		'update_item'           => __( 'Update Extra Content', 'br8kthru_translate' ),
		'view_item'             => __( 'View Extra Content', 'br8kthru_translate' ),
		'view_items'            => __( 'View Extra Content', 'br8kthru_translate' ),
		'search_items'          => __( 'Search Extra Content', 'br8kthru_translate' ),
		'not_found'             => __( 'Not found', 'br8kthru_translate' ),
		'not_found_in_trash'    => __( 'Not found in Trash', 'br8kthru_translate' ),
		'featured_image'        => __( 'Featured Image', 'br8kthru_translate' ),
		'set_featured_image'    => __( 'Set featured image', 'br8kthru_translate' ),
		'remove_featured_image' => __( 'Remove featured image', 'br8kthru_translate' ),
		'use_featured_image'    => __( 'Use as featured image', 'br8kthru_translate' ),
		'insert_into_item'      => __( 'Insert into extra content', 'br8kthru_translate' ),
		'uploaded_to_this_item' => __( 'Uploaded to this extra content', 'br8kthru_translate' ),
		'items_list'            => __( 'Extra Content list', 'br8kthru_translate' ),
		'items_list_navigation' => __( 'Extra Content list navigation', 'br8kthru_translate' ),
		'filter_items_list'     => __( 'Filter Extra Content list', 'br8kthru_translate' ),
	);
	$rewrite = array(
		'slug'                  => 'extra_content',
		'with_front'            => true,
		'pages'                 => false,
		'feeds'                 => false,
	);
	$args = array(
		'label'                 => __( 'Extra Content', 'br8kthru_translate' ),
		'description'           => __( 'Add-on content for pages and posts -- can be gated or non-gated. Has a shortcode that works concurrently.', 'br8kthru_translate' ),
		'labels'                => $labels,
		'supports'              => array( 'title' ),
		'taxonomies'            => array( 'category' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 20,
		'menu_icon'             => 'dashicons-plus-alt',
		'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,
		'capability_type'       => 'page',
	);
	register_post_type( 'extra_content', $args );

}
add_action( 'init', 'InitializeBonusContent', 0 );