\s*', '><', $svg ); // Remove whitespace between SVG tags.
// Make sure that only our allowed tags and attributes are included.
$svg = wp_kses(
$svg,
array(
'svg' => array(
'class' => true,
'xmlns' => true,
'width' => true,
'height' => true,
'viewbox' => true,
'aria-hidden' => true,
'role' => true,
'focusable' => true,
),
'path' => array(
'fill' => true,
'fill-rule' => true,
'd' => true,
'transform' => true,
),
'polygon' => array(
'fill' => true,
'fill-rule' => true,
'points' => true,
'transform' => true,
'focusable' => true,
),
)
);
if ( ! $svg ) {
return null;
}
return $svg;
}
return null;
}
/**
* Get SVG icons array.
*
* @return array
*/
public function get() {
return apply_filters( 'socialsnap_icons_svg', self::$icons );
}
/**
* Get all available SVG icons
*
* @return array
*/
public function get_all_svg_icons() {
$arr = self::get();
$return = array();
foreach ( $arr as $icon => $svg ) {
$svg = self::get_svg( $icon );
if ( $svg ) {
$return[ $icon ] = self::get_svg( $icon );
}
}
return $return;
}
/**
* Icons.
* Store the code for all SVGs in an array.
*
* @var array
*/
public static $icons = array(
'copy' => '',
'500px' => '',
'amazon' => '',
'analytics' => '',
'api' => '',
'baidu' => '',
'behance' => '',
'blogger' => '',
'box' => '',
'buffer' => '',
'close' => '',
'delicious' => '',
'deviantart' => '',
'digg' => '',
'discord' => '',
'dribbble' => '',
'edit' => '',
'envelope' => '',
'subscribers' => '',
'etsy' => '',
'evernote' => '',
'eye-closed' => '',
'eye' => '',
'facebook' => '',
'flickr' => '',
'flipboard' => '',
'followers' => '',
'foursquare' => '',
'general' => '',
'github' => '',
'google' => '',
'heart' => '',
'houzz' => '',
'import' => '',
'instagram' => '',
'layout' => '',
'life-buoy' => '',
'linkedin' => '',
'livejournal' => '',
'locker' => '',
'login' => '
',
'medium' => '',
'menu' => '',
'messenger' => '',
'mewe' => '',
'mix' => '',
'myspace' => '',
'newsvine' => '',
'outlook' => '',
'parler' => '',
'patreon' => '',
'pinterest' => '',
'plus' => '',
'pocket' => '',
'print' => '',
'reddit' => '',
'rss' => '',
'share' => '',
'skype' => '',
'sms' => '',
'snapchat' => '',
'social-id' => '',
'socialsnap-icon' => '
',
'socialsnap-light' => '',
'socialsnap-dark' => '
',
'socialsnap-circle' => '',
'soundcloud' => '',
'spotify' => '
',
'telegram' => '',
'tumblr' => '',
'twitch' => '',
'twitter-outline' => '',
'twitter' => '',
'viber' => '',
'vimeo' => '',
'vkontakte' => '',
'whatsapp' => '',
'xing' => '',
'yahoo' => '',
'youtube' => '',
'yummly' => '',
'info' => '',
'info-dark' => '',
'tiktok' => '',
'line' => '',
);
}
endif;