apply_filters( "twenty_twenty_one_svg_icons_{$group}", \array<string, )
- Since
- Twenty Twenty-One 1.0
Filters Twenty Twenty-Ones's array of icons.
Description
The dynamic portion of the hook name, $group, refers to the name of the group of icons, either "ui" or "social".
Compatibility
- WordPress
- since Twenty Twenty-One 1.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
\array<string,- string> $arr Array of icons.
Where this hook fires · 1
wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-svg-icons.php:186Twenty_Twenty_One_SVG_Icons::get_svg()
Source code
* 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.Changelog
Introduced in Twenty Twenty-One 1.0. 2 changes between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
7.0.4
Parameter `` added.verified against source
7.0.4
Parameter
$arr removed.verified against sourceTwenty Twenty-One 1.0
Twenty Twenty-One 1.0from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.