Edit File by line
/home/barbar84/public_h.../wp-conte.../themes/twentytw.../inc
File: svg-icons.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Twenty Twenty SVG Icon helper functions
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
* @subpackage Twenty_Twenty
[5] Fix | Delete
* @since Twenty Twenty 1.0
[6] Fix | Delete
*/
[7] Fix | Delete
[8] Fix | Delete
if ( ! function_exists( 'twentytwenty_the_theme_svg' ) ) {
[9] Fix | Delete
/**
[10] Fix | Delete
* Output and Get Theme SVG.
[11] Fix | Delete
* Output and get the SVG markup for an icon in the TwentyTwenty_SVG_Icons class.
[12] Fix | Delete
*
[13] Fix | Delete
* @param string $svg_name The name of the icon.
[14] Fix | Delete
* @param string $group The group the icon belongs to.
[15] Fix | Delete
* @param string $color Color code.
[16] Fix | Delete
*/
[17] Fix | Delete
function twentytwenty_the_theme_svg( $svg_name, $group = 'ui', $color = '' ) {
[18] Fix | Delete
echo twentytwenty_get_theme_svg( $svg_name, $group, $color ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in twentytwenty_get_theme_svg().
[19] Fix | Delete
}
[20] Fix | Delete
}
[21] Fix | Delete
[22] Fix | Delete
if ( ! function_exists( 'twentytwenty_get_theme_svg' ) ) {
[23] Fix | Delete
[24] Fix | Delete
/**
[25] Fix | Delete
* Get information about the SVG icon.
[26] Fix | Delete
*
[27] Fix | Delete
* @param string $svg_name The name of the icon.
[28] Fix | Delete
* @param string $group The group the icon belongs to.
[29] Fix | Delete
* @param string $color Color code.
[30] Fix | Delete
*/
[31] Fix | Delete
function twentytwenty_get_theme_svg( $svg_name, $group = 'ui', $color = '' ) {
[32] Fix | Delete
[33] Fix | Delete
// Make sure that only our allowed tags and attributes are included.
[34] Fix | Delete
$svg = wp_kses(
[35] Fix | Delete
TwentyTwenty_SVG_Icons::get_svg( $svg_name, $group, $color ),
[36] Fix | Delete
array(
[37] Fix | Delete
'svg' => array(
[38] Fix | Delete
'class' => true,
[39] Fix | Delete
'xmlns' => true,
[40] Fix | Delete
'width' => true,
[41] Fix | Delete
'height' => true,
[42] Fix | Delete
'viewbox' => true,
[43] Fix | Delete
'aria-hidden' => true,
[44] Fix | Delete
'role' => true,
[45] Fix | Delete
'focusable' => true,
[46] Fix | Delete
),
[47] Fix | Delete
'path' => array(
[48] Fix | Delete
'fill' => true,
[49] Fix | Delete
'fill-rule' => true,
[50] Fix | Delete
'd' => true,
[51] Fix | Delete
'transform' => true,
[52] Fix | Delete
),
[53] Fix | Delete
'polygon' => array(
[54] Fix | Delete
'fill' => true,
[55] Fix | Delete
'fill-rule' => true,
[56] Fix | Delete
'points' => true,
[57] Fix | Delete
'transform' => true,
[58] Fix | Delete
'focusable' => true,
[59] Fix | Delete
),
[60] Fix | Delete
)
[61] Fix | Delete
);
[62] Fix | Delete
[63] Fix | Delete
if ( ! $svg ) {
[64] Fix | Delete
return false;
[65] Fix | Delete
}
[66] Fix | Delete
return $svg;
[67] Fix | Delete
}
[68] Fix | Delete
}
[69] Fix | Delete
[70] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function