Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Social Link: Automatically prepend emails with mailto protocol #42186

Merged
merged 2 commits into from
Jul 6, 2022

Conversation

Mamaduka
Copy link
Member

@Mamaduka Mamaduka commented Jul 6, 2022

What?

Resolves #21876.

PR updates Social Links renderer to prepend emails with mailto: protocol if it's not set.

Why?

The current renderer results in an invalid link prefix - http://info@example.com/. This was happening before #42167, because of esc_url.

Testing Instructions

  1. Open a Post or Page.
  2. Insert an example block snippet.
  3. Confirm that email without a prefix has one.
  4. There's no double prefix for the second email.
<!-- wp:social-links -->
<ul class="wp-block-social-links"><!-- wp:social-link {"url":"gutenberg@example.com","service":"mail"} /-->

<!-- wp:social-link {"url":"mailto:gutenberg@example.com","service":"mail"} /--></ul>
<!-- /wp:social-links -->

@Mamaduka Mamaduka requested a review from ajitbohra as a code owner July 6, 2022 13:50
@Mamaduka Mamaduka self-assigned this Jul 6, 2022
@Mamaduka Mamaduka added [Type] Enhancement A suggestion for improvement. [Block] Social Affects the Social Block - used to display Social Media accounts labels Jul 6, 2022
@Mamaduka Mamaduka requested a review from draganescu July 6, 2022 13:51
@Mamaduka
Copy link
Member Author

Mamaduka commented Jul 6, 2022

Thanks, Nik!

@Mamaduka Mamaduka merged commit b3c6f67 into trunk Jul 6, 2022
@Mamaduka Mamaduka deleted the try/social-link-prefix-mails branch July 6, 2022 19:53
@github-actions github-actions bot added this to the Gutenberg 13.7 milestone Jul 6, 2022
@bph bph added the Needs User Documentation Needs new user documentation label Jul 11, 2022
@mburridge mburridge added the Needs Dev Note Requires a developer note for a major WordPress release cycle label Sep 15, 2022
@mburridge
Copy link
Contributor

Added the Needs Dev Note label in case this needs a dev note (either individual or as part of a "misc" dev note) for WP 6.1 release.

@Mamaduka
Copy link
Member Author

It is a small enough change for Block Editor misc dev notes.

Dev Note

Starting from WordPress 6.1, the Social Links block will automatically prepend emails with the mailto: if the protocol is missing.

For more info, see #42186.

@Mamaduka Mamaduka mentioned this pull request Oct 10, 2022
89 tasks
@bph bph added has dev note when dev note is done (for upcoming WordPress release) and removed Needs Dev Note Requires a developer note for a major WordPress release cycle labels Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Social Affects the Social Block - used to display Social Media accounts has dev note when dev note is done (for upcoming WordPress release) Needs User Documentation Needs new user documentation [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve Email Social Icon with automatic "mailto:" and obfuscation
4 participants