From abaebb17e6ab399dbea61cfb47c26a2804ba4653 Mon Sep 17 00:00:00 2001 From: joedolson Date: Sun, 16 Mar 2025 16:11:24 +0000 Subject: [PATCH] Media: Dismiss button not functional on upload errors. Change the `onclick` attribute to a separate inlined script in the error message and improve the event attachment behavior. Props vivekawsm, mijotj, adamsilverstein, parthvataliya, adhun, sarathar, peterwilsoncc, sayedulsayem, chaion07, sppramodh, indirabiswas27, aishwarryapande, dhrumilk, manojmaharrshi, ugyensupport, imranhasanraaz, pkbhatt, shailu25, joedolson. Fixes #60074. Built from https://develop.svn.wordpress.org/trunk@59986 git-svn-id: http://core.svn.wordpress.org/trunk@59328 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/async-upload.php | 7 +++++-- wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/wp-admin/async-upload.php b/wp-admin/async-upload.php index 683fd83248..2ac2f20e76 100644 --- a/wp-admin/async-upload.php +++ b/wp-admin/async-upload.php @@ -112,10 +112,12 @@ if ( isset( $_REQUEST['post_id'] ) ) { $id = media_handle_upload( 'async-upload', $post_id ); if ( is_wp_error( $id ) ) { - $message = sprintf( + $button_unique_id = uniqid( 'dismiss-' ); + $message = sprintf( '%s %s
%s', sprintf( - '', + '', + esc_attr( $button_unique_id ), __( 'Dismiss' ) ), sprintf( @@ -132,6 +134,7 @@ if ( is_wp_error( $id ) ) { 'paragraph_wrap' => false, ) ); + echo "\n"; exit; } diff --git a/wp-includes/version.php b/wp-includes/version.php index e2cbbc9cb5..1627915c12 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.8-beta2-59985'; +$wp_version = '6.8-beta2-59986'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.