Make WordPress Core

Opened 6 years ago

Closed 9 months ago

#49166 closed enhancement (wontfix)

need a function to know if a dashicon exists.

Reported by: sebastienserre's profile sebastienserre Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Administration Keywords: 2nd-opinion has-patch close
Focuses: ui, administration, template Cc:

Description

Hello,

Is there a way to know if a dashicon exist or not?

I think there's currently no function and I don't really know if this is possible to create it or not...

In my mind, it would be a function as <code>is_dashicon_exists( 'dashicons-linkedin')</code> returning true or false.

Do you think it should be possible to create?

Attachments (1)

49166-is_dashicons_exists.diff (9.1 KB) - added by sebastienserre 6 years ago.
Add a kind of proof of concept

Download all attachments as: .zip

Change History (13)

#1 @sebastienserre
6 years ago

  • Keywords needs-patch added

@sebastienserre
6 years ago

Add a kind of proof of concept

This ticket was mentioned in Slack in #core by sebastienserre. View the logs.


6 years ago

#3 @sebastienserre
6 years ago

  • Type changed from defect (bug) to enhancement

#4 @sebastienserre
6 years ago

  • Keywords has-patch added; needs-patch removed

#5 @sebastienserre
6 years ago

As per a discussion with @clorith on Slack #core, I had the idea on a private project where I use the Dashicons.
I made a foreach to display social network and fall on <span class="dashicons dashicons-linkedin"></span> which doesn't exist yet.
SO I searched how to know programatically is the dashicon exists or not

#6 @SergeyBiryukov
6 years ago

  • Component changed from General to Administration

#8 @casiepa
6 years ago

Hi @sebastienserre about 70 new dashicons might appear in WP5.5
Your function is a very nice idea, but you cannot create your own array as it is depending on the WP version that is running.
Please note https://make.wordpress.org/design/2020/04/20/next-steps-for-dashicons/ that dashicons is going out of life, but it will of course still be around for a while. Let's maybe have a chat together?

#9 @sebastienserre
6 years ago

Hello @casiepa
No problem to speak about it :-)

This ticket was mentioned in Slack in #core by sebastienserre. View the logs.


4 years ago

#11 @sebastienserre
10 months ago

  • Keywords close added

Dashicons project has been stopped. I think we can close this ticket

#12 @sabernhardt
9 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

I agree to close.

Note: See TracTickets for help on using tickets.