=' ) ) {
return apply_filters( 'astra_is_svg_icons', $astra_settings['can-update-astra-icons-svg'] ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
}
return false;
}
/**
* Get SVG icons.
* Returns the SVG icon you want to display.
*
* @since 3.3.0
*
* @param string $icon Key for the SVG you want to load.
* @param boolean $is_echo whether to echo the output or return.
* @param boolean $replace load close markup for SVG.
* @param string $menu_location Creates dynamic filter for passed parameter.
*
* @return string SVG for passed key.
*/
public static function get_icons( $icon, $is_echo = false, $replace = false, $menu_location = 'main' ) {
$output = '';
if ( true === self::is_svg_icons() ) {
switch ( $icon ) {
case 'menu-bars':
$output = '';
break;
case 'close':
$output = '';
break;
case 'search':
$output = '';
break;
case 'arrow':
$output = '';
break;
case 'cart':
$output = '';
break;
case 'bag':
$output = '';
break;
case 'basket':
$output = '';
break;
default:
$output = '';
break;
}
if ( $replace ) {
$output .= '';
}
} else {
if ( 'menu-bars' === $icon ) {
$menu_icon = apply_filters( 'astra_' . $menu_location . '_menu_toggle_icon', 'menu-toggle-icon' ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
$output = '';
}
}
$output = apply_filters( 'astra_svg_icon_element', $output, $icon ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
$classes = array(
'ast-icon',
'icon-' . $icon,
);
$output = apply_filters(
'astra_svg_icon', // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
sprintf(
'%2$s',
implode( ' ', $classes ),
$output
),
$icon
);
if ( ! $is_echo ) {
return $output;
}
echo wp_kses(
$output,
array(
'span' => array( 'class' => array() ),
'svg' => array(
'xmlns:xlink' => array(),
'version' => array(),
'id' => array(),
'x' => array(),
'y' => array(),
'enable-background' => array(),
'xml:space' => array(),
'class' => array(),
'aria-hidden' => array(),
'aria-labelledby' => array(),
'role' => array(),
'xmlns' => array(),
'width' => array(),
'height' => array(),
'viewbox' => array(),
),
'g' => array( 'fill' => array() ),
'title' => array( 'title' => array() ),
'path' => array(
'd' => array(),
'fill' => array(),
),
)
);
}
}
new Astra_Icons();
}