apply_filters( "twenty_twenty_one_svg_icons_{$group}", array $arr )
- 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.10
- 6.8.11
- 6.9.10
- 7.0.7
- 7.1.3
Present in every tracked release (6.7.10 to 7.1.3).
Parameters
$arrarray- 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 $arr Array of icons. */ $arr = apply_filters( "twenty_twenty_one_svg_icons_{$group}", $arr ); $svg = ''; if ( array_key_exists( $icon, $arr ) ) { $repl = sprintf( '<svg class="svg-icon" width="%d" height="%d" aria-hidden="true" role="img" focusable="false" ', $size, $size ); $svg = 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.10 and 7.1.3.
Signature, return type and hooks compared across 5 parsed releases.
7.0.7
Parameter `` added.verified against source
7.0.7
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 6.8.11 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.