Skip to content

Commit

Permalink
add placeholder attribute and use it in the UI (#16783)
Browse files Browse the repository at this point in the history
  • Loading branch information
marekhrabe authored and mtias committed Jul 29, 2019
1 parent dd4d205 commit f4206ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/block-library/src/button/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
"source": "attribute",
"selector": "a",
"attribute": "rel"
},
"placeholder": {
"type": "string"
}
}
}
3 changes: 2 additions & 1 deletion packages/block-library/src/button/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,15 @@ class ButtonEdit extends Component {
title,
linkTarget,
rel,
placeholder,
} = attributes;

const linkId = `wp-block-button__inline-link-${ instanceId }`;

return (
<div className={ className } title={ title } ref={ this.bindRef }>
<RichText
placeholder={ __( 'Add text…' ) }
placeholder={ placeholder || __( 'Add text…' ) }
value={ text }
onChange={ ( value ) => setAttributes( { text: value } ) }
withoutInteractiveFormatting
Expand Down

0 comments on commit f4206ef

Please sign in to comment.