Skip to content

Commit 892ea5c

Browse files
committed
Switch the upload html bypass to a button
1 parent b80cc73 commit 892ea5c

File tree

2 files changed

+12
-18
lines changed

2 files changed

+12
-18
lines changed

src/js/_enqueues/vendor/plupload/handlers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,11 +420,11 @@ jQuery( document ).ready( function( $ ) {
420420
target.parents( '.media-item' ).fadeOut( 200, function() {
421421
$( this ).remove();
422422
} );
423-
} else if ( target.is( '.upload-flash-bypass a' ) || target.is( 'a.uploader-html' ) ) { // Switch uploader to html4.
423+
} else if ( target.is( '.upload-flash-bypass button' ) || target.is( 'a.uploader-html' ) ) { // Switch uploader to html4.
424424
$( '#media-items, p.submit, span.big-file-warning' ).css( 'display', 'none' );
425425
switchUploader( 0 );
426426
e.preventDefault();
427-
} else if ( target.is( '.upload-html-bypass a' ) ) { // Switch uploader to multi-file.
427+
} else if ( target.is( '.upload-html-bypass button' ) ) { // Switch uploader to multi-file.
428428
$( '#media-items, p.submit, span.big-file-warning' ).css( 'display', '' );
429429
switchUploader( 1 );
430430
e.preventDefault();

src/wp-admin/includes/media.php

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3028,27 +3028,15 @@ function wp_media_insert_url_form( $default_view = 'image' ) {
30283028
* Displays the multi-file uploader message.
30293029
*
30303030
* @since 2.6.0
3031-
*
3032-
* @global int $post_ID
30333031
*/
30343032
function media_upload_flash_bypass() {
3035-
$browser_uploader = admin_url( 'media-new.php?browser-uploader' );
3036-
3037-
$post = get_post();
3038-
if ( $post ) {
3039-
$browser_uploader .= '&post_id=' . (int) $post->ID;
3040-
} elseif ( ! empty( $GLOBALS['post_ID'] ) ) {
3041-
$browser_uploader .= '&post_id=' . (int) $GLOBALS['post_ID'];
3042-
}
3043-
30443033
?>
30453034
<p class="upload-flash-bypass">
30463035
<?php
30473036
printf(
3048-
/* translators: 1: URL to browser uploader, 2: Additional link attributes. */
3049-
__( 'You are using the multi-file uploader. Problems? Try the <a href="%1$s" %2$s>browser uploader</a> instead.' ),
3050-
$browser_uploader,
3051-
'target="_blank"'
3037+
/* translators: %s: HTML attributes for button. */
3038+
__( 'You are using the multi-file uploader. Problems? Try the <button %s>browser uploader</button> instead.' ),
3039+
'type="button" class="button-link"'
30523040
);
30533041
?>
30543042
</p>
@@ -3063,7 +3051,13 @@ function media_upload_flash_bypass() {
30633051
function media_upload_html_bypass() {
30643052
?>
30653053
<p class="upload-html-bypass hide-if-no-js">
3066-
<?php _e( 'You are using the browser&#8217;s built-in file uploader. The WordPress uploader includes multiple file selection and drag and drop capability. <a href="#">Switch to the multi-file uploader</a>.' ); ?>
3054+
<?php
3055+
printf(
3056+
/* translators: %s: HTML attributes for button. */
3057+
__( 'You are using the browser&#8217;s built-in file uploader. The WordPress uploader includes multiple file selection and drag and drop capability. <button %s>Switch to the multi-file uploader</button>.' ),
3058+
'type="button" class="button-link"'
3059+
);
3060+
?>
30673061
</p>
30683062
<?php
30693063
}

0 commit comments

Comments
 (0)