Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Market

// Register Custom Post Type
function register_market_post_type() {

	$labels = array(
		'name'                => _x( 'Markets', 'Post Type General Name', 'text_domain' ),
		'singular_name'       => _x( 'Market', 'Post Type Singular Name', 'text_domain' ),
		'menu_name'           => __( 'Markets', 'text_domain' ),
		'parent_item_colon'   => __( 'Parent Market:', 'text_domain' ),
		'all_items'           => __( 'All Markets', 'text_domain' ),
		'view_item'           => __( 'View Market', 'text_domain' ),
		'add_new_item'        => __( 'Add New Market', 'text_domain' ),
		'add_new'             => __( 'Add New', 'text_domain' ),
		'edit_item'           => __( 'Edit Market', 'text_domain' ),
		'update_item'         => __( 'Update Market', 'text_domain' ),
		'search_items'        => __( 'Search Market', 'text_domain' ),
		'not_found'           => __( 'Not found', 'text_domain' ),
		'not_found_in_trash'  => __( 'Not found in Trash', 'text_domain' ),
	);
	$args = array(
		'labels'              => $labels,
		'supports'            => array( 'revisions', ),
		'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-location',
		'can_export'          => true,
		'has_archive'         => false,
		'exclude_from_search' => true,
		'publicly_queryable'  => true,
		'rewrite'             => false,
		'capability_type'     => 'page',
	);
	register_post_type( 'market', $args );

}

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