Stores CPT (MM)
if ( ! function_exists('stores_cpt') ) {
// Register Custom Post Type
function stores_cpt() {
$labels = array(
'name' => 'Stores',
'singular_name' => 'Store',
'menu_name' => 'Stores',
'name_admin_bar' => 'Stores',
'archives' => 'All Stores',
'attributes' => 'Item Attributes',
'parent_item_colon' => 'Parent Item:',
'all_items' => 'All Stores',
'add_new_item' => 'Add New Store',
'add_new' => 'Add New Store',
'new_item' => 'New Store',
'edit_item' => 'Edit Store',
'update_item' => 'Update Store',
'view_item' => 'View Store',
'view_items' => 'View Stores',
'search_items' => 'Search Store',
'not_found' => 'Not found',
'not_found_in_trash' => 'Not found in Trash',
'featured_image' => 'Store Image',
'set_featured_image' => 'Set Store Image',
'remove_featured_image' => 'Remove Store Image',
'use_featured_image' => 'Use as Store Image',
'insert_into_item' => 'Insert into Store',
'uploaded_to_this_item' => 'Uploaded to this Store',
'items_list' => 'Stores Directory',
'items_list_navigation' => 'Store directory navigation',
'filter_items_list' => 'Filter Stores',
);
$args = array(
'label' => 'Store',
'description' => 'Merivale Stores',
'labels' => $labels,
'supports' => array( 'title', 'editor', 'thumbnail' ),
'taxonomies' => array( 'store_cat' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-store',
'show_in_admin_bar' => false,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'page',
'show_in_rest' => true,
);
register_post_type( 'stores', $args );
}
add_action( 'init', 'stores_cpt', 0 );
}