Changeset 48180
- Timestamp:
- 06/26/2020 02:40:27 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-svg-icons.php
r47796 r48180 30 30 $arr = array(); 31 31 } 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 32 56 if ( array_key_exists( $icon, $arr ) ) { 33 57 $repl = '<svg class="svg-icon" aria-hidden="true" role="img" focusable="false" '; … … 52 76 if ( ! isset( $regex_map ) ) { 53 77 $regex_map = array(); 54 $map = &self::$social_icons_map; // Use reference instead of copy, to save memory. 55 foreach ( array_keys( self::$social_icons ) as $icon ) { 78 79 /** 80 * Filters Twenty Twenty's array of domain mappings for social icons. 81 * 82 * By default, each Icon ID is matched against a .com TLD. To override this behavior, 83 * specify all the domains it covers (including the .com TLD too, if applicable). 84 * 85 * @since 1.5.0 86 * 87 * @param array $social_icons_map Array of default social icons. 88 */ 89 $map = apply_filters( 'twentytwenty_social_icons_map', self::$social_icons_map ); 90 91 /** 92 * Filters Twenty Twenty's array of social icons. 93 * 94 * @since 1.5.0 95 * 96 * @param array $social_icons Array of default social icons. 97 */ 98 $social_icons = apply_filters( 'twentytwenty_svg_icons_social', self::$social_icons ); 99 100 foreach ( array_keys( $social_icons ) as $icon ) { 56 101 $domains = array_key_exists( $icon, $map ) ? $map[ $icon ] : array( sprintf( '%s.com', $icon ) ); 57 102 $domains = array_map( 'trim', $domains ); // Remove leading/trailing spaces, to prevent regex from failing to match.
Note: See TracChangeset
for help on using the changeset viewer.