change custom post type icon

Solutions on MaxInterview for change custom post type icon by the best coders in the world

showing results for - "change custom post type icon"
Salomé
21 Nov 2017
1// Register Custom Post Type
2function custom_post_type() {
3 
4    $labels = array(
5        'name'                => _x( 'products', 'Post Type General Name', 'text_domain' ),
6        'singular_name'       => _x( 'Product', 'Post Type Singular Name', 'text_domain' ),
7        'menu_name'           => __( 'Products', 'text_domain' ),
8        'parent_item_colon'   => __( 'Parent Item:', 'text_domain' ),
9        'all_items'           => __( 'All Items', 'text_domain' ),
10        'view_item'           => __( 'View Item', 'text_domain' ),
11        'add_new_item'        => __( 'Add New Item', 'text_domain' ),
12        'add_new'             => __( 'Add New', 'text_domain' ),
13        'edit_item'           => __( 'Edit Item', 'text_domain' ),
14        'update_item'         => __( 'Update Item', 'text_domain' ),
15        'search_items'        => __( 'Search Item', 'text_domain' ),
16        'not_found'           => __( 'Not found', 'text_domain' ),
17        'not_found_in_trash'  => __( 'Not found in Trash', 'text_domain' ),
18    );
19    $args = array(
20        'label'               => __( 'Products', 'text_domain' ),
21        'description'         => __( 'Post Type Description', 'text_domain' ),
22        'labels'              => $labels,
23        'supports'            => array( ),
24        'taxonomies'          => array( 'category', 'post_tag' ),
25        'hierarchical'        => false,
26        'public'              => true,
27        'show_ui'             => true,
28        'show_in_menu'        => true,
29        'show_in_nav_menus'   => true,
30        'show_in_admin_bar'   => true,
31        'menu_position'       => 5,
32        'menu_icon'           => 'dashicons-cart',
33        'can_export'          => true,
34        'has_archive'         => true,
35        'exclude_from_search' => false,
36        'publicly_queryable'  => true,
37        'capability_type'     => 'page',
38    );
39    register_post_type( 'Products', $args );
40 
41}
42 
43// Hook into the 'init' action
44add_action( 'init', 'custom_post_type', 0 );
45
similar questions
queries leading to this page
change custom post type icon