Post Type: short-stay-sync

Home » Snippets » Post Type: short-stay-sync
0

Created with:

Post Type Generator

Visibility: 

public

Creator: Mikhail

Customize with WPTurbo AI
X

Add Snippet To Project

New Project
Add To Existing Project
				/**
 * Registers a custom post type 'short_stay_property'.
 *
 * @since 1.0.0
 *
 * @return void
 */
function create_short_term_property_post_type() : void {
	$labels = [
		'name' => _x( 'Short Stay Propertys', 'Post Type General Name', 'short-stay-sync' ),
		'singular_name' => _x( 'Short Stay Property', 'Post Type Singular Name', 'short-stay-sync' ),
		'menu_name' => __( 'Short Stay Propertys', 'short-stay-sync' ),
		'name_admin_bar' => __( 'Short Stay Propertys', 'short-stay-sync' ),
		'archives' => __( 'Short Stay Propertys Archives', 'short-stay-sync' ),
		'attributes' => __( 'Short Stay Propertys Attributes', 'short-stay-sync' ),
		'parent_item_colon' => __( 'Parent Short Stay Property:', 'short-stay-sync' ),
		'all_items' => __( 'All Short Stay Propertys', 'short-stay-sync' ),
		'add_new_item' => __( 'Add New Short Stay Property', 'short-stay-sync' ),
		'add_new' => __( 'Add New', 'short-stay-sync' ),
		'new_item' => __( 'New Short Stay Property', 'short-stay-sync' ),
		'edit_item' => __( 'Edit Short Stay Property', 'short-stay-sync' ),
		'update_item' => __( 'Update Short Stay Property', 'short-stay-sync' ),
		'view_item' => __( 'View Short Stay Property', 'short-stay-sync' ),
		'view_items' => __( 'View Short Stay Propertys', 'short-stay-sync' ),
		'search_items' => __( 'Search Short Stay Propertys', 'short-stay-sync' ),
		'not_found' => __( 'Short Stay Property Not Found', 'short-stay-sync' ),
		'not_found_in_trash' => __( 'Short Stay Property Not Found in Trash', 'short-stay-sync' ),
		'featured_image' => __( 'Featured Image', 'short-stay-sync' ),
		'set_featured_image' => __( 'Set Featured Image', 'short-stay-sync' ),
		'remove_featured_image' => __( 'Remove Featured Image', 'short-stay-sync' ),
		'use_featured_image' => __( 'Use as Featured Image', 'short-stay-sync' ),
		'insert_into_item' => __( 'Insert into Short Stay Property', 'short-stay-sync' ),
		'uploaded_to_this_item' => __( 'Uploaded to this Short Stay Property', 'short-stay-sync' ),
		'items_list' => __( 'Short Stay Propertys List', 'short-stay-sync' ),
		'items_list_navigation' => __( 'Short Stay Propertys List Navigation', 'short-stay-sync' ),
		'filter_items_list' => __( 'Filter Short Stay Propertys List', 'short-stay-sync' ),
	];
	$labels = apply_filters( 'short_stay_property-labels', $labels );

	$args = [
		'label' => __( 'Short Stay Property', 'short-stay-sync' ),
		'description' => __( 'Manage short-term rental properties with ease using ShortStaySync.', 'short-stay-sync' ),
		'labels' => $labels,
		'supports' => [
			'title',
			'editor',
			'excerpt',
			'thumbnail',
			'custom-fields',
		],
		'taxonomies' => [
			'property_type',
		],
		'hierarchical' => false,
		'public' => true,
		'show_ui' => true,
		'show_in_menu' => true,
		'menu_position' => 5,
		'menu_icon' => 'dashicons-palmtree',
		'show_in_admin_bar' => true,
		'show_in_nav_menus' => false,
		'publicly_queryable' => true,
		'exclude_from_search' => false,
		'has_archive' => true,
		'can_export' => true,
		'capability_type' => 'post',
	];
	$args = apply_filters( 'short_stay_property-args', $args );

	register_post_type( 'short_stay_property', $args );
}
add_action( 'init', 'create_short_term_property_post_type', 0 );
			

Custom Post Registration: short_stay_property

Register an account to save your snippets or go Pro to get more features.