RQGE – Toolbox
// Register Custom Post Type
function register_rqge_tools() {
$labels = array(
'name' => _x( 'Tools', 'Post Type General Name', 'rqge-toolbox' ),
'singular_name' => _x( 'Tool', 'Post Type Singular Name', 'rqge-toolbox' ),
'menu_name' => __( 'Toolbox', 'rqge-toolbox' ),
'name_admin_bar' => __( 'Tool', 'rqge-toolbox' ),
'archives' => __( 'Tool Archives', 'rqge-toolbox' ),
'parent_item_colon' => __( 'Parent Tool:', 'rqge-toolbox' ),
'all_items' => __( 'All Tools', 'rqge-toolbox' ),
'add_new_item' => __( 'Add New Tool', 'rqge-toolbox' ),
'add_new' => __( 'Add New', 'rqge-toolbox' ),
'new_item' => __( 'New Tool', 'rqge-toolbox' ),
'edit_item' => __( 'Edit Tool', 'rqge-toolbox' ),
'update_item' => __( 'Update Tool', 'rqge-toolbox' ),
'view_item' => __( 'View Tool', 'rqge-toolbox' ),
'search_items' => __( 'Search tool', 'rqge-toolbox' ),
'not_found' => __( 'Not found', 'rqge-toolbox' ),
'not_found_in_trash' => __( 'Not found in Trash', 'rqge-toolbox' ),
'featured_image' => __( 'Featured Image', 'rqge-toolbox' ),
'set_featured_image' => __( 'Set featured image', 'rqge-toolbox' ),
'remove_featured_image' => __( 'Remove featured image', 'rqge-toolbox' ),
'use_featured_image' => __( 'Use as featured image', 'rqge-toolbox' ),
'insert_into_item' => __( 'Insert into tool', 'rqge-toolbox' ),
'uploaded_to_this_item' => __( 'Uploaded to this tool', 'rqge-toolbox' ),
'items_list' => __( 'Tools list', 'rqge-toolbox' ),
'items_list_navigation' => __( 'Tools list navigation', 'rqge-toolbox' ),
'filter_items_list' => __( 'Filter tools list', 'rqge-toolbox' ),
);
$rewrite = array(
'slug' => 'boite-a-outils',
'with_front' => true,
'pages' => true,
'feeds' => true,
);
$args = array(
'label' => __( 'Tool', 'rqge-toolbox' ),
'description' => __( 'Tools for RQGE toolbox', 'rqge-toolbox' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', ),
'taxonomies' => array( 'tool_type', ' tool_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-admin-tools',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => false,
'exclude_from_search' => false,
'publicly_queryable' => true,
'rewrite' => $rewrite,
'capability_type' => 'page',
);
register_post_type( 'rqge_tool', $args );
}
add_action( 'init', 'register_rqge_tools', 0 );