Skip to content

Commit

Permalink
Add missin version prop
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano committed Feb 13, 2023
1 parent 2ec85e4 commit 7cf77b2
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions packages/block-editor/src/components/plain-text/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ wp.blocks.registerBlockType( /* ... */, {

edit: function( props ) {
return wp.element.createElement( wp.editor.PlainText, {
version: 2,
className: props.className,
value: props.attributes.content,
onChange: function( content ) {
Expand Down Expand Up @@ -63,6 +64,7 @@ registerBlockType( /* ... */, {
edit( { className, attributes, setAttributes } ) {
return (
<PlainText
version={ 2 }
className={ className }
value={ attributes.content }
onChange={ ( content ) => setAttributes( { content } ) }
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/html/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export default function HTMLEdit( { attributes, setAttributes, isSelected } ) {
/>
) : (
<PlainText
version={ 2 }
value={ attributes.content }
onChange={ ( content ) => setAttributes( { content } ) }
placeholder={ __( 'Write HTML…' ) }
Expand Down
4 changes: 2 additions & 2 deletions packages/block-library/src/post-title/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ export default function PostTitleEdit( {
titleElement =
userCanEdit && ! isDescendentOfQueryLoop ? (
<PlainText
version={ 2 }
tagName={ TagName }
placeholder={ __( 'No Title' ) }
value={ rawTitle }
onChange={ setTitle }
version={ 2 }
{ ...blockProps }
/>
) : (
Expand All @@ -72,6 +72,7 @@ export default function PostTitleEdit( {
userCanEdit && ! isDescendentOfQueryLoop ? (
<TagName { ...blockProps }>
<PlainText
version={ 2 }
tagName="a"
href={ link }
target={ linkTarget }
Expand All @@ -81,7 +82,6 @@ export default function PostTitleEdit( {
}
value={ rawTitle }
onChange={ setTitle }
version={ 2 }
/>
</TagName>
) : (
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/shortcode/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default function ShortcodeEdit( { attributes, setAttributes } ) {
{ __( 'Shortcode' ) }
</label>
<PlainText
version={ 2 }
className="blocks-shortcode__textarea"
id={ inputId }
value={ attributes.text }
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/shortcode/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function ShortcodeEdit( props ) {
<Text style={ titleStyle }>{ __( 'Shortcode' ) }</Text>
<View style={ shortcodeContainerStyle }>
<PlainText
__experimentalVersion={ 2 }
version={ 2 }
value={ attributes.text }
style={ shortcodeStyle }
onChange={ onChange }
Expand Down

0 comments on commit 7cf77b2

Please sign in to comment.