wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



render_block_core_social_link › WordPress Function

Odn/a
Przestarzałyn/a
render_block_core_social_link ( $attributes )
Parametry:
  • (array) $attributes The block attributes.
    Wymagane: Tak
Powrót:
  • (string) Rendered HTML of the referenced block.
Zdefiniowane na:
Codex:

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



Źródło

function render_block_core_social_link( $attributes ) {
	$service = ( isset( $attributes['service'] ) ) ? $attributes['service'] : 'Icon';
	$url     = ( isset( $attributes['url'] ) ) ? $attributes['url'] : false;
	$label   = ( isset( $attributes['label'] ) ) ?
		$attributes['label'] :
		/* translators: %s: Social Link service name */
		sprintf( __( 'Link to %s' ), block_core_social_link_get_name( $service ) );

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

	$icon = block_core_social_link_get_icon( $service );
	return '<li class="wp-social-link wp-social-link-' . esc_attr( $service ) . '"><a href="' . esc_url( $url ) . '" aria-label="' . esc_attr( $label ) . '"> ' . $icon . '</a></li>';
}