[ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * Twenty Twenty SVG Icon helper functions 4 * 5 * @package WordPress 6 * @subpackage Twenty_Twenty 7 * @since Twenty Twenty 1.0 8 */ 9 10 if ( ! function_exists( 'twentytwenty_the_theme_svg' ) ) { 11 /** 12 * Outputs the SVG markup for an icon in the TwentyTwenty_SVG_Icons class. 13 * 14 * @since Twenty Twenty 1.0 15 * 16 * @param string $svg_name The name of the icon. 17 * @param string $group The group the icon belongs to. 18 * @param string $color Color code. 19 */ 20 function twentytwenty_the_theme_svg( $svg_name, $group = 'ui', $color = '' ) { 21 echo twentytwenty_get_theme_svg( $svg_name, $group, $color ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in twentytwenty_get_theme_svg(). 22 } 23 } 24 25 if ( ! function_exists( 'twentytwenty_get_theme_svg' ) ) { 26 27 /** 28 * Gets information about the SVG icon. 29 * 30 * @since Twenty Twenty 1.0 31 * 32 * @param string $svg_name The name of the icon. 33 * @param string $group The group the icon belongs to. 34 * @param string $color Color code. 35 */ 36 function twentytwenty_get_theme_svg( $svg_name, $group = 'ui', $color = '' ) { 37 38 // Make sure that only our allowed tags and attributes are included. 39 $svg = wp_kses( 40 TwentyTwenty_SVG_Icons::get_svg( $svg_name, $group, $color ), 41 array( 42 'svg' => array( 43 'class' => true, 44 'xmlns' => true, 45 'width' => true, 46 'height' => true, 47 'viewbox' => true, 48 'aria-hidden' => true, 49 'role' => true, 50 'focusable' => true, 51 ), 52 'path' => array( 53 'fill' => true, 54 'fill-rule' => true, 55 'd' => true, 56 'transform' => true, 57 ), 58 'polygon' => array( 59 'fill' => true, 60 'fill-rule' => true, 61 'points' => true, 62 'transform' => true, 63 'focusable' => true, 64 ), 65 ) 66 ); 67 68 if ( ! $svg ) { 69 return false; 70 } 71 return $svg; 72 } 73 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated : Tue Aug 19 08:20:01 2025 | Cross-referenced by PHPXref |