wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-svg-icons.php:166Gets the SVG code for a given icon.
$groupstring$iconstring$sizeintstringOne hook fires while Twenty_Twenty_One_SVG_Icons::get_svg() runs, in this order:
Filters Twenty Twenty-Ones's array of icons.
public static function get_svg( $group, $icon, $size ) { if ( 'ui' === $group ) { $arr = self::$icons; } elseif ( 'social' === $group ) { $arr = self::$social_icons; } else { $arr = array(); } /** * Filters Twenty Twenty-Ones's array of icons. * * The dynamic portion of the hook name, `$group`, refers to * the name of the group of icons, either "ui" or "social". * * @since Twenty Twenty-One 1.0 * * @param array<string, string> $arr Array of icons. */ $arr = apply_filters( "twenty_twenty_one_svg_icons_{$group}", $arr ); $svg = ''; if ( isset( $arr[ $icon ] ) && is_string( $arr[ $icon ] ) ) { $repl = sprintf( '<svg class="svg-icon" width="%d" height="%d" aria-hidden="true" role="img" focusable="false" ', $size, $size ); $svg = (string) preg_replace( '/^<svg /', $repl, trim( $arr[ $icon ] ) ); // Add extra attributes to SVG code. } return $svg; }Introduced in Twenty Twenty-One 1.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-svg-icons.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.