\s*', '><', $board_games_svg); // Remove white space between SVG tags.
return $board_games_svg;
}
return null;
}
static function get_theme_svg_name($board_games_url)
{
static $board_games_regex_map; // Only compute regex map once, for performance.
if (!isset($board_games_regex_map)) {
$board_games_regex_map = array();
$board_games_map = Board_Games_SVG_Icons::$board_games_social_icons_map; // Use reference instead of copy, to save memory.
foreach (array_keys(Board_Games_SVG_Icons::$board_games_icons) as $board_games_icon) {
$board_games_domains = array_key_exists($board_games_icon, $board_games_map) ? $board_games_map[$board_games_icon] : array(sprintf('%s.com', $board_games_icon));
$board_games_domains = array_map('trim', $board_games_domains); // Remove leading/trailing spaces, to prevent regex from failing to match.
$board_games_domains = array_map('preg_quote', $board_games_domains);
$board_games_regex_map[$board_games_icon] = sprintf('/(%s)/i', implode('|', $board_games_domains));
}
}
foreach ($board_games_regex_map as $board_games_icon => $regexboard_games_) {
if (preg_match($board_games_regex, $board_games_url)) {
return board_games_get_theme_svg($board_games_icon);;
}
}
return board_games_get_theme_svg('chain');
}
static $board_games_social_icons_map = array(
'amazon' => array(
'amazon.com',
'amazon.cn',
'amazon.in',
'amazon.fr',
'amazon.de',
'amazon.it',
'amazon.nl',
'amazon.es',
'amazon.co',
'amazon.ca',
),
'apple' => array(
'apple.com',
'itunes.com',
),
'behance' => array(
'behance.net',
),
'codepen' => array(
'codepen.io',
),
'facebook' => array(
'facebook.com',
'fb.me',
),
'feed' => array(
'feed',
),
'lastfm' => array(
'last.fm',
),
'mail' => array(
'mailto:',
),
'slideshare' => array(
'slideshare.net',
),
'pocket' => array(
'getpocket.com',
),
'twitch' => array(
'twitch.tv',
),
'wp' => array(
'wordpress.com',
'wordpress.org',
),
);
/* --------------------------------------------------------------------
ICON STORAGE
Store the code for all SVGs in an array
-------------------------------------------------------------------- */
static $board_games_icons = array(
'envalope' => '',
'menu' => '',
'plus' => '',
'minus' => '',
'homemark' => '',
'arrow-down' => '',
'arrow-left' => '',
'arrow-right-1' => '',
'arrow-right' => '',
'arrow-up' => '',
'chevron-down' => '',
'chevron-up' => '',
'chevron-left' => '',
'chevron-right' => '',
'bookmark' => '',
'calendar' => '',
'viewer' => '',
'comment' => '',
'cross' => '',
'edit' => '',
'folder' => '',
'search' => '',
'tag' => '',
'user' => '',
'recent' => '',
'blaze' => '',
'star' => '',
'latest' => '',
'close' => '',
'moon' => '',
'sun' => '',
'play' => '',
'pause' => '',
'mute' => '',
'unmute' => '',
'audio' => '',
'gallery' => '',
'image' => '',
'video' => '',
'quote' => '',
'amazon' => '',
'apple' => '',
'bandcamp' => '',
'behance' => '',
'chain' => '',
'codepen' => '',
'deviantart' => '',
'digg' => '',
'dribbble' => '',
'dropbox' => '',
'etsy' => '',
'facebook' => '',
'feed' => '',
'flickr' => '',
'foursquare' => '',
'goodreads' => '',
'github' => '',
'instagram' => '',
'lastfm' => '',
'linkedin' => '',
'mail' => '',
'meetup' => '',
'medium' => '',
'pinterest' => '',
'pocket' => '',
'reddit' => '',
'skype' => '',
'slideshare' => '',
'snapchat' => '',
'soundcloud' => '',
'spotify' => '',
'stumbleupon' => '',
'tumblr' => '',
'twitch' => '',
'twitter' => '',
'vimeo' => '',
'vk' => '',
'wp' => '',
'yelp' => '',
'youtube' => '',
'whatsapp' => '',
'bookmark' => '',
'aside' => '',
'chat' => '',
'link' => '',
'status' => '',
);
}
endif;