WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 4 years ago

Last modified 4 years ago

#27414 closed enhancement (wontfix)

Dashicons for the Right Now widget

Reported by: jmlapam Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Administration Keywords: reporter-feedback close
Focuses: ui Cc:

Description

Hi,

We now use this great font Dashicons to style our custom post type UI instead of loading a lot of images.

What I can't solve is this :

I've created my custom post types, they have their dashicons. But I want to display them on the right now widget (at glance) so I use the filter dashboard_glance_items.

In my function I use a simple get_post_types() to retrieve all my new CPTs. Ok that's cool but I've assigned icons to them so I set the menu_icon argument of get_post_types()to true to get it.

And If I want to display it, I do something like this :

$menu_icon = $post_type->menu_icon;

But after that I can't make it work simply because there's default style.

Of course this can be easily fixed with a CSS in admin where I could override the default styles.

Just wonder if that could be relevant to change the markup just a little bit to make it work like it works for custom post type UI in menus.

Hope I'm clear.
Regards.

Change History (11)

#1 @jmlapam
6 years ago

  • Keywords ui-feedback added

Anybody?
Just tell me if you find it relevant or not.
Regards.

#2 @jmlapam
6 years ago

  • Version 3.8.1 deleted

I'm bumping it up, the issue comes from here :

#dashboard_right_now li a:before, #dashboard_right_now li span:before {
/* content: '\f159'; just put it in comment and it will do the job */
font: 400 20px/1 dashicons;
speak: none;
display: block;
float: left;
margin: 0 5px 0 0;
padding: 0;
text-indent: 0;
text-align: center;
position: relative;
-webkit-font-smoothing: antialiased;
text-decoration: none!important;
}

It's just that the link have a dashicons by default. If not everything works fine.
By default we do not have cpts and custom taxonomies so I don't understand the fallback.

Last edited 6 years ago by jmlapam (previous) (diff)

#3 follow-up: @helen
6 years ago

  • Keywords ui-feedback removed

It can't be fixed that way. We need to keep other items in consideration, especially those that are already relying on this behavior. You can add other items there - it is not restricted to CPTs and taxonomies, nor do taxonomies have an icon defined in the menu.

I don't have a strong opinion either way on this, but I also don't have any thoughts on what a good fix would be. I certainly understand that adding a CPT should get the same icon, but since there's nothing in the filter that tells us what exactly is being added, not sure how much magic core can really do.

#4 in reply to: ↑ 3 @jmlapam
6 years ago

Replying to helen:

It can't be fixed that way. We need to keep other items in consideration, especially those that are already relying on this behavior. You can add other items there - it is not restricted to CPTs and taxonomies, nor do taxonomies have an icon defined in the menu.

I don't have a strong opinion either way on this, but I also don't have any thoughts on what a good fix would be. I certainly understand that adding a CPT should get the same icon, but since there's nothing in the filter that tells us what exactly is being added, not sure how much magic core can really do.

Hi,

thanks for your comment but which items rely on this default dashicons (this is the "marker" dashicons, makes no sense) ?

#5 follow-up: @helen
6 years ago

Anything you add right now gets that icon. If you remove the icon from the CSS, you get no icon at all unless you specify one otherwise. I'm not commenting on the sensibility of the icon itself, only that the fix you have suggested has effects on users beyond yourself.

#6 in reply to: ↑ 5 @jmlapam
6 years ago

Replying to helen:

Anything you add right now gets that icon. If you remove the icon from the CSS, you get no icon at all unless you specify one otherwise. I'm not commenting on the sensibility of the icon itself, only that the fix you have suggested has effects on users beyond yourself.

Yeah true for that but makes no sense to have default icon that does not mean anything (accessibility).

#7 @SergeyBiryukov
6 years ago

  • Component changed from Appearance to Administration

#8 @Latz
5 years ago

Related: #26571

#9 @swissspidy
4 years ago

  • Keywords reporter-feedback close added

@jmlapam Would the proposed patch in #26571 (adds a class to the <li> for custom items) help with this? It would make it easier to override the styles for a specific 'At a Glance' item.

#10 @jmlapam
4 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

#11 @DrewAPicture
4 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.