diff -r 34716fd837a4 -r be944660c56a wp/wp-includes/blocks/social-link.php --- a/wp/wp-includes/blocks/social-link.php Tue Dec 15 15:52:01 2020 +0100 +++ b/wp/wp-includes/blocks/social-link.php Wed Sep 21 18:19:35 2022 +0200 @@ -8,14 +8,23 @@ /** * Renders the `core/social-link` block on server. * - * @param array $attributes The block attributes. + * @param Array $attributes The block attributes. + * @param String $content InnerBlocks content of the Block. + * @param WP_Block $block Block object. * * @return string Rendered HTML of the referenced block. */ -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'] : block_core_social_link_get_name( $service ); +function render_block_core_social_link( $attributes, $content, $block ) { + $open_in_new_tab = isset( $block->context['openInNewTab'] ) ? $block->context['openInNewTab'] : false; + + $service = ( isset( $attributes['service'] ) ) ? $attributes['service'] : 'Icon'; + $url = ( isset( $attributes['url'] ) ) ? $attributes['url'] : false; + $label = ( isset( $attributes['label'] ) ) ? $attributes['label'] : sprintf( + /* translators: %1$s: Social-network name. %2$s: URL. */ + __( '%1$s: %2$s' ), + 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. @@ -23,8 +32,20 @@ return ''; } - $icon = block_core_social_link_get_icon( $service ); - return '