UNPKG

@wordpress/block-library

Version:
55 lines (36 loc) 2.85 kB
# Form Submit Button <!-- START TOKEN(Autogenerated block API docs) --> <div class="callout callout-warning">This block is <strong>experimental</strong> and may change or be removed without notice.</div> A submission button for forms. - **Name:** `core/form-submit-button` - **Category:** [widgets](https://developer.wordpress.org/block-editor/reference-guides/core-blocks/core-blocks-widgets/) - **API Version:** [3](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-api-versions/) - **Block Type:** [Static](https://developer.wordpress.org/block-editor/getting-started/fundamentals/static-dynamic-rendering/) (saved in post content) - **Keywords:** `submit`, `button`, `form` ## Block Relationships **[Ancestor](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#ancestor) blocks:** - [`core/form`](https://developer.wordpress.org/block-editor/reference-guides/core-blocks/core-blocks-widgets/core-block-form/) **[Allowed](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#allowed-blocks) inner blocks:** - [`core/buttons`](https://developer.wordpress.org/block-editor/reference-guides/core-blocks/core-blocks-design/core-block-buttons/) - [`core/button`](https://developer.wordpress.org/block-editor/reference-guides/core-blocks/core-blocks-design/core-block-button/) ## Attributes _Defined via the [`attributes`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-attributes/) property in block.json._ _This block has no custom attributes._ ## Supports _Defined via the [`supports`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/) property in block.json._ _This block does not declare explicit supports._ ## Block Markup This is a [**static block**](https://developer.wordpress.org/block-editor/getting-started/fundamentals/static-dynamic-rendering/). The markup is saved directly in the post content. ```html <!-- wp:form-submit-button --> <div class="wp-block-form-submit-button"><!-- wp:buttons --> <div class="wp-block-buttons"><!-- wp:button {"tagName":"button","type":"submit"} --> <div class="wp-block-button"><button type="submit" class="wp-block-button__link wp-element-button">Submit</button></div> <!-- /wp:button --></div> <!-- /wp:buttons --></div> <!-- /wp:form-submit-button --> ``` ## Source - [block.json](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/form-submit-button/block.json) ([reference](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/)) - [Source directory](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/form-submit-button/) — browse `edit.js`, `save.js`, `index.php`, and more. <!-- END TOKEN(Autogenerated block API docs) -->