| 1 |
<?php |
| 2 |
/** |
| 3 |
* Backward-compatibility wrappers for global functions. |
| 4 |
* |
| 5 |
* These functions are used by block render templates in src/ and must |
| 6 |
* remain available in the global namespace. |
| 7 |
* |
| 8 |
* @package GutSlider |
| 9 |
* @since 3.0.0 |
| 10 |
*/ |
| 11 |
|
| 12 |
if ( ! defined( 'ABSPATH' ) ) { |
| 13 |
exit; |
| 14 |
} |
| 15 |
|
| 16 |
if ( ! function_exists( 'gutslider_display_icon' ) ) { |
| 17 |
/** |
| 18 |
* Retrieve an SVG icon by key. |
| 19 |
* |
| 20 |
* @since 1.0.0 |
| 21 |
* |
| 22 |
* @param string $icon Icon identifier key. |
| 23 |
* @return string SVG markup or empty string. |
| 24 |
*/ |
| 25 |
function gutslider_display_icon( string $icon = '' ): string { |
| 26 |
return \GutSlider\Icons\Icons::get( $icon ); |
| 27 |
} |
| 28 |
} |
| 29 |
|
| 30 |
if ( ! function_exists( 'gutslider_allowed_svg_tags' ) ) { |
| 31 |
/** |
| 32 |
* Get allowed SVG tags for wp_kses sanitization. |
| 33 |
* |
| 34 |
* @since 1.0.0 |
| 35 |
* |
| 36 |
* @return array<string, array<string, bool>> Allowed SVG tags and attributes. |
| 37 |
*/ |
| 38 |
function gutslider_allowed_svg_tags(): array { |
| 39 |
return \GutSlider\Icons\AllowedSvg::tags(); |
| 40 |
} |
| 41 |
} |
| 42 |
|