Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Post Type Properties

page
rest-yes?

// Register Custom Post Type
function properties() {

	$labels = array(
		'name'                  => 'Properties',
		'singular_name'         => 'Property',
		'menu_name'             => 'Properties',
		'name_admin_bar'        => 'Property',
		'archives'              => 'Property Archives',
		'attributes'            => 'Property Attributes',
		'parent_item_colon'     => 'Parent Property:',
		'all_items'             => 'All Properties',
		'add_new_item'          => 'Add New Property',
		'add_new'               => 'Add New',
		'new_item'              => 'New Property',
		'edit_item'             => 'Edit Property',
		'update_item'           => 'Update Property',
		'view_item'             => 'View Property',
		'view_items'            => 'View Properties',
		'search_items'          => 'Search Property',
		'not_found'             => 'Not found',
		'not_found_in_trash'    => 'Not found in Trash',
		'featured_image'        => 'Featured Image',
		'set_featured_image'    => 'Set featured image',
		'remove_featured_image' => 'Remove featured image',
		'use_featured_image'    => 'Use as featured image',
		'insert_into_item'      => 'Insert into item',
		'uploaded_to_this_item' => 'Uploaded to this property',
		'items_list'            => 'Property list',
		'items_list_navigation' => 'Property list navigation',
		'filter_items_list'     => 'Filter property list',
	);
	$rewrite = array(
		'slug'                  => 'shop/properties',
		'with_front'            => true,
		'pages'                 => true,
		'feeds'                 => true,
	);
	$args = array(
		'label'                 => 'Property',
		'description'           => 'Property information page.',
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor', 'thumbnail', 'comments', 'trackbacks', 'revisions', 'custom-fields', 'page-attributes', 'post-formats' ),
		'taxonomies'            => array( 'region', 'city', 'country', 'purchase_price', 'rental', 'vacation_rental', 'nightly_rate' ),
		'hierarchical'          => true,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'building',
		'show_in_admin_bar'     => true,
		'show_in_nav_menus'     => true,
		'can_export'            => true,
		'has_archive'           => 'shop/properties',
		'exclude_from_search'   => false,
		'publicly_queryable'    => true,
		'query_var'             => 'property',
		'rewrite'               => $rewrite,
		'capability_type'       => 'page',
		'show_in_rest'          => true,
	);
	register_post_type( 'properties', $args );

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