Opened 12 years ago
Closed 12 years ago
#19878 closed enhancement (invalid)
Allow for a Custom Screen Icon
Reported by: | wpsmith | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | General | Keywords: | has-patch close |
Focuses: | Cc: |
Description
It would be nice to be able to use screen_icon for custom icons. This could easily be done either through filters and/or allowing a custom icon to be passed.
Attachments (1)
Change History (8)
#2
follow-up:
↓ 3
@
12 years ago
I think someone should try to defend the use of an empty div with CSS to display an image vs. using an actual image in the source. As far as I can tell, the way it's being done is wrong.
Seems to me, you should be able to pass an image URI to screen_icon()
and have that output inside the div.
<div class="icon32"><img src="/path/to/image.png" alt="" /></div>
#3
in reply to:
↑ 2
;
follow-up:
↓ 4
@
12 years ago
Replying to nathanrice:
I think someone should try to defend the use of an empty div with CSS to display an image vs. using an actual image in the source. As far as I can tell, the way it's being done is wrong.
These images are presentational/decorative by nature, and do not hold semantic value.
#4
in reply to:
↑ 3
@
12 years ago
Replying to nacin:
These images are presentational/decorative by nature, and do not hold semantic value.
Shouldn't they then be the background image of the H2?
#5
@
12 years ago
They could, but that's not how it was architected back in 2.7. No use changing it now. If I had to guess, there were some efforts required to ensure that markup was easily compatible with plugin pages created for 2.6 and earlier, but I don't have any particular insight.
#6
follow-up:
↓ 7
@
12 years ago
Nathan, don't forget that only the approach of a <div> with a background image gives you the possibility to use a CSS sprite for the image, which is a great benefit, and which is something core and some plugins do.
#7
in reply to:
↑ 6
@
12 years ago
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed
Replying to TobiasBg:
Nathan, don't forget that only the approach of a <div> with a background image gives you the possibility to use a CSS sprite for the image, which is a great benefit, and which is something core and some plugins do.
That's the reason I was looking for. Thanks.
I don't think that this filter is actually necessary.
When you pass a string to
screen_icon()
, likethe resulting
<div>
will have the ID#icon-my-plugin
. You'll just need to add something liketo the CSS file that your (or most) plugins load on their admin screens anyway. I don't see the need for adding a filter to add extra inline CSS styling.
Suggesting wont-fix.