How to Create A Gutenberg File Upload Custom Block
-
Greetings,
I wish to add a custom file upload block to a form in the Gutenberg editor. I found the snippet below in the WP documentation for adding a file tag but I am not sure how to implement it via a custom block plugin.
import { FormFileUpload } from '@wordpress/components';const MyFormFileUpload = () => (<FormFileUpload accept="image/*"onChange={ ( event ) => console.log( event.currentTarget.files ) } >
Upload</FormFileUpload>);How do I include the snippet in a JavaScript function so that I may enqueue it in a PHP file?
Thanks.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘How to Create A Gutenberg File Upload Custom Block’ is closed to new replies.