Un motore di ricerca WordPress per sviluppatori e autori di temi



render_core_social_link ›

Dan/a
Deprecaton/a
render_core_social_link ( $attributes )
Parametri:
  • (array) $attributes The block attributes.
    Richiesto:
Ritorna:
  • (string) Rendered HTML of the referenced block.
Definito a:
Codex:

Renders the `core/social-link` block on server.



Sorgenti

function render_core_social_link( $attributes ) {
	$site = ( isset( $attributes['site'] ) ) ? $attributes['site'] : 'Icon';
	$url  = ( isset( $attributes['url'] ) ) ? $attributes['url'] : false;

	// Don't render a link if there is no URL set.
	if ( ! $url ) {
		return '';
	}

	$icon = core_social_link_get_icon( $site );
	return '<li class="wp-social-link wp-social-link-' . $site . '"><a href="' . esc_attr( $url ) . '"> ' . $icon . '</a></li>';
}