wp-content/themes/twentynineteen/classes/class-twentynineteen-svg-icons.php:57Detects the social network from a URL and returns the SVG code for its icon.
$uristring$sizeintstring|null public static function get_social_link_svg( $uri, $size ) { static $regex_map; // Only compute regex map once, for performance. if ( ! isset( $regex_map ) ) { $regex_map = array(); $map = &self::$social_icons_map; // Use reference instead of copy, to save memory. foreach ( array_keys( self::$social_icons ) as $icon ) { $domains = array_key_exists( $icon, $map ) ? $map[ $icon ] : array( sprintf( '%s.com', $icon ) ); $domains = array_map( 'trim', $domains ); // Remove leading/trailing spaces, to prevent regex from failing to match. $domains = array_map( 'preg_quote', $domains ); $regex_map[ $icon ] = sprintf( '/(%s)/i', implode( '|', $domains ) ); } } foreach ( $regex_map as $icon => $regex ) { if ( preg_match( $regex, $uri ) ) { return self::get_svg( 'social', $icon, $size ); } } return null; }One change between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
none to string|null.verified against sourcesrc/wp-content/themes/twentynineteen/classes/class-twentynineteen-svg-icons.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.