-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Widget Group: Make
save()
markup the same as render_callback
mark…
…up (#38510)
- Loading branch information
1 parent
58d74b6
commit 5f140a6
Showing
3 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { InnerBlocks, RichText } from '@wordpress/block-editor'; | ||
|
||
const v1 = { | ||
attributes: { | ||
title: { | ||
type: 'string', | ||
}, | ||
}, | ||
supports: { | ||
html: false, | ||
inserter: true, | ||
customClassName: true, | ||
reusable: false, | ||
}, | ||
save( { attributes } ) { | ||
return ( | ||
<> | ||
<RichText.Content | ||
tagName="h2" | ||
className="widget-title" | ||
value={ attributes.title } | ||
/> | ||
<InnerBlocks.Content /> | ||
</> | ||
); | ||
}, | ||
}; | ||
|
||
export default [ v1 ]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters