diff --git a/packages/block-library/src/social-link/index.php b/packages/block-library/src/social-link/index.php index c1f5afcba4df0..3b5e16ca33369 100644 --- a/packages/block-library/src/social-link/index.php +++ b/packages/block-library/src/social-link/index.php @@ -27,6 +27,14 @@ function render_block_core_social_link( $attributes, $content, $block ) { return ''; } + /** + * Prepend emails with `mailto:` if not set. + * The `is_email` returns false for emails with schema. + */ + if ( is_email( $url ) ) { + $url = 'mailto:' . $url; + } + /** * Prepend URL with https:// if it doesn't appear to contain a scheme * and it's not a relative link starting with //.