Media: Remove required attribute from media uploader file input field#10564
Media: Remove required attribute from media uploader file input field#10564t-hamano wants to merge 1 commit intoWordPress:trunkfrom
required attribute from media uploader file input field#10564Conversation
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
@t-hamano I have tested this PR and verified all these scenarios mentioned here.
Please confirm if there is anything I have missed. 🙇🏻♀️ |
|
@t-hamano, Thanks for the fix. I have tested this PR and verified all the mentioned scenarios. ✅ Default Media Uploader Just to confirm, will this issue fix be included in the WordPress 6.9 release? |
Summary
When the media upload form operates as a normal async uploader, the file input element with the
requiredattribute is visually hidden. When a form submit is performed on a form element with this attribute, the following error is displayed in the browser console, and the form is not submitted:This issue affects all implementations that run the
media_upload_form()function within a form element.As a temporary workaround for 6.9, remove the
requiredattribute from the file input element.Testing Instructions
✅ or⚠️ indicates that this PR will change the results.
Default Media Uploader
Legacy Media Uploader
Backward compatibility with third-party plugins