From 935c7ef87828308a6202beaae0c10c6e13a04f37 Mon Sep 17 00:00:00 2001 From: Dave Smith Date: Fri, 20 Jan 2023 17:16:56 +0800 Subject: [PATCH] Prepend HTTP --- packages/block-library/src/button/edit.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/block-library/src/button/edit.js b/packages/block-library/src/button/edit.js index 9eab35ff3c007..5311086a0803b 100644 --- a/packages/block-library/src/button/edit.js +++ b/packages/block-library/src/button/edit.js @@ -32,6 +32,7 @@ import { displayShortcut, isKeyboardEvent } from '@wordpress/keycodes'; import { link, linkOff } from '@wordpress/icons'; import { createBlock } from '@wordpress/blocks'; import { useMergeRefs } from '@wordpress/compose'; +import { prependHTTP } from '@wordpress/url'; const NEW_TAB_REL = 'noreferrer noopener'; @@ -240,7 +241,7 @@ function ButtonEdit( props ) { url: newURL = '', opensInNewTab: newOpensInNewTab, } ) => { - setAttributes( { url: newURL } ); + setAttributes( { url: prependHTTP( newURL ) } ); if ( opensInNewTab !== newOpensInNewTab ) { onToggleOpenInNewTab( newOpensInNewTab );