Register Internet-connected Devices CPT
if ( ! function_exists('invman_register_internet_devices_post_type') ) {
// Register Custom Post Type
function invman_register_internet_devices_post_type() {
$labels = array(
'name' => _x( 'Internet-connected Devices', 'Post Type General Name', 'invman' ),
'singular_name' => _x( 'Internet-connected Device', 'Post Type Singular Name', 'invman' ),
'menu_name' => __( 'Inventory', 'invman' ),
'name_admin_bar' => __( 'Internet Devices', 'invman' ),
'archives' => __( 'Internet-connected Devices list', 'invman' ),
'attributes' => __( 'Internet-connected Devices Attributes', 'invman' ),
'parent_item_colon' => __( 'Parent Internet-connected Device:', 'invman' ),
'all_items' => __( 'All Internet-connected Devices', 'invman' ),
'add_new_item' => __( 'Add New Internet-connected Devices', 'invman' ),
'add_new' => __( 'Add New', 'invman' ),
'new_item' => __( 'New Internet-connected Device', 'invman' ),
'edit_item' => __( 'Edit Internet-connected Device', 'invman' ),
'update_item' => __( 'Update Internet-connected Device', 'invman' ),
'view_item' => __( 'View Internet-connected Device', 'invman' ),
'view_items' => __( 'View Internet-connected Devices', 'invman' ),
'search_items' => __( 'Search Internet-connected Device', 'invman' ),
'not_found' => __( 'Not found', 'invman' ),
'not_found_in_trash' => __( 'Not found in Trash', 'invman' ),
'featured_image' => __( 'Featured Image', 'invman' ),
'set_featured_image' => __( 'Set featured image', 'invman' ),
'remove_featured_image' => __( 'Remove featured image', 'invman' ),
'use_featured_image' => __( 'Use as featured image', 'invman' ),
'insert_into_item' => __( 'Insert into Internet-connected Device', 'invman' ),
'uploaded_to_this_item' => __( 'Uploaded to this Internet-connected Device', 'invman' ),
'items_list' => __( 'Internet-connected Devices list', 'invman' ),
'items_list_navigation' => __( 'Internet-connected Devices list navigation', 'invman' ),
'filter_items_list' => __( 'Filter Internet-connected Devices list', 'invman' ),
);
$args = array(
'label' => __( 'Internet-connected Device', 'invman' ),
'description' => __( 'Devices that are connected to the Internet', 'invman' ),
'labels' => $labels,
'supports' => array( 'title', 'thumbnail', 'revisions' ),
'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'page',
);
register_post_type( 'internet_devices', $args );
}
add_action( 'init', 'invman_register_internet_devices_post_type', 0 );
}