__('Properties', 'property-submitter'),
'singular_name' => __('Property', 'property-submitter'),
'add_new' => __('Add New', 'property-submitter'),
'add_new_item' => __('Add New Property', 'property-submitter'),
'edit_item' => __('Edit Property', 'property-submitter'),
'new_item' => __('New Property', 'property-submitter'),
'all_items' => __('All Properties', 'property-submitter'),
'view_item' => __('View Property', 'property-submitter'),
'search_items' => __('Search Properties', 'property-submitter'),
'not_found' => __('No properties found', 'property-submitter'),
);
$capability_type = array('property', 'properties');
$args = array(
'labels' => $labels,
'public' => true,
'has_archive' => true,
'supports' => array('title', 'editor', 'thumbnail', 'author', 'custom-fields', 'excerpt'),
'capability_type' => $capability_type,
'map_meta_cap' => true,
'show_in_rest' => true,
'rewrite' => array('slug' => 'properties'),
);
register_post_type('property', $args);
}
public function on_activate() {
// Ensure CPT is registered so rewrite rules work
$this->register_property_post_type();
flush_rewrite_rules();
// Add custom role for sellers if not exists
if (!get_role('property_seller')) {
add_role(
'property_seller',
'Property Seller',
array(
'read' => true,
'upload_files' => true,
'edit_posts' => true,
)
);
