<?php
if (!defined('ABSPATH')) exit;
// =========================================================================
// CUSTOM POST TYPE: Property
// =========================================================================
function custom_post_type_property() {
$labels = array(
'name' => _x('Properties', 'Post Type General Name', 'wpflames'),
'singular_name' => _x('Property', 'Post Type Singular Name', 'wpflames'),
'menu_name' => __('Properties', 'wpflames'),
'all_items' => __('All Properties', 'wpflames'),
'view_item' => __('View Property', 'wpflames'),
'add_new_item' => __('Add New Property', 'wpflames'),
'add_new' => __('Add New', 'wpflames'),
'edit_item' => __('Edit Property', 'wpflames'),
'update_item' => __('Update Property', 'wpflames'),
'search_items' => __('Search Properties', 'wpflames'),
'not_found' => __('No Properties found', 'wpflames'),
'not_found_in_trash' => __('No Properties found in Trash', 'wpflames'),
'parent_item_colon' => __('Parent Property:', 'wpflames'),
);
$args = array(
'label' => __('property', 'wpflames'),
'description' => __('Properties', 'wpflames'),
'labels' => $labels,
'supports' => array(
'title',
),
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-admin-multisite',
'can_export' => true,
'has_archive' => false,
'exclude_from_search' => false,
'publicly_queryable' => true,
'show_in_rest' => true,
'show_in_graphql' => true,
'graphql_single_name' => 'Property',
'graphql_plural_name' => 'Properties',
'capability_type' => 'page',
'rewrite' => array(
'slug' => 'property',
'hierarchical' => true,
'with_front' => false,
),
);
register_post_type('property', $args);
}
add_action('init', 'custom_post_type_property', 0);
Leave a Reply