From 892ea5c784fd51cb6d6b48688e3636636ad834cf Mon Sep 17 00:00:00 2001 From: Joe Dolson Date: Tue, 28 Oct 2025 15:58:39 -0500 Subject: [PATCH 1/6] Switch the upload html bypass to a button --- src/js/_enqueues/vendor/plupload/handlers.js | 4 +-- src/wp-admin/includes/media.php | 26 ++++++++------------ 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/src/js/_enqueues/vendor/plupload/handlers.js b/src/js/_enqueues/vendor/plupload/handlers.js index 15ec5c215c231..840cb2e1c3445 100644 --- a/src/js/_enqueues/vendor/plupload/handlers.js +++ b/src/js/_enqueues/vendor/plupload/handlers.js @@ -420,11 +420,11 @@ jQuery( document ).ready( function( $ ) { target.parents( '.media-item' ).fadeOut( 200, function() { $( this ).remove(); } ); - } else if ( target.is( '.upload-flash-bypass a' ) || target.is( 'a.uploader-html' ) ) { // Switch uploader to html4. + } else if ( target.is( '.upload-flash-bypass button' ) || target.is( 'a.uploader-html' ) ) { // Switch uploader to html4. $( '#media-items, p.submit, span.big-file-warning' ).css( 'display', 'none' ); switchUploader( 0 ); e.preventDefault(); - } else if ( target.is( '.upload-html-bypass a' ) ) { // Switch uploader to multi-file. + } else if ( target.is( '.upload-html-bypass button' ) ) { // Switch uploader to multi-file. $( '#media-items, p.submit, span.big-file-warning' ).css( 'display', '' ); switchUploader( 1 ); e.preventDefault(); diff --git a/src/wp-admin/includes/media.php b/src/wp-admin/includes/media.php index 7b478f459261e..f6d5287161dbc 100644 --- a/src/wp-admin/includes/media.php +++ b/src/wp-admin/includes/media.php @@ -3028,27 +3028,15 @@ function wp_media_insert_url_form( $default_view = 'image' ) { * Displays the multi-file uploader message. * * @since 2.6.0 - * - * @global int $post_ID */ function media_upload_flash_bypass() { - $browser_uploader = admin_url( 'media-new.php?browser-uploader' ); - - $post = get_post(); - if ( $post ) { - $browser_uploader .= '&post_id=' . (int) $post->ID; - } elseif ( ! empty( $GLOBALS['post_ID'] ) ) { - $browser_uploader .= '&post_id=' . (int) $GLOBALS['post_ID']; - } - ?>

browser uploader instead.' ), - $browser_uploader, - 'target="_blank"' + /* translators: %s: HTML attributes for button. */ + __( 'You are using the multi-file uploader. Problems? Try the instead.' ), + 'type="button" class="button-link"' ); ?>

@@ -3063,7 +3051,13 @@ function media_upload_flash_bypass() { function media_upload_html_bypass() { ?>

- Switch to the multi-file uploader.' ); ?> + Switch to the multi-file uploader.' ), + 'type="button" class="button-link"' + ); + ?>

Date: Tue, 28 Oct 2025 16:02:34 -0500 Subject: [PATCH 2/6] Stray spaces... --- src/wp-admin/includes/media.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wp-admin/includes/media.php b/src/wp-admin/includes/media.php index f6d5287161dbc..e66047674be20 100644 --- a/src/wp-admin/includes/media.php +++ b/src/wp-admin/includes/media.php @@ -3052,11 +3052,11 @@ function media_upload_html_bypass() { ?>

Switch to the multi-file uploader.' ), + printf( + /* translators: %s: HTML attributes for button. */ + __( 'You are using the browser’s built-in file uploader. The WordPress uploader includes multiple file selection and drag and drop capability. .' ), 'type="button" class="button-link"' - ); + ); ?>

Date: Tue, 28 Oct 2025 16:03:01 -0500 Subject: [PATCH 3/6] Update media.php --- src/wp-admin/includes/media.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/includes/media.php b/src/wp-admin/includes/media.php index e66047674be20..7baa2841ecff7 100644 --- a/src/wp-admin/includes/media.php +++ b/src/wp-admin/includes/media.php @@ -3053,10 +3053,10 @@ function media_upload_html_bypass() {

Switch to the multi-file uploader.' ), + /* translators: %s: HTML attributes for button. */ + __( 'You are using the browser’s built-in file uploader. The WordPress uploader includes multiple file selection and drag and drop capability. .' ), 'type="button" class="button-link"' - ); + ); ?>

Date: Tue, 28 Oct 2025 16:14:08 -0500 Subject: [PATCH 4/6] Update media.php --- src/wp-admin/includes/media.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/media.php b/src/wp-admin/includes/media.php index 7baa2841ecff7..c51b729d86c76 100644 --- a/src/wp-admin/includes/media.php +++ b/src/wp-admin/includes/media.php @@ -3055,7 +3055,7 @@ function media_upload_html_bypass() { printf( /* translators: %s: HTML attributes for button. */ __( 'You are using the browser’s built-in file uploader. The WordPress uploader includes multiple file selection and drag and drop capability. .' ), - 'type="button" class="button-link"' + 'type="button" class="button-link"' ); ?>

From e99144d6528e1efd31ca02d3897622b9cc451a53 Mon Sep 17 00:00:00 2001 From: Joe Dolson Date: Tue, 28 Oct 2025 16:23:58 -0500 Subject: [PATCH 5/6] Set focus after switching uploaders. --- src/js/_enqueues/vendor/plupload/handlers.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/js/_enqueues/vendor/plupload/handlers.js b/src/js/_enqueues/vendor/plupload/handlers.js index 840cb2e1c3445..86595bc25b373 100644 --- a/src/js/_enqueues/vendor/plupload/handlers.js +++ b/src/js/_enqueues/vendor/plupload/handlers.js @@ -276,9 +276,12 @@ function switchUploader( s ) { if ( typeof( uploader ) == 'object' ) uploader.refresh(); + + jQuery( '#plupload-browse-button' ).trigger( 'focus' ); } else { setUserSetting( 'uploader', '1' ); // 1 == html uploader. jQuery( '.media-upload-form' ).addClass( 'html-uploader' ); + jQuery( '#async-upload' ).trigger( 'focus' ); } } From 9ff89616aba6df2a9f40c3747850aadae877d3a1 Mon Sep 17 00:00:00 2001 From: Joe Dolson Date: Thu, 30 Oct 2025 17:12:26 -0500 Subject: [PATCH 6/6] Update src/js/_enqueues/vendor/plupload/handlers.js Co-authored-by: Stephen A. Bernhardt --- src/js/_enqueues/vendor/plupload/handlers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/_enqueues/vendor/plupload/handlers.js b/src/js/_enqueues/vendor/plupload/handlers.js index 86595bc25b373..2e3125589558c 100644 --- a/src/js/_enqueues/vendor/plupload/handlers.js +++ b/src/js/_enqueues/vendor/plupload/handlers.js @@ -276,7 +276,7 @@ function switchUploader( s ) { if ( typeof( uploader ) == 'object' ) uploader.refresh(); - + jQuery( '#plupload-browse-button' ).trigger( 'focus' ); } else { setUserSetting( 'uploader', '1' ); // 1 == html uploader.