WordPress / dashicons

Dashicons, the WordPress admin icon font. For the official resource, please see the WordPress Developer Hub.
https://developer.wordpress.org/resource/dashicons/
GNU General Public License v3.0
564 stars 185 forks source link

Business Woman/Person doesn't work for CPT Menu Icon #376

Closed RachelRVasquez closed 5 years ago

RachelRVasquez commented 5 years ago

Hi!

I'm not sure if this is the right place to report it - but it looks like the business person/woman icons were added back in 2018.

I'm currently trying to create a custom post type using one of those icons, and neither of them show as a menu icon when I set them. However if I use the businessman icon, that one works. 🤔 Is this a Dashicons issue or a WordPress issue?

ntwb commented 5 years ago

Can you supply the relevant code snippet or snippets you've tried please?

RachelRVasquez commented 5 years ago

@ntwb Here is the code below. For now I put the "dashicons-admin-site" icon instead of "dashicons-businesswoman" because it doesn't work.

$labels = [
                'name'                  => _x( 'Careers', 'Post Type General Name', 'isda_career' ),
                'singular_name'         => _x( 'Career', 'Post Type Singular Name', 'isda_career' ),
                'menu_name'             => __( 'Careers', 'isda_career' ),
                'name_admin_bar'        => __( 'Career', 'isda_career' ),
                'archives'              => __( 'Careers', 'isda_career' ),
                'attributes'            => __( 'Career Attributes', 'isda_career' ),
                'parent_item_colon'     => __( 'Parent Career:', 'isda_career' ),
                'all_items'             => __( 'Careers', 'isda_career' ),
                'add_new_item'          => __( 'Add New Career', 'isda_career' ),
                'add_new'               => __( 'Add New', 'isda_career' ),
                'new_item'              => __( 'New Career', 'isda_career' ),
                'edit_item'             => __( 'Edit Career', 'isda_career' ),
                'update_item'           => __( 'Update Career', 'isda_career' ),
                'view_item'             => __( 'View Career', 'isda_career' ),
                'view_items'            => __( 'View Careers', 'isda_career' ),
                'search_items'          => __( 'Search Careers', 'isda_career' ),
                'not_found'             => __( 'Not found', 'isda_career' ),
                'not_found_in_trash'    => __( 'Not found in Trash', 'isda_career' ),
                'featured_image'        => __( 'Featured Image', 'isda_career' ),
                'set_featured_image'    => __( 'Set featured image', 'isda_career' ),
                'remove_featured_image' => __( 'Remove featured image', 'isda_career' ),
                'use_featured_image'    => __( 'Use as featured image', 'isda_career' ),
                'insert_into_item'      => __( 'Insert into career', 'isda_career' ),
                'uploaded_to_this_item' => __( 'Uploaded to this career', 'isda_career' ),
                'items_list'            => __( 'Careers list', 'isda_career' ),
                'items_list_navigation' => __( 'Careers list navigation', 'isda_career' ),
                'filter_items_list'     => __( 'Filter careers list', 'isda_career' ),
            ];

            $args = [
                'description'         => __( 'Post type to define an career', 'isda_career' ),
                'labels'              => $labels,
                'supports'            => [ 'title', 'revisions', 'thumbnail' ],
                'taxonomies'          => [ 'category', 'location' ],
                'public'              => true,
                'show_ui'             => true,
                'show_in_admin_bar'   => true,
                'show_in_nav_menus'   => true,
                'can_export'          => true,
                'has_archive'         => false,
                'exclude_from_search' => false,
                'publicly_queryable'  => true,
                'capability_type'     => 'post',
                'show_in_rest'        => true,
                'menu_icon'           => 'dashicons-admin-site',
            ];

            register_post_type( 'career', $args );
ntwb commented 5 years ago

Strange, it appears to be spelt correctly:

https://github.com/WordPress/wordpress-develop/blob/56d4e7fb86f3ecdda93e9a4f79f84f1655c85174/src/wp-includes/css/dashicons.css#L271-L281

What about businessperson, does that work?

https://developer.wordpress.org/resource/dashicons/#businesswoman https://developer.wordpress.org/resource/dashicons/#businessperson https://developer.wordpress.org/resource/dashicons/#businessman

RachelRVasquez commented 5 years ago

Nope, businessperson doesn't work either. Just business man. It is definitely strange.

On Fri, Aug 30, 2019, 4:39 AM Stephen Edgar notifications@github.com wrote:

Strange, it appears to be spelt correctly:

https://github.com/WordPress/wordpress-develop/blob/56d4e7fb86f3ecdda93e9a4f79f84f1655c85174/src/wp-includes/css/dashicons.css#L271-L281

What about businessperson, does that work?

https://developer.wordpress.org/resource/dashicons/#businesswoman https://developer.wordpress.org/resource/dashicons/#businessperson https://developer.wordpress.org/resource/dashicons/#businessman

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/WordPress/dashicons/issues/376?email_source=notifications&email_token=ACOFVPCLFRTZDE5AJY6MWOLQHDMFVA5CNFSM4IQIMOH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5Q7Y2Q#issuecomment-526515306, or mute the thread https://github.com/notifications/unsubscribe-auth/ACOFVPCQYOHADOSTELKW4UDQHDMFVANCNFSM4IQIMOHQ .

ntwb commented 5 years ago

Can you double check the wp-includes/css/dashicons.css file for the following:


.dashicons-businessman:before {
    content: "\f338";
}

.dashicons-businessperson:before {
    content: "\f12e";
}

.dashicons-businesswoman:before {
    content: "\f12f";
}
nate-allen commented 5 years ago

Is your version of WordPress less than 5.2? That's when those icons were added to core.

RachelRVasquez commented 5 years ago

Ah hah! That might be it - I was using 5.1.2. I'm going to upgrade and see if that resolves it @nate-allen

RachelRVasquez commented 5 years ago

Yep that's what it was. It was good to upgrade anyway because of the new "site health" page added as well. Super helpful. Thanks @nate-allen @ntwb