From e6ccdf161fd1e2c9d836081d148f1fbb16767574 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Mon, 19 Feb 2018 02:13:32 +0000 Subject: [PATCH] General: Further improve error messages following [42648]. Props kristastevens, melchoyce. Fixes #38332 for trunk. Built from https://develop.svn.wordpress.org/trunk@42719 git-svn-id: http://core.svn.wordpress.org/trunk@42547 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/custom-header.php | 6 +++--- wp-admin/customize.php | 6 +++--- wp-admin/edit-comments.php | 2 +- wp-admin/edit-tags.php | 10 +++++----- wp-admin/edit.php | 2 +- wp-admin/includes/bookmark.php | 2 +- wp-admin/includes/file.php | 2 +- wp-admin/media-upload.php | 4 ++-- wp-admin/nav-menus.php | 2 +- wp-admin/network/site-users.php | 2 +- wp-admin/options.php | 4 ++-- wp-admin/post-new.php | 2 +- wp-admin/press-this.php | 2 +- wp-admin/term.php | 2 +- wp-admin/themes.php | 8 ++++---- wp-admin/user-new.php | 8 ++++---- wp-admin/users.php | 4 ++-- wp-admin/widgets.php | 2 +- wp-includes/class-wp-customize-manager.php | 4 ++-- wp-includes/class-wp-xmlrpc-server.php | 2 +- wp-includes/functions.php | 14 +++++++------- wp-includes/js/wp-ajax-response.js | 2 +- wp-includes/js/wp-ajax-response.min.js | 2 +- wp-includes/script-loader.php | 10 +++++----- wp-includes/version.php | 2 +- 25 files changed, 53 insertions(+), 53 deletions(-) diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php index a8ca1d527b..2930dada8f 100644 --- a/wp-admin/custom-header.php +++ b/wp-admin/custom-header.php @@ -758,7 +758,7 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); check_admin_referer( 'custom-header-upload', '_wpnonce-custom-header-upload' ); if ( ! current_theme_supports( 'custom-header', 'uploads' ) ) { wp_die( - '

' . __( 'An error has occurred.' ) . '

' . + '

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

' . '

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

', 403 ); @@ -922,7 +922,7 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); if ( ! current_theme_supports( 'custom-header', 'uploads' ) ) { wp_die( - '

' . __( 'An error has occurred.' ) . '

' . + '

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

' . '

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

', 403 ); @@ -930,7 +930,7 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); if ( ! empty( $_POST['skip-cropping'] ) && ! ( current_theme_supports( 'custom-header', 'flex-height' ) || current_theme_supports( 'custom-header', 'flex-width' ) ) ) { wp_die( - '

' . __( 'An error has occurred.' ) . '

' . + '

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

' . '

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

', 403 ); diff --git a/wp-admin/customize.php b/wp-admin/customize.php index 0101ee25a7..2486f90145 100644 --- a/wp-admin/customize.php +++ b/wp-admin/customize.php @@ -14,7 +14,7 @@ require_once( dirname( __FILE__ ) . '/admin.php' ); if ( ! current_user_can( 'customize' ) ) { wp_die( - '

' . __( 'You don’t have permission to do this.' ) . '

' . + '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to customize this site.' ) . '

', 403 ); @@ -31,7 +31,7 @@ if ( $wp_customize->changeset_post_id() ) { if ( ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->edit_post, $changeset_post->ID ) ) { wp_die( - '

' . __( 'You don’t have permission to do this.' ) . '

' . + '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to edit this changeset.' ) . '

', 403 ); @@ -76,7 +76,7 @@ if ( $wp_customize->changeset_post_id() ) { if ( in_array( get_post_status( $changeset_post->ID ), array( 'publish', 'trash' ), true ) ) { wp_die( - '

' . __( 'An error has occurred.' ) . '

' . + '

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

' . '

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

' . '

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

', 403 diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index 6b2d4af1be..6e91e1754a 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -10,7 +10,7 @@ require_once( dirname( __FILE__ ) . '/admin.php' ); if ( ! current_user_can( 'edit_posts' ) ) { wp_die( - '

' . __( 'You don’t have permission to do this.' ) . '

' . + '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to edit comments.' ) . '

', 403 ); diff --git a/wp-admin/edit-tags.php b/wp-admin/edit-tags.php index 41e63abd43..2d9ab1dc04 100644 --- a/wp-admin/edit-tags.php +++ b/wp-admin/edit-tags.php @@ -25,7 +25,7 @@ if ( ! in_array( $tax->name, get_taxonomies( array( 'show_ui' => true ) ) ) ) { if ( ! current_user_can( $tax->cap->manage_terms ) ) { wp_die( - '

' . __( 'You don’t have permission to do this.' ) . '

' . + '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to manage terms in this taxonomy.' ) . '

', 403 ); @@ -81,7 +81,7 @@ switch ( $wp_list_table->current_action() ) { if ( ! current_user_can( $tax->cap->edit_terms ) ) { wp_die( - '

' . __( 'You don’t have permission to do this.' ) . '

' . + '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to create terms in this taxonomy.' ) . '

', 403 ); @@ -111,7 +111,7 @@ switch ( $wp_list_table->current_action() ) { if ( ! current_user_can( 'delete_term', $tag_ID ) ) { wp_die( - '

' . __( 'You don’t have permission to do this.' ) . '

' . + '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to delete this item.' ) . '

', 403 ); @@ -131,7 +131,7 @@ switch ( $wp_list_table->current_action() ) { if ( ! current_user_can( $tax->cap->delete_terms ) ) { wp_die( - '

' . __( 'You don’t have permission to do this.' ) . '

' . + '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to delete these items.' ) . '

', 403 ); @@ -167,7 +167,7 @@ switch ( $wp_list_table->current_action() ) { if ( ! current_user_can( 'edit_term', $tag_ID ) ) { wp_die( - '

' . __( 'You don’t have permission to do this.' ) . '

' . + '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to edit this item.' ) . '

', 403 ); diff --git a/wp-admin/edit.php b/wp-admin/edit.php index a05d369e1d..1e8bef5a07 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -38,7 +38,7 @@ if ( ! $post_type_object ) { if ( ! current_user_can( $post_type_object->cap->edit_posts ) ) { wp_die( - '

' . __( 'You don’t have permission to do this.' ) . '

' . + '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to edit posts in this post type.' ) . '

', 403 ); diff --git a/wp-admin/includes/bookmark.php b/wp-admin/includes/bookmark.php index 571dff3c3b..0572b73dec 100644 --- a/wp-admin/includes/bookmark.php +++ b/wp-admin/includes/bookmark.php @@ -28,7 +28,7 @@ function add_link() { function edit_link( $link_id = 0 ) { if ( ! current_user_can( 'manage_links' ) ) { wp_die( - '

' . __( 'You don’t have permission to do this.' ) . '

' . + '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to edit the links for this site.' ) . '

', 403 ); diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index 415befc460..01eb5e5774 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -591,7 +591,7 @@ function wp_edit_theme_plugin_file( $args ) { } if ( ! isset( $result['message'] ) ) { - $message = __( 'An error has occurred.' ); + $message = __( 'Something went wrong.' ); } else { $message = $result['message']; unset( $result['message'] ); diff --git a/wp-admin/media-upload.php b/wp-admin/media-upload.php index 9ca47c65bd..322fcf5a44 100644 --- a/wp-admin/media-upload.php +++ b/wp-admin/media-upload.php @@ -35,7 +35,7 @@ $post_id = isset( $post_id ) ? (int) $post_id : 0; // Require an ID for the edit screen. if ( isset( $action ) && $action == 'edit' && ! $ID ) { wp_die( - '

' . __( 'An error has occurred.' ) . '

' . + '

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

' . '

' . __( 'Invalid item ID.' ) . '

', 403 ); @@ -43,7 +43,7 @@ if ( isset( $action ) && $action == 'edit' && ! $ID ) { if ( ! empty( $_REQUEST['post_id'] ) && ! current_user_can( 'edit_post', $_REQUEST['post_id'] ) ) { wp_die( - '

' . __( 'You don’t have permission to do this.' ) . '

' . + '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to edit this item.' ) . '

', 403 ); diff --git a/wp-admin/nav-menus.php b/wp-admin/nav-menus.php index 7f19e8697b..dafcda90cd 100644 --- a/wp-admin/nav-menus.php +++ b/wp-admin/nav-menus.php @@ -22,7 +22,7 @@ if ( ! current_theme_supports( 'menus' ) && ! current_theme_supports( 'widgets' // Permissions Check if ( ! current_user_can( 'edit_theme_options' ) ) { wp_die( - '

' . __( 'You don’t have permission to do this.' ) . '

' . + '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '

', 403 ); diff --git a/wp-admin/network/site-users.php b/wp-admin/network/site-users.php index 6adaefe6a7..86f858ec99 100644 --- a/wp-admin/network/site-users.php +++ b/wp-admin/network/site-users.php @@ -159,7 +159,7 @@ if ( $action ) { // If the user doesn't already belong to the blog, bail. if ( ! is_user_member_of_blog( $user_id ) ) { wp_die( - '

' . __( 'An error has occurred.' ) . '

' . + '

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

' . '

' . __( 'One of the selected users is not a member of this site.' ) . '

', 403 ); diff --git a/wp-admin/options.php b/wp-admin/options.php index 9705134174..755c5f6b9e 100644 --- a/wp-admin/options.php +++ b/wp-admin/options.php @@ -46,7 +46,7 @@ if ( empty( $option_page ) ) { if ( ! current_user_can( $capability ) ) { wp_die( - '

' . __( 'You don’t have permission to do this.' ) . '

' . + '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to manage these options.' ) . '

', 403 ); @@ -74,7 +74,7 @@ if ( ! empty( $_GET['adminhash'] ) ) { if ( is_multisite() && ! current_user_can( 'manage_network_options' ) && 'update' != $action ) { wp_die( - '

' . __( 'You don’t have permission to do this.' ) . '

' . + '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to delete these items.' ) . '

', 403 ); diff --git a/wp-admin/post-new.php b/wp-admin/post-new.php index 737b626359..da7e08cada 100644 --- a/wp-admin/post-new.php +++ b/wp-admin/post-new.php @@ -57,7 +57,7 @@ $editing = true; if ( ! current_user_can( $post_type_object->cap->edit_posts ) || ! current_user_can( $post_type_object->cap->create_posts ) ) { wp_die( - '

' . __( 'You don’t have permission to do this.' ) . '

' . + '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to create posts as this user.' ) . '

', 403 ); diff --git a/wp-admin/press-this.php b/wp-admin/press-this.php index 7862fd8112..c021aa6b3d 100644 --- a/wp-admin/press-this.php +++ b/wp-admin/press-this.php @@ -18,7 +18,7 @@ function wp_load_press_this() { if ( ! current_user_can( 'edit_posts' ) || ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) { wp_die( __( 'Sorry, you are not allowed to create posts as this user.' ), - __( 'You don’t have permission to do this.' ), + __( 'You need a higher level of permission.' ), 403 ); } elseif ( is_plugin_active( $plugin_file ) ) { diff --git a/wp-admin/term.php b/wp-admin/term.php index d10121daa8..ec8b359d5d 100644 --- a/wp-admin/term.php +++ b/wp-admin/term.php @@ -34,7 +34,7 @@ if ( ! in_array( $taxonomy, get_taxonomies( array( 'show_ui' => true ) ) ) || ! current_user_can( 'edit_term', $tag->term_id ) ) { wp_die( - '

' . __( 'You don’t have permission to do this.' ) . '

' . + '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to edit this item.' ) . '

', 403 ); diff --git a/wp-admin/themes.php b/wp-admin/themes.php index 6994e7fac1..085058fd6a 100644 --- a/wp-admin/themes.php +++ b/wp-admin/themes.php @@ -11,7 +11,7 @@ require_once( dirname( __FILE__ ) . '/admin.php' ); if ( ! current_user_can( 'switch_themes' ) && ! current_user_can( 'edit_theme_options' ) ) { wp_die( - '

' . __( 'You don’t have permission to do this.' ) . '

' . + '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '

', 403 ); @@ -24,7 +24,7 @@ if ( current_user_can( 'switch_themes' ) && isset( $_GET['action'] ) ) { if ( ! $theme->exists() || ! $theme->is_allowed() ) { wp_die( - '

' . __( 'An error has occurred.' ) . '

' . + '

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

' . '

' . __( 'The requested theme does not exist.' ) . '

', 403 ); @@ -39,7 +39,7 @@ if ( current_user_can( 'switch_themes' ) && isset( $_GET['action'] ) ) { if ( ! current_user_can( 'delete_themes' ) ) { wp_die( - '

' . __( 'You don’t have permission to do this.' ) . '

' . + '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to delete this item.' ) . '

', 403 ); @@ -47,7 +47,7 @@ if ( current_user_can( 'switch_themes' ) && isset( $_GET['action'] ) ) { if ( ! $theme->exists() ) { wp_die( - '

' . __( 'An error has occurred.' ) . '

' . + '

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

' . '

' . __( 'The requested theme does not exist.' ) . '

', 403 ); diff --git a/wp-admin/user-new.php b/wp-admin/user-new.php index f6ff3b7e58..87955860d4 100644 --- a/wp-admin/user-new.php +++ b/wp-admin/user-new.php @@ -12,14 +12,14 @@ require_once( dirname( __FILE__ ) . '/admin.php' ); if ( is_multisite() ) { if ( ! current_user_can( 'create_users' ) && ! current_user_can( 'promote_users' ) ) { wp_die( - '

' . __( 'You don’t have permission to do this.' ) . '

' . + '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to add users to this network.' ) . '

', 403 ); } } elseif ( ! current_user_can( 'create_users' ) ) { wp_die( - '

' . __( 'You don’t have permission to do this.' ) . '

' . + '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to create users.' ) . '

', 403 ); @@ -52,7 +52,7 @@ if ( isset( $_REQUEST['action'] ) && 'adduser' == $_REQUEST['action'] ) { if ( ! current_user_can( 'promote_user', $user_details->ID ) ) { wp_die( - '

' . __( 'You don’t have permission to do this.' ) . '

' . + '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to add users to this network.' ) . '

', 403 ); @@ -136,7 +136,7 @@ Please click the following link to confirm the invite: if ( ! current_user_can( 'create_users' ) ) { wp_die( - '

' . __( 'You don’t have permission to do this.' ) . '

' . + '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to create users.' ) . '

', 403 ); diff --git a/wp-admin/users.php b/wp-admin/users.php index 7d5a82571e..9b9276f5b8 100644 --- a/wp-admin/users.php +++ b/wp-admin/users.php @@ -12,7 +12,7 @@ require_once( dirname( __FILE__ ) . '/admin.php' ); if ( ! current_user_can( 'list_users' ) ) { wp_die( - '

' . __( 'You don’t have permission to do this.' ) . '

' . + '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to list users.' ) . '

', 403 ); @@ -141,7 +141,7 @@ switch ( $wp_list_table->current_action() ) { // If the user doesn't already belong to the blog, bail. if ( is_multisite() && ! is_user_member_of_blog( $id ) ) { wp_die( - '

' . __( 'An error has occurred.' ) . '

' . + '

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

' . '

' . __( 'One of the selected users is not a member of this site.' ) . '

', 403 ); diff --git a/wp-admin/widgets.php b/wp-admin/widgets.php index 08f5baaafc..7d12a27d6a 100644 --- a/wp-admin/widgets.php +++ b/wp-admin/widgets.php @@ -14,7 +14,7 @@ require_once( ABSPATH . 'wp-admin/includes/widgets.php' ); if ( ! current_user_can( 'edit_theme_options' ) ) { wp_die( - '

' . __( 'You don’t have permission to do this.' ) . '

' . + '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '

', 403 ); diff --git a/wp-includes/class-wp-customize-manager.php b/wp-includes/class-wp-customize-manager.php index a73d429111..2749b0bf81 100644 --- a/wp-includes/class-wp-customize-manager.php +++ b/wp-includes/class-wp-customize-manager.php @@ -447,7 +447,7 @@ final class WP_Customize_Manager { } if ( ! $message ) { - $message = __( 'An error has occurred.' ); + $message = __( 'Something went wrong.' ); } if ( $this->messenger_channel ) { @@ -512,7 +512,7 @@ final class WP_Customize_Manager { auth_redirect(); } else { wp_die( - '

' . __( 'You don’t have permission to do this.' ) . '

' . + '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to customize this site.' ) . '

', 403 ); diff --git a/wp-includes/class-wp-xmlrpc-server.php b/wp-includes/class-wp-xmlrpc-server.php index 019ba42567..9546f1a376 100644 --- a/wp-includes/class-wp-xmlrpc-server.php +++ b/wp-includes/class-wp-xmlrpc-server.php @@ -3879,7 +3879,7 @@ class wp_xmlrpc_server extends IXR_Server { } if ( ! $comment_ID ) { - return new IXR_Error( 403, __( 'An error has occurred.' ) ); + return new IXR_Error( 403, __( 'Something went wrong.' ) ); } /** diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 2e432e2d0f..53a2204376 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -673,11 +673,11 @@ function wp_get_http_headers( $url, $deprecated = false ) { /** * Determines whether the publish date of the current post in the loop is different * from the publish date of the previous post in the loop. - * + * * For more information on this and similar theme functions, check out - * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ + * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ * Conditional Tags} article in the Theme Developer Handbook. - * + * * @since 0.71 * * @global string $currentday The day of the current post in the loop. @@ -1393,9 +1393,9 @@ function do_robots() { * cache, and the database goes away, then you might have problems. * * Checks for the 'siteurl' option for whether WordPress is installed. - * + * * For more information on this and similar theme functions, check out - * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ + * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ * Conditional Tags} article in the Theme Developer Handbook. * * @since 2.1.0 @@ -2727,7 +2727,7 @@ function wp_nonce_ays( $action ) { wp_logout_url( $redirect_to ) ); } else { - $html = __( 'The link you followed no longer exists.' ); + $html = __( 'The link you followed has expired.' ); if ( wp_get_referer() ) { $html .= '

'; $html .= sprintf( @@ -2738,7 +2738,7 @@ function wp_nonce_ays( $action ) { } } - wp_die( $html, __( 'An error has occurred.' ), 403 ); + wp_die( $html, __( 'Something went wrong.' ), 403 ); } /** diff --git a/wp-includes/js/wp-ajax-response.js b/wp-includes/js/wp-ajax-response.js index b54eb0354e..363a08bf34 100644 --- a/wp-includes/js/wp-ajax-response.js +++ b/wp-includes/js/wp-ajax-response.js @@ -56,7 +56,7 @@ var wpAjax = jQuery.extend( { selector = jQuery( selector ); return !wpAjax.invalidateForm( selector.find('.form-required').filter( function() { return jQuery('input:visible', this).val() === ''; } ) ).length; } -}, wpAjax || { noPerm: 'Sorry, you are not allowed to do that.', broken: 'An error has occurred.' } ); +}, wpAjax || { noPerm: 'Sorry, you are not allowed to do that.', broken: 'Something went wrong.' } ); // Basic form validation jQuery(document).ready( function($){ diff --git a/wp-includes/js/wp-ajax-response.min.js b/wp-includes/js/wp-ajax-response.min.js index dd2911cb9f..13bcc1d48a 100644 --- a/wp-includes/js/wp-ajax-response.min.js +++ b/wp-includes/js/wp-ajax-response.min.js @@ -1 +1 @@ -var wpAjax=jQuery.extend({unserialize:function(a){var b,c,d,e,f={};if(!a)return f;b=a.split("?"),b[1]&&(a=b[1]),c=a.split("&");for(d in c)jQuery.isFunction(c.hasOwnProperty)&&!c.hasOwnProperty(d)||(e=c[d].split("="),f[e[0]]=e[1]);return f},parseAjaxResponse:function(a,b,c){var d={},e=jQuery("#"+b).empty(),f="";return a&&"object"==typeof a&&a.getElementsByTagName("wp_ajax")?(d.responses=[],d.errors=!1,jQuery("response",a).each(function(){var b,e=jQuery(this),g=jQuery(this.firstChild);b={action:e.attr("action"),what:g.get(0).nodeName,id:g.attr("id"),oldId:g.attr("old_id"),position:g.attr("position")},b.data=jQuery("response_data",g).text(),b.supplemental={},jQuery("supplemental",g).children().each(function(){b.supplemental[this.nodeName]=jQuery(this).text()}).length||(b.supplemental=!1),b.errors=[],jQuery("wp_error",g).each(function(){var e,g,h,i=jQuery(this).attr("code");e={code:i,message:this.firstChild.nodeValue,data:!1},g=jQuery('wp_error_data[code="'+i+'"]',a),g&&(e.data=g.get()),h=jQuery("form-field",g).text(),h&&(i=h),c&&wpAjax.invalidateForm(jQuery("#"+c+' :input[name="'+i+'"]').parents(".form-field:first")),f+="

"+e.message+"

",b.errors.push(e),d.errors=!0}).length||(b.errors=!1),d.responses.push(b)}),f.length&&e.html('
'+f+"
"),d):isNaN(a)?!e.html('

'+a+"

"):(a=parseInt(a,10),-1==a?!e.html('

'+wpAjax.noPerm+"

"):0!==a||!e.html('

'+wpAjax.broken+"

"))},invalidateForm:function(a){return jQuery(a).addClass("form-invalid").find("input").one("change wp-check-valid-field",function(){jQuery(this).closest(".form-invalid").removeClass("form-invalid")})},validateForm:function(a){return a=jQuery(a),!wpAjax.invalidateForm(a.find(".form-required").filter(function(){return""===jQuery("input:visible",this).val()})).length}},wpAjax||{noPerm:"Sorry, you are not allowed to do that.",broken:"An error has occurred."});jQuery(document).ready(function(a){a("form.validate").submit(function(){return wpAjax.validateForm(a(this))})}); \ No newline at end of file +var wpAjax=jQuery.extend({unserialize:function(a){var b,c,d,e,f={};if(!a)return f;b=a.split("?"),b[1]&&(a=b[1]),c=a.split("&");for(d in c)jQuery.isFunction(c.hasOwnProperty)&&!c.hasOwnProperty(d)||(e=c[d].split("="),f[e[0]]=e[1]);return f},parseAjaxResponse:function(a,b,c){var d={},e=jQuery("#"+b).empty(),f="";return a&&"object"==typeof a&&a.getElementsByTagName("wp_ajax")?(d.responses=[],d.errors=!1,jQuery("response",a).each(function(){var b,e=jQuery(this),g=jQuery(this.firstChild);b={action:e.attr("action"),what:g.get(0).nodeName,id:g.attr("id"),oldId:g.attr("old_id"),position:g.attr("position")},b.data=jQuery("response_data",g).text(),b.supplemental={},jQuery("supplemental",g).children().each(function(){b.supplemental[this.nodeName]=jQuery(this).text()}).length||(b.supplemental=!1),b.errors=[],jQuery("wp_error",g).each(function(){var e,g,h,i=jQuery(this).attr("code");e={code:i,message:this.firstChild.nodeValue,data:!1},g=jQuery('wp_error_data[code="'+i+'"]',a),g&&(e.data=g.get()),h=jQuery("form-field",g).text(),h&&(i=h),c&&wpAjax.invalidateForm(jQuery("#"+c+' :input[name="'+i+'"]').parents(".form-field:first")),f+="

"+e.message+"

",b.errors.push(e),d.errors=!0}).length||(b.errors=!1),d.responses.push(b)}),f.length&&e.html('
'+f+"
"),d):isNaN(a)?!e.html('

'+a+"

"):(a=parseInt(a,10),-1==a?!e.html('

'+wpAjax.noPerm+"

"):0!==a||!e.html('

'+wpAjax.broken+"

"))},invalidateForm:function(a){return jQuery(a).addClass("form-invalid").find("input").one("change wp-check-valid-field",function(){jQuery(this).closest(".form-invalid").removeClass("form-invalid")})},validateForm:function(a){return a=jQuery(a),!wpAjax.invalidateForm(a.find(".form-required").filter(function(){return""===jQuery("input:visible",this).val()})).length}},wpAjax||{noPerm:"Sorry, you are not allowed to do that.",broken:"Something went wrong."});jQuery(document).ready(function(a){a("form.validate").submit(function(){return wpAjax.validateForm(a(this))})}); \ No newline at end of file diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 225f1869be..6a1a7f2bd8 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -137,7 +137,7 @@ function wp_default_scripts( &$scripts ) { did_action( 'init' ) && $scripts->localize( 'wp-ajax-response', 'wpAjax', array( 'noPerm' => __( 'Sorry, you are not allowed to do that.' ), - 'broken' => __( 'An error has occurred.' ), + 'broken' => __( 'Something went wrong.' ), ) ); @@ -605,8 +605,8 @@ function wp_default_scripts( &$scripts ) { 'close' => __( 'Close' ), 'action' => __( 'Action' ), 'discardChanges' => __( 'Discard changes' ), - 'cheatin' => __( 'An error has occurred.' ), - 'notAllowedHeading' => __( 'You don’t have permission to do this.' ), + 'cheatin' => __( 'Something went wrong.' ), + 'notAllowedHeading' => __( 'You need a higher level of permission.' ), 'notAllowed' => __( 'Sorry, you are not allowed to customize this site.' ), 'previewIframeTitle' => __( 'Site Preview' ), 'loginIframeTitle' => __( 'Session expired' ), @@ -689,7 +689,7 @@ function wp_default_scripts( &$scripts ) { did_action( 'init' ) && $scripts->localize( 'admin-tags', 'tagsl10n', array( 'noPerm' => __( 'Sorry, you are not allowed to do that.' ), - 'broken' => __( 'An error has occurred.' ), + 'broken' => __( 'Something went wrong.' ), ) ); @@ -918,7 +918,7 @@ function wp_default_scripts( &$scripts ) { 'activateImporter' => __( 'Run Importer' ), /* translators: %s: Importer name */ 'activateImporterLabel' => __( 'Run %s' ), - 'unknownError' => __( 'An error has occurred.' ), + 'unknownError' => __( 'Something went wrong.' ), 'connectionError' => __( 'Connection lost or the server is busy. Please try again later.' ), 'nonceError' => __( 'An error has occurred. Please reload the page and try again.' ), 'pluginsFound' => __( 'Number of plugins found: %d' ), diff --git a/wp-includes/version.php b/wp-includes/version.php index 22dcd58fc9..1752fb8486 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-alpha-42718'; +$wp_version = '5.0-alpha-42719'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.