From c5293a0be9a7df801c79433d8dc0582ba6072985 Mon Sep 17 00:00:00 2001 From: audrasjb Date: Sat, 8 Feb 2025 15:53:17 +0000 Subject: [PATCH] Administration: Error messages improvements in WP Admin. This changeset improves a bunch of WP-Admin error messages, notably replacing the good old cryptic "Something went wrong" message with more helpful information. Props peterwilsoncc, netweb, karmatosed, JoshuaWold, mrtortai, audrasjb, sukhendu2002, joedolson. See #43622. Built from https://develop.svn.wordpress.org/trunk@59789 git-svn-id: http://core.svn.wordpress.org/trunk@59131 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/customize.php | 4 ++-- wp-admin/includes/class-custom-image-header.php | 10 +++++----- wp-admin/includes/file.php | 2 +- wp-admin/includes/revision.php | 2 +- wp-admin/js/tags.js | 2 +- wp-admin/js/tags.min.js | 2 +- wp-admin/js/theme-plugin-editor.js | 2 +- wp-admin/js/theme-plugin-editor.min.js | 2 +- wp-admin/js/updates.js | 2 +- wp-admin/js/updates.min.js | 2 +- wp-admin/media-upload.php | 4 ++-- wp-admin/network/site-users.php | 2 +- wp-admin/themes.php | 4 ++-- wp-admin/users.php | 2 +- wp-includes/js/wp-ajax-response.js | 2 +- wp-includes/js/wp-ajax-response.min.js | 2 +- wp-includes/version.php | 2 +- 17 files changed, 24 insertions(+), 24 deletions(-) diff --git a/wp-admin/customize.php b/wp-admin/customize.php index b27292d9eb..9fe0b3f6d3 100644 --- a/wp-admin/customize.php +++ b/wp-admin/customize.php @@ -76,8 +76,8 @@ if ( $wp_customize->changeset_post_id() ) { if ( in_array( get_post_status( $changeset_post->ID ), array( 'publish', 'trash' ), true ) ) { wp_die( - '

' . __( 'Something went wrong.' ) . '

' . - '

' . __( 'This changeset cannot be further modified.' ) . '

' . + '

' . __( 'An error occurred while saving your changeset.' ) . '

' . + '

' . __( 'Please try again or start a new changeset. This changeset cannot be further modified.' ) . '

' . '

' . __( 'Customize New Changes' ) . '

', 403 ); diff --git a/wp-admin/includes/class-custom-image-header.php b/wp-admin/includes/class-custom-image-header.php index 2e1bf47fda..54be1d90e4 100644 --- a/wp-admin/includes/class-custom-image-header.php +++ b/wp-admin/includes/class-custom-image-header.php @@ -830,8 +830,8 @@ endif; if ( ! current_theme_supports( 'custom-header', 'uploads' ) ) { wp_die( - '

' . __( 'Something went wrong.' ) . '

' . - '

' . __( 'The active theme does not support uploading a custom header image.' ) . '

', + '

' . __( 'An error occurred while processing your header image.' ) . '

' . + '

' . __( 'The active theme does not support uploading a custom header image. Please ensure your theme supports custom headers and try again.' ) . '

', 403 ); } @@ -1018,8 +1018,8 @@ endif; if ( ! current_theme_supports( 'custom-header', 'uploads' ) ) { wp_die( - '

' . __( 'Something went wrong.' ) . '

' . - '

' . __( 'The active theme does not support uploading a custom header image.' ) . '

', + '

' . __( 'An error occurred while processing your header image.' ) . '

' . + '

' . __( 'The active theme does not support uploading a custom header image. Please ensure your theme supports custom headers and try again.' ) . '

', 403 ); } @@ -1029,7 +1029,7 @@ endif; && ! current_theme_supports( 'custom-header', 'flex-width' ) ) { wp_die( - '

' . __( 'Something went wrong.' ) . '

' . + '

' . __( 'An error occurred while processing your header image.' ) . '

' . '

' . __( 'The active theme does not support a flexible sized header image.' ) . '

', 403 ); diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index b1ea3fba1b..152a1e2f21 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -635,7 +635,7 @@ function wp_edit_theme_plugin_file( $args ) { wp_opcache_invalidate( $real_file, true ); if ( ! isset( $result['message'] ) ) { - $message = __( 'Something went wrong.' ); + $message = __( 'An error occurred. Please try again later.' ); } else { $message = $result['message']; unset( $result['message'] ); diff --git a/wp-admin/includes/revision.php b/wp-admin/includes/revision.php index ab3842fc55..df7201e958 100644 --- a/wp-admin/includes/revision.php +++ b/wp-admin/includes/revision.php @@ -466,7 +466,7 @@ function wp_print_revision_templates() {