Skip to content

Add https:// to beginning of button links if not already present #46385

Closed

Description

@eoinsav

Description

When adding a link to the Buttons Block, it expects http:// or https:// at the start of a URL.

Say we are adding a Button to myfirstdomain.com, if the link is added as myseconddomain.com (or www.myseconddomain.com) then it will be displayed on the frontend as myfirstdomain.com/myseconddomain.com (or myfirstdomain.com/www.myseconddomain.com).

It works correctly for a regular text link. It will automatically add http:// to the beginning of a link in a Paragraph Block (sort of related).

Step-by-step reproduction instructions

  1. Create a Page
  2. Add a Buttons Block
  3. Type a link without http:// or https://
  4. Publish the Page
  5. Click the button on the published Page

Environment info

  • WordPress Version 6.1.1
  • Gutenberg Version 14.7.0

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Activity

  1. changed the title [-]Add https:// to beginning of button links if not present[/-] [+]Add https:// to beginning of button links if not already present[/+] on Dec 8, 2022
  2. added
    [Feature] Link EditingLink components (LinkControl, URLInput) and integrations (RichText link formatting)
    on Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

[Block] ButtonsAffects the Buttons Block[Feature] Link EditingLink components (LinkControl, URLInput) and integrations (RichText link formatting)[Type] EnhancementA suggestion for improvement.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions