Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Special Offers

// Register Custom Post Type
function secret_offers() {

	$labels = array(
		'name'                => 'Secret Offers',
		'singular_name'       => 'Secret Offer',
		'menu_name'           => 'Secret Offers',
		'name_admin_bar'      => 'Secret Offer',
		'parent_item_colon'   => 'Parent Offer:',
		'all_items'           => 'All Offers',
		'add_new_item'        => 'Add New Offer',
		'add_new'             => 'Add New',
		'new_item'            => 'New Offer',
		'edit_item'           => 'Edit Offer',
		'update_item'         => 'Update Offer',
		'view_item'           => 'View Offer',
		'search_items'        => 'Search Offer',
		'not_found'           => 'Not found',
		'not_found_in_trash'  => 'Not found in Trash',
	);
	$rewrite = array(
		'slug'                => 'offer',
		'with_front'          => true,
		'pages'               => false,
		'feeds'               => true,
	);
	$args = array(
		'label'               => 'secret_offers',
		'description'         => 'Secret Offers custom post type',
		'labels'              => $labels,
		'supports'            => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'revisions', ),
		'hierarchical'        => false,
		'public'              => true,
		'show_ui'             => true,
		'show_in_menu'        => true,
		'menu_position'       => 5,
		'menu_icon'           => 'dashicons-tickets-alt',
		'show_in_admin_bar'   => true,
		'show_in_nav_menus'   => true,
		'can_export'          => true,
		'has_archive'         => false,
		'exclude_from_search' => true,
		'publicly_queryable'  => true,
		'query_var'           => 'secret_offers',
		'rewrite'             => $rewrite,
		'capability_type'     => 'post',
	);
	register_post_type( 'secret_offers', $args );

}

// Hook into the 'init' action
add_action( 'init', 'secret_offers', 0 );