Tribe__Events__Community__Main::locatePublishStatusIcon( string $icon_name )
Find the location of the icon that is being searched for.
Contents
Parameters
- $icon_name
-
(string) (Required) - File name of the icon ( pending, draft, future, publish ).
Return
(string)
Source
File: src/Tribe/Main.php
public function locatePublishStatusIcon ( $icon_name ) {
/**
* File extension for the publish status icons.
*
* @since 4.8.14
*
* @version 4.8.14
*
* @param string $extension File extension, including the period.
*
*/
$file_extension = apply_filters( 'tribe_community_events_event_status_icon_extension', '.svg' );
$icon = str_replace( ' ', '-', $icon_name ) . $file_extension;
// Used to overwrite our default icons.
$fileLocationList = [
get_stylesheet_directory() . '/events/community/' . esc_attr( $icon ),
get_template_directory_uri() . '/events/community/' . esc_attr( $icon ),
];
foreach ( $fileLocationList as $file ) {
if ( file_exists ( $file ) ) {
return $file;
}
}
// No icons found, use our default icons.
return $this->pluginUrl . 'src/resources/images/' . esc_attr( $icon );
}
Changelog
| Version | Description |
|---|---|
| 4.8.14 | Introduced. |