Opened 3 months ago
Last modified 9 days ago
#49166 new enhancement
need a function to know if a dashicon exists.
| Reported by: |  | Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal | 
| Severity: | normal | Version: | |
| Component: | Administration | Keywords: | 2nd-opinion has-patch | 
| 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)
Change History (8)
    
      
         
        
This ticket was mentioned in Slack in #core by sebastienserre. View the logs.
      
      
3 months ago
    
    
  
              
    
      
    #5
  
    
        
          
             @
 @
            
3 months 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 
    
      
    #7
  
    
        
          
             @
 @
            
9 days ago
        
    
  
  
    
Related: #meta4973

 
                       
               
 
			 
                
Add a kind of proof of concept