From 7e4a72b9bcc6f50c8b400fd9340987b4649d2980 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Thu, 6 Aug 2015 20:57:31 +0000 Subject: [PATCH] Only use a bare URL when the link text field is used. Fixes bug that would remove images on edit, in some circumstances. fixes #33293 props azaozz git-svn-id: https://develop.svn.wordpress.org/trunk@33591 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/js/wplink.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/js/wplink.js b/src/wp-includes/js/wplink.js index 2fb3568deb..5b69c88d30 100644 --- a/src/wp-includes/js/wplink.js +++ b/src/wp-includes/js/wplink.js @@ -365,7 +365,10 @@ var wpLink; } link = getLink(); - text = inputs.text.val() || attrs.href; + + if ( inputs.wrap.hasClass( 'has-text-field' ) ) { + text = inputs.text.val() || attrs.href; + } if ( link ) { if ( text ) {