Skip to content

Disable upload button in browser uploader if no file is selected #8966

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/wp-admin/css/forms.css
Original file line number Diff line number Diff line change
Expand Up @@ -1592,10 +1592,6 @@ table.form-table td .updated p {
line-height: 0.76190476;
}

.wp-upload-form input[type="submit"] {
margin-top: 10px;
}

.wp-core-ui select,
.wp-admin .form-table select {
min-height: 40px;
Expand Down
4 changes: 4 additions & 0 deletions src/wp-admin/css/themes.css
Original file line number Diff line number Diff line change
Expand Up @@ -2013,6 +2013,10 @@ body.full-overlay-active {
.upload-plugin .wp-upload-form {
display: block;
}

:is(.upload-theme, .upload-plugin) .wp-upload-form input[type="submit"] {
margin-top: 10px;
}
}

@media aural {
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/media.php
Original file line number Diff line number Diff line change
Expand Up @@ -2285,7 +2285,7 @@ function media_upload_form( $errors = null ) {
_ex( 'Upload', 'verb' );
?>
</label>
<input type="file" name="async-upload" id="async-upload" />
<input type="file" name="async-upload" id="async-upload" required />
<?php submit_button( _x( 'Upload', 'verb' ), 'primary', 'html-upload', false ); ?>
<a href="#" onclick="try{top.tb_remove();}catch(e){}; return false;"><?php _e( 'Cancel' ); ?></a>
</p>
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/media-new.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

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

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

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