' . $icon . '';
}
/**
* Registers the `core/social-link` blocks.
*/
function register_block_core_social_link() {
$sites = array(
'amazon',
'bandcamp',
'behance',
'chain',
'codepen',
'deviantart',
'dribbble',
'dropbox',
'etsy',
'facebook',
'feed',
'fivehundredpx',
'flickr',
'foursquare',
'goodreads',
'google',
'github',
'instagram',
'lastfm',
'linkedin',
'mail',
'mastodon',
'meetup',
'medium',
'pinterest',
'pocket',
'reddit',
'skype',
'snapchat',
'soundcloud',
'spotify',
'tumblr',
'twitch',
'twitter',
'vimeo',
'vk',
'wordpress',
'yelp',
'youtube',
);
foreach ( $sites as $site ) {
register_block_type(
'core/social-link-' . $site,
array(
'attributes' => array(
'url' => array(
'type' => 'string',
),
'site' => array(
'type' => 'string',
'default' => $site,
),
),
'render_callback' => 'render_core_social_link',
)
);
}
}
add_action( 'init', 'register_block_core_social_link' );
/**
* Returns the SVG for social link.
*
* @param string $site The site icon.
*
* @return string SVG Element for site icon.
*/
function core_social_link_get_icon( $site ) {
switch ( $site ) {
case 'fivehundredpx':
return '';
case 'amazon':
return '';
case 'bandcamp':
return '';
case 'behance':
return '';
case 'chain':
return '';
case 'codepen':
return '';
case 'deviantart':
return '';
case 'dribbble':
return '';
case 'dropbox':
return '';
case 'etsy':
return '';
case 'facebook':
return '';
case 'feed':
return '';
case 'flickr':
return '';
case 'foursquare':
return '';
case 'goodreads':
return '';
case 'google':
return '';
case 'github':
return '';
case 'instagram':
return '';
case 'lastfm':
return '';
case 'linkedin':
return '';
case 'mail':
return '';
case 'mastodon':
return '';
case 'meetup':
return '';
case 'medium':
return '';
case 'pinterest':
return '';
case 'pocket':
return '';
case 'reddit':
return '';
case 'skype':
return '';
case 'snapchat':
return '';
case 'soundcloud':
return '';
case 'spotify':
return '';
case 'tumblr':
return '';
case 'twitch':
return '';
case 'twitter':
return '';
case 'vimeo':
return '';
case 'vk':
return '';
// phpcs:disable WordPress.WP.CapitalPDangit.Misspelled
case 'wordpress':
return '';
case 'yelp':
return '';
case 'youtube':
return '';
case 'share':
default:
return '';
}
}