Skip to content

Commit 2b54936

Browse files
Media: only add required attribute to media_upload_form on media screen
1 parent 76a8f03 commit 2b54936

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/wp-admin/includes/media.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2276,7 +2276,7 @@ function media_upload_form( $errors = null ) {
22762276
* @since 2.6.0
22772277
*/
22782278
do_action( 'pre-html-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
2279-
2279+
$required = 'media' === get_current_screen()->id ? ' required' : '';
22802280
?>
22812281
<p id="async-upload-wrap">
22822282
<label class="screen-reader-text" for="async-upload">
@@ -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" required />
2288+
<input type="file" name="async-upload" id="async-upload"<?php echo $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>

0 commit comments

Comments
 (0)