Skip to content

Commit

Permalink
Block Library: Button: Remove title attribute handling
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Feb 3, 2020
1 parent 1e35ca3 commit 670ed98
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
14 changes: 3 additions & 11 deletions packages/block-library/src/button/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* External dependencies
*/
import classnames from 'classnames';
import { escape } from 'lodash';

/**
* WordPress dependencies
Expand Down Expand Up @@ -86,7 +85,6 @@ function BorderPanel( { borderRadius = '', setAttributes } ) {
function URLPicker( {
isSelected,
url,
title,
setAttributes,
opensInNewTab,
onToggleOpenInNewTab,
Expand All @@ -102,16 +100,12 @@ function URLPicker( {
>
<LinkControl
className="wp-block-navigation-link__inline-link-input"
value={ { url, title, opensInNewTab } }
value={ { url, opensInNewTab } }
onChange={ ( {
title: newTitle = '',
url: newURL = '',
opensInNewTab: newOpensInNewTab,
} ) => {
setAttributes( {
title: escape( newTitle ),
url: newURL,
} );
setAttributes( { url: newURL } );

if ( opensInNewTab !== newOpensInNewTab ) {
onToggleOpenInNewTab( newOpensInNewTab );
Expand Down Expand Up @@ -164,7 +158,6 @@ function ButtonEdit( {
placeholder,
rel,
text,
title,
url,
} = attributes;
const onSetLinkRel = useCallback(
Expand Down Expand Up @@ -199,7 +192,7 @@ function ButtonEdit( {
} = __experimentalUseGradient();

return (
<div className={ className } title={ title }>
<div className={ className }>
<RichText
placeholder={ placeholder || __( 'Add text…' ) }
value={ text }
Expand All @@ -225,7 +218,6 @@ function ButtonEdit( {
} }
/>
<URLPicker
title={ title }
url={ url }
setAttributes={ setAttributes }
isSelected={ isSelected }
Expand Down
4 changes: 4 additions & 0 deletions packages/block-library/src/button/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ export default function save( { attributes } ) {
borderRadius: borderRadius ? borderRadius + 'px' : undefined,
};

// The use of a `title` attribute here is soft-deprecated, but still applied
// if it had already been assigned, for the sake of backward-compatibility.
// A title will no longer be assigned for new or updated button block links.

return (
<div>
<RichText.Content
Expand Down

0 comments on commit 670ed98

Please sign in to comment.