CPT Homes
if ( ! function_exists('gp_properties') ) {
// Register Custom Post Type
function gp_properties() {
$labels = array(
'name' => _x( 'Properties', 'Post Type General Name', 'gp-properties' ),
'singular_name' => _x( 'Property', 'Post Type Singular Name', 'gp-properties' ),
'menu_name' => __( 'Properties', 'gp-properties' ),
'name_admin_bar' => __( 'Properties', 'gp-properties' ),
'archives' => __( 'Properties', 'gp-properties' ),
'attributes' => __( 'Property attributes', 'gp-properties' ),
'parent_item_colon' => __( 'Parent Item:', 'gp-properties' ),
'all_items' => __( 'All properties', 'gp-properties' ),
'add_new_item' => __( 'Add new property', 'gp-properties' ),
'add_new' => __( 'Add New', 'gp-properties' ),
'new_item' => __( 'New property', 'gp-properties' ),
'edit_item' => __( 'Edit property', 'gp-properties' ),
'update_item' => __( 'Update property', 'gp-properties' ),
'view_item' => __( 'View property', 'gp-properties' ),
'view_items' => __( 'View properties', 'gp-properties' ),
'search_items' => __( 'Search property', 'gp-properties' ),
'not_found' => __( 'Not found', 'gp-properties' ),
'not_found_in_trash' => __( 'Not found in Trash', 'gp-properties' ),
'featured_image' => __( 'Featured Image', 'gp-properties' ),
'set_featured_image' => __( 'Set featured image', 'gp-properties' ),
'remove_featured_image' => __( 'Remove featured image', 'gp-properties' ),
'use_featured_image' => __( 'Use as featured image', 'gp-properties' ),
'insert_into_item' => __( 'Insert into property', 'gp-properties' ),
'uploaded_to_this_item' => __( 'Uploaded to this property', 'gp-properties' ),
'items_list' => __( 'Propertes list', 'gp-properties' ),
'items_list_navigation' => __( 'Properties list navigation', 'gp-properties' ),
'filter_items_list' => __( 'Filter properties list', 'gp-properties' ),
);
$args = array(
'label' => __( 'Property', 'gp-properties' ),
'description' => __( 'Properties in our portfolio', 'gp-properties' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'thumbnail', 'comments', 'trackbacks', 'revisions' ),
'taxonomies' => array( 'features', 'areas' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-admin-home',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'page',
);
register_post_type( 'property', $args );
}
add_action( 'init', 'gp_properties', 0 );
}