Astra_Addon_Builder_UI_Controller::fetch_flags_svg( string $icon = '', bool $base = true )
Get an SVG Icon
Description
Parameters
- $icon
-
(string) (Optional) the icon name.
Default value: ''
- $base
-
(bool) (Optional) if the baseline class should be added.
Default value: true
Source
File: classes/builder/type/base/controllers/class-astra-addon-builder-ui-controller.php
public static function fetch_flags_svg( $icon = '', $base = true ) {
$output = '<span class="ahfb-svg-iconset ast-inline-flex' . ( $base ? ' svg-baseline' : '' ) . '">';
if ( ! self::$ast_flags ) {
ob_start();
include_once ASTRA_EXT_DIR . 'assets/flags/svgs.json'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
self::$ast_flags = json_decode( ob_get_clean(), true );
self::$ast_flags = apply_filters( 'astra_flags_svg', self::$ast_flags );
self::$ast_flags = self::$ast_flags;
}
$output .= isset( self::$ast_flags[ $icon ] ) ? self::$ast_flags[ $icon ] : '';
$output .= '</span>';
return $output;
}
Expand full source code Collapse full source code View on Trac