/* ==========================================================================
Custom Post Types
========================================================================== */
// Store locations - used for contact page
function custom_post_type_store_location() {
'name' => _x('Store Locations', 'Post Type General Name', 'text_domain'),
'singular_name' => _x('Store Location', 'Post Type Singular Name', 'text_domain'),
'menu_name' => __('Store Locations', 'text_domain'),
'parent_item_colon' => __('Parent Store:', 'text_domain'),
'all_items' => __('All Stores', 'text_domain'),
'view_item' => __('View Store', 'text_domain'),
'add_new_item' => __('Add New Store', 'text_domain'),
'add_new' => __('Add New', 'text_domain'),
'edit_item' => __('Edit Store', 'text_domain'),
'update_item' => __('Update Store', 'text_domain'),
'search_items' => __('Search Store', 'text_domain'),
'not_found' => __('Store Not found', 'text_domain'),
'not_found_in_trash' => __('Store Not found in Trash', 'text_domain'),
);
'label' => __('store-location', 'text_domain'),
'description' => __('A collection of all store locations around Australia', 'text_domain'),
'labels' => $labels,
'supports' => array('title', 'page-attributes',),
'taxonomies' => array('state'),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 20,
'menu_icon' => 'dashicons-location-alt',
'show_in_admin_bar' => true,
'show_in_nav_menus' => false,
'can_export' => false,
'has_archive' => false,
'exclude_from_search' => true,
'publicly_queryable' => true,
'capability_type' => 'page',
);
register_post_type('store-location', $args);
}
add_action('init', 'custom_post_type_store_location', 0);
/* ==========================================================================
Custom Taxonomies
========================================================================== */
// State Taxonomy - used for store location post type
function custom_taxonomy_state() {
'name' => _x('States', 'Taxonomy General Name', 'text_domain'),
'singular_name' => _x('State', 'Taxonomy Singular Name', 'text_domain'),
'menu_name' => __('State', 'text_domain'),
'all_items' => __('All States', 'text_domain'),
'parent_item' => __('Parent State', 'text_domain'),
'parent_item_colon' => __('Parent State:', 'text_domain'),
'new_item_name' => __('New State Name', 'text_domain'),
'add_new_item' => __('Add New State', 'text_domain'),
'edit_item' => __('Edit State', 'text_domain'),
'update_item' => __('Update State', 'text_domain'),
'separate_items_with_commas' => __('Separate states with commas', 'text_domain'),
'search_items' => __('Search States', 'text_domain'),
'add_or_remove_items' => __('Add or remove states', 'text_domain'),
'choose_from_most_used' => __('Choose from the most used states', 'text_domain'),
'not_found' => __('State Not Found', 'text_domain'),
);
'labels' => $labels,
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'show_admin_column' => true,
'show_in_nav_menus' => false,
'show_tagcloud' => false,
);
register_taxonomy
('state', array('store-location'), $args);
}
add_action('init', 'custom_taxonomy_state', 0);