JavaScript for WordPress Forums Gutenberg Development Media Upload Button

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #42336
    Imtiaz Rayhan
    Participant

    Hi,

    I was messing around with the Media Upload button.

    It’s deprecated. Instead, we have to use MediaUpload.

    In the example files, instead of MediaUploadButton we have to use MediaUplaod like this:

    <MediaUpload
        onSelect={ onSelectImage }
        type="image"
        value={ props.attributes.imgID }
        render={ ( { open } ) => (
            <Button
                className="components-button button button-medium"
                onClick={ open }>
                Upload Image
            </Button>
        ) }
    />

    Hope this helps.

    #42402
    Zac Gordon
    Keymaster

    You are correct my friend! Thanks for posting this up 🙂

    Hoping to make an update to the course with this soon, but so many changes still happening. Will link to this forum post from the video though 🙂

    #42458
    Imtiaz Rayhan
    Participant

    You are welcome.

    Also, Editable has changed to RichText.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.