Skip to content

Commit

Permalink
Try: more accessible labels. (#29659)
Browse files Browse the repository at this point in the history
* Try: more accessible labels.

* Update packages/block-library/src/social-link/index.php

Co-authored-by: Ari Stathopoulos <[email protected]>

Co-authored-by: Ari Stathopoulos <[email protected]>
  • Loading branch information
jasmussen and aristath authored Mar 16, 2021
1 parent 55101ca commit 13eb6f9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/block-library/src/social-link/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ function render_block_core_social_link( $attributes, $content, $block ) {

$service = ( isset( $attributes['service'] ) ) ? $attributes['service'] : 'Icon';
$url = ( isset( $attributes['url'] ) ) ? $attributes['url'] : false;
$label = ( isset( $attributes['label'] ) ) ? $attributes['label'] : block_core_social_link_get_name( $service );
$label = ( isset( $attributes['label'] ) ) ? $attributes['label'] : sprintf(
/* translators: %1$s: Social-network name. %2$s: URL. */
__( '%1$s: %2$s', 'gutenberg' ),
block_core_social_link_get_name( $service ),
$url
);
$class_name = isset( $attributes['className'] ) ? ' ' . $attributes['className'] : false;

// Don't render a link if there is no URL set.
Expand Down

0 comments on commit 13eb6f9

Please sign in to comment.