Skip to content

Commit 0fd771a

Browse files
committed
Media: Disable upload button in browser's built-in file uploader if no file is selected.
Props karinchristen, krokodok, stefanvelthuys, hubersen, joedolson, mukesh27, rollybueno, ocean90. Fixes #63561. git-svn-id: https://develop.svn.wordpress.org/trunk@60449 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 35ca22a commit 0fd771a

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/wp-admin/css/forms.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,10 +1592,6 @@ table.form-table td .updated p {
15921592
line-height: 0.76190476;
15931593
}
15941594

1595-
.wp-upload-form input[type="submit"] {
1596-
margin-top: 10px;
1597-
}
1598-
15991595
.wp-core-ui select,
16001596
.wp-admin .form-table select {
16011597
min-height: 40px;

src/wp-admin/css/themes.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2013,6 +2013,10 @@ body.full-overlay-active {
20132013
.upload-plugin .wp-upload-form {
20142014
display: block;
20152015
}
2016+
2017+
:is(.upload-theme, .upload-plugin) .wp-upload-form input[type="submit"] {
2018+
margin-top: 10px;
2019+
}
20162020
}
20172021

20182022
@media aural {

src/wp-admin/includes/media.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2285,7 +2285,7 @@ function media_upload_form( $errors = null ) {
22852285
_ex( 'Upload', 'verb' );
22862286
?>
22872287
</label>
2288-
<input type="file" name="async-upload" id="async-upload" />
2288+
<input type="file" name="async-upload" id="async-upload" required />
22892289
<?php submit_button( _x( 'Upload', 'verb' ), 'primary', 'html-upload', false ); ?>
22902290
<a href="#" onclick="try{top.tb_remove();}catch(e){}; return false;"><?php _e( 'Cancel' ); ?></a>
22912291
</p>

src/wp-admin/media-new.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464

6565
require_once ABSPATH . 'wp-admin/admin-header.php';
6666

67-
$form_class = 'media-upload-form type-form validate';
67+
$form_class = 'wp-upload-form media-upload-form type-form validate';
6868

6969
if ( get_user_setting( 'uploader' ) || isset( $_GET['browser-uploader'] ) ) {
7070
$form_class .= ' html-uploader';

0 commit comments

Comments
 (0)