General: Replace `Cheatin’ uh?` with friendlier error messages.

While intended as a playful error message, `Cheatin’ uh?` can be interpreted as insulting or accusatory in an already stressful situation. This replaces Cheatin’ with more meaningful error messages, depending on the error that occurs.

Props ElectricFeet, EricMeyer, karmatosed, dd32, BandonRandon, melchoyce for language; dmsnell for original patch; peterwilsoncc.
Fixes #38332.


Built from https://develop.svn.wordpress.org/trunk@42648


git-svn-id: http://core.svn.wordpress.org/trunk@42477 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Peter Wilson 2018-02-05 02:30:34 +00:00
parent a1eb261cd1
commit 0d39b35c11
27 changed files with 50 additions and 49 deletions

View File

@ -758,7 +758,7 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' );
check_admin_referer( 'custom-header-upload', '_wpnonce-custom-header-upload' ); check_admin_referer( 'custom-header-upload', '_wpnonce-custom-header-upload' );
if ( ! current_theme_supports( 'custom-header', 'uploads' ) ) { if ( ! current_theme_supports( 'custom-header', 'uploads' ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'An error has occurred.' ) . '</h1>' .
'<p>' . __( 'The current theme does not support uploading a custom header image.' ) . '</p>', '<p>' . __( 'The current theme does not support uploading a custom header image.' ) . '</p>',
403 403
); );
@ -922,7 +922,7 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' );
if ( ! current_theme_supports( 'custom-header', 'uploads' ) ) { if ( ! current_theme_supports( 'custom-header', 'uploads' ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'An error has occurred.' ) . '</h1>' .
'<p>' . __( 'The current theme does not support uploading a custom header image.' ) . '</p>', '<p>' . __( 'The current theme does not support uploading a custom header image.' ) . '</p>',
403 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' ) ) ) { if ( ! empty( $_POST['skip-cropping'] ) && ! ( current_theme_supports( 'custom-header', 'flex-height' ) || current_theme_supports( 'custom-header', 'flex-width' ) ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'An error has occurred.' ) . '</h1>' .
'<p>' . __( 'The current theme does not support a flexible sized header image.' ) . '</p>', '<p>' . __( 'The current theme does not support a flexible sized header image.' ) . '</p>',
403 403
); );

View File

@ -14,7 +14,7 @@ require_once( dirname( __FILE__ ) . '/admin.php' );
if ( ! current_user_can( 'customize' ) ) { if ( ! current_user_can( 'customize' ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
'<p>' . __( 'Sorry, you are not allowed to customize this site.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to customize this site.' ) . '</p>',
403 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 ) ) { if ( ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->edit_post, $changeset_post->ID ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
'<p>' . __( 'Sorry, you are not allowed to edit this changeset.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to edit this changeset.' ) . '</p>',
403 403
); );
@ -76,7 +76,7 @@ if ( $wp_customize->changeset_post_id() ) {
if ( in_array( get_post_status( $changeset_post->ID ), array( 'publish', 'trash' ), true ) ) { if ( in_array( get_post_status( $changeset_post->ID ), array( 'publish', 'trash' ), true ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'An error has occurred.' ) . '</h1>' .
'<p>' . __( 'This changeset cannot be further modified.' ) . '</p>' . '<p>' . __( 'This changeset cannot be further modified.' ) . '</p>' .
'<p><a href="' . esc_url( remove_query_arg( 'changeset_uuid' ) ) . '">' . __( 'Customize New Changes' ) . '</a></p>', '<p><a href="' . esc_url( remove_query_arg( 'changeset_uuid' ) ) . '">' . __( 'Customize New Changes' ) . '</a></p>',
403 403

View File

@ -10,7 +10,7 @@
require_once( dirname( __FILE__ ) . '/admin.php' ); require_once( dirname( __FILE__ ) . '/admin.php' );
if ( ! current_user_can( 'edit_posts' ) ) { if ( ! current_user_can( 'edit_posts' ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
'<p>' . __( 'Sorry, you are not allowed to edit comments.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to edit comments.' ) . '</p>',
403 403
); );

View File

@ -25,7 +25,7 @@ if ( ! in_array( $tax->name, get_taxonomies( array( 'show_ui' => true ) ) ) ) {
if ( ! current_user_can( $tax->cap->manage_terms ) ) { if ( ! current_user_can( $tax->cap->manage_terms ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
'<p>' . __( 'Sorry, you are not allowed to manage terms in this taxonomy.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to manage terms in this taxonomy.' ) . '</p>',
403 403
); );
@ -81,7 +81,7 @@ switch ( $wp_list_table->current_action() ) {
if ( ! current_user_can( $tax->cap->edit_terms ) ) { if ( ! current_user_can( $tax->cap->edit_terms ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
'<p>' . __( 'Sorry, you are not allowed to create terms in this taxonomy.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to create terms in this taxonomy.' ) . '</p>',
403 403
); );
@ -111,7 +111,7 @@ switch ( $wp_list_table->current_action() ) {
if ( ! current_user_can( 'delete_term', $tag_ID ) ) { if ( ! current_user_can( 'delete_term', $tag_ID ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
'<p>' . __( 'Sorry, you are not allowed to delete this item.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to delete this item.' ) . '</p>',
403 403
); );
@ -131,7 +131,7 @@ switch ( $wp_list_table->current_action() ) {
if ( ! current_user_can( $tax->cap->delete_terms ) ) { if ( ! current_user_can( $tax->cap->delete_terms ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
'<p>' . __( 'Sorry, you are not allowed to delete these items.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to delete these items.' ) . '</p>',
403 403
); );
@ -167,7 +167,7 @@ switch ( $wp_list_table->current_action() ) {
if ( ! current_user_can( 'edit_term', $tag_ID ) ) { if ( ! current_user_can( 'edit_term', $tag_ID ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
'<p>' . __( 'Sorry, you are not allowed to edit this item.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to edit this item.' ) . '</p>',
403 403
); );

View File

@ -38,7 +38,7 @@ if ( ! $post_type_object ) {
if ( ! current_user_can( $post_type_object->cap->edit_posts ) ) { if ( ! current_user_can( $post_type_object->cap->edit_posts ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
'<p>' . __( 'Sorry, you are not allowed to edit posts in this post type.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to edit posts in this post type.' ) . '</p>',
403 403
); );

View File

@ -28,7 +28,7 @@ function add_link() {
function edit_link( $link_id = 0 ) { function edit_link( $link_id = 0 ) {
if ( ! current_user_can( 'manage_links' ) ) { if ( ! current_user_can( 'manage_links' ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
'<p>' . __( 'Sorry, you are not allowed to edit the links for this site.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to edit the links for this site.' ) . '</p>',
403 403
); );

View File

@ -591,7 +591,7 @@ function wp_edit_theme_plugin_file( $args ) {
} }
if ( ! isset( $result['message'] ) ) { if ( ! isset( $result['message'] ) ) {
$message = __( 'An unidentified error has occurred.' ); $message = __( 'An error has occurred.' );
} else { } else {
$message = $result['message']; $message = $result['message'];
unset( $result['message'] ); unset( $result['message'] );

View File

@ -6836,7 +6836,7 @@
cheatin: function() { cheatin: function() {
$( document.body ).empty().addClass( 'cheatin' ).append( $( document.body ).empty().addClass( 'cheatin' ).append(
'<h1>' + api.l10n.cheatin + '</h1>' + '<h1>' + api.l10n.notAllowedHeading + '</h1>' +
'<p>' + api.l10n.notAllowed + '</p>' '<p>' + api.l10n.notAllowed + '</p>'
); );
}, },

File diff suppressed because one or more lines are too long

View File

@ -35,7 +35,7 @@ $post_id = isset( $post_id ) ? (int) $post_id : 0;
// Require an ID for the edit screen. // Require an ID for the edit screen.
if ( isset( $action ) && $action == 'edit' && ! $ID ) { if ( isset( $action ) && $action == 'edit' && ! $ID ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'An error has occurred.' ) . '</h1>' .
'<p>' . __( 'Invalid item ID.' ) . '</p>', '<p>' . __( 'Invalid item ID.' ) . '</p>',
403 403
); );
@ -43,7 +43,7 @@ if ( isset( $action ) && $action == 'edit' && ! $ID ) {
if ( ! empty( $_REQUEST['post_id'] ) && ! current_user_can( 'edit_post', $_REQUEST['post_id'] ) ) { if ( ! empty( $_REQUEST['post_id'] ) && ! current_user_can( 'edit_post', $_REQUEST['post_id'] ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
'<p>' . __( 'Sorry, you are not allowed to edit this item.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to edit this item.' ) . '</p>',
403 403
); );

View File

@ -22,7 +22,7 @@ if ( ! current_theme_supports( 'menus' ) && ! current_theme_supports( 'widgets'
// Permissions Check // Permissions Check
if ( ! current_user_can( 'edit_theme_options' ) ) { if ( ! current_user_can( 'edit_theme_options' ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
'<p>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>',
403 403
); );

View File

@ -159,7 +159,7 @@ if ( $action ) {
// If the user doesn't already belong to the blog, bail. // If the user doesn't already belong to the blog, bail.
if ( ! is_user_member_of_blog( $user_id ) ) { if ( ! is_user_member_of_blog( $user_id ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'An error has occurred.' ) . '</h1>' .
'<p>' . __( 'One of the selected users is not a member of this site.' ) . '</p>', '<p>' . __( 'One of the selected users is not a member of this site.' ) . '</p>',
403 403
); );

View File

@ -46,7 +46,7 @@ if ( empty( $option_page ) ) {
if ( ! current_user_can( $capability ) ) { if ( ! current_user_can( $capability ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
'<p>' . __( 'Sorry, you are not allowed to manage these options.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to manage these options.' ) . '</p>',
403 403
); );
@ -74,7 +74,7 @@ if ( ! empty( $_GET['adminhash'] ) ) {
if ( is_multisite() && ! current_user_can( 'manage_network_options' ) && 'update' != $action ) { if ( is_multisite() && ! current_user_can( 'manage_network_options' ) && 'update' != $action ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
'<p>' . __( 'Sorry, you are not allowed to delete these items.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to delete these items.' ) . '</p>',
403 403
); );

View File

@ -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 ) ) { if ( ! current_user_can( $post_type_object->cap->edit_posts ) || ! current_user_can( $post_type_object->cap->create_posts ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
'<p>' . __( 'Sorry, you are not allowed to create posts as this user.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to create posts as this user.' ) . '</p>',
403 403
); );

View File

@ -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 ) ) { if ( ! current_user_can( 'edit_posts' ) || ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) {
wp_die( wp_die(
__( 'Sorry, you are not allowed to create posts as this user.' ), __( 'Sorry, you are not allowed to create posts as this user.' ),
__( 'Cheatin&#8217; uh?' ), __( 'You don&#8217;t have permission to do this.' ),
403 403
); );
} elseif ( is_plugin_active( $plugin_file ) ) { } elseif ( is_plugin_active( $plugin_file ) ) {

View File

@ -34,7 +34,7 @@ if ( ! in_array( $taxonomy, get_taxonomies( array( 'show_ui' => true ) ) ) ||
! current_user_can( 'edit_term', $tag->term_id ) ) { ! current_user_can( 'edit_term', $tag->term_id ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
'<p>' . __( 'Sorry, you are not allowed to edit this item.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to edit this item.' ) . '</p>',
403 403
); );

View File

@ -11,7 +11,7 @@ require_once( dirname( __FILE__ ) . '/admin.php' );
if ( ! current_user_can( 'switch_themes' ) && ! current_user_can( 'edit_theme_options' ) ) { if ( ! current_user_can( 'switch_themes' ) && ! current_user_can( 'edit_theme_options' ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
'<p>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>',
403 403
); );
@ -24,7 +24,7 @@ if ( current_user_can( 'switch_themes' ) && isset( $_GET['action'] ) ) {
if ( ! $theme->exists() || ! $theme->is_allowed() ) { if ( ! $theme->exists() || ! $theme->is_allowed() ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'An error has occurred.' ) . '</h1>' .
'<p>' . __( 'The requested theme does not exist.' ) . '</p>', '<p>' . __( 'The requested theme does not exist.' ) . '</p>',
403 403
); );
@ -39,7 +39,7 @@ if ( current_user_can( 'switch_themes' ) && isset( $_GET['action'] ) ) {
if ( ! current_user_can( 'delete_themes' ) ) { if ( ! current_user_can( 'delete_themes' ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
'<p>' . __( 'Sorry, you are not allowed to delete this item.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to delete this item.' ) . '</p>',
403 403
); );
@ -47,7 +47,7 @@ if ( current_user_can( 'switch_themes' ) && isset( $_GET['action'] ) ) {
if ( ! $theme->exists() ) { if ( ! $theme->exists() ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'An error has occurred.' ) . '</h1>' .
'<p>' . __( 'The requested theme does not exist.' ) . '</p>', '<p>' . __( 'The requested theme does not exist.' ) . '</p>',
403 403
); );

View File

@ -12,14 +12,14 @@ require_once( dirname( __FILE__ ) . '/admin.php' );
if ( is_multisite() ) { if ( is_multisite() ) {
if ( ! current_user_can( 'create_users' ) && ! current_user_can( 'promote_users' ) ) { if ( ! current_user_can( 'create_users' ) && ! current_user_can( 'promote_users' ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
'<p>' . __( 'Sorry, you are not allowed to add users to this network.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to add users to this network.' ) . '</p>',
403 403
); );
} }
} elseif ( ! current_user_can( 'create_users' ) ) { } elseif ( ! current_user_can( 'create_users' ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
'<p>' . __( 'Sorry, you are not allowed to create users.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to create users.' ) . '</p>',
403 403
); );
@ -52,7 +52,7 @@ if ( isset( $_REQUEST['action'] ) && 'adduser' == $_REQUEST['action'] ) {
if ( ! current_user_can( 'promote_user', $user_details->ID ) ) { if ( ! current_user_can( 'promote_user', $user_details->ID ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
'<p>' . __( 'Sorry, you are not allowed to add users to this network.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to add users to this network.' ) . '</p>',
403 403
); );
@ -136,7 +136,7 @@ Please click the following link to confirm the invite:
if ( ! current_user_can( 'create_users' ) ) { if ( ! current_user_can( 'create_users' ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
'<p>' . __( 'Sorry, you are not allowed to create users.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to create users.' ) . '</p>',
403 403
); );

View File

@ -12,7 +12,7 @@ require_once( dirname( __FILE__ ) . '/admin.php' );
if ( ! current_user_can( 'list_users' ) ) { if ( ! current_user_can( 'list_users' ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
'<p>' . __( 'Sorry, you are not allowed to list users.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to list users.' ) . '</p>',
403 403
); );
@ -141,7 +141,7 @@ switch ( $wp_list_table->current_action() ) {
// If the user doesn't already belong to the blog, bail. // If the user doesn't already belong to the blog, bail.
if ( is_multisite() && ! is_user_member_of_blog( $id ) ) { if ( is_multisite() && ! is_user_member_of_blog( $id ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'An error has occurred.' ) . '</h1>' .
'<p>' . __( 'One of the selected users is not a member of this site.' ) . '</p>', '<p>' . __( 'One of the selected users is not a member of this site.' ) . '</p>',
403 403
); );

View File

@ -14,7 +14,7 @@ require_once( ABSPATH . 'wp-admin/includes/widgets.php' );
if ( ! current_user_can( 'edit_theme_options' ) ) { if ( ! current_user_can( 'edit_theme_options' ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
'<p>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>',
403 403
); );

View File

@ -447,7 +447,7 @@ final class WP_Customize_Manager {
} }
if ( ! $message ) { if ( ! $message ) {
$message = __( 'Cheatin&#8217; uh?' ); $message = __( 'An error has occurred.' );
} }
if ( $this->messenger_channel ) { if ( $this->messenger_channel ) {
@ -512,7 +512,7 @@ final class WP_Customize_Manager {
auth_redirect(); auth_redirect();
} else { } else {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
'<p>' . __( 'Sorry, you are not allowed to customize this site.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to customize this site.' ) . '</p>',
403 403
); );

View File

@ -3879,7 +3879,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
if ( ! $comment_ID ) { if ( ! $comment_ID ) {
return new IXR_Error( 403, __( 'An unidentified error has occurred.' ) ); return new IXR_Error( 403, __( 'An error has occurred.' ) );
} }
/** /**

View File

@ -2718,7 +2718,7 @@ function wp_nonce_ays( $action ) {
wp_logout_url( $redirect_to ) wp_logout_url( $redirect_to )
); );
} else { } else {
$html = __( 'Are you sure you want to do this?' ); $html = __( 'The link you followed no longer exists.' );
if ( wp_get_referer() ) { if ( wp_get_referer() ) {
$html .= '</p><p>'; $html .= '</p><p>';
$html .= sprintf( $html .= sprintf(
@ -2729,7 +2729,7 @@ function wp_nonce_ays( $action ) {
} }
} }
wp_die( $html, __( 'WordPress Failure Notice' ), 403 ); wp_die( $html, __( 'An error has occurred.' ), 403 );
} }
/** /**

View File

@ -56,7 +56,7 @@ var wpAjax = jQuery.extend( {
selector = jQuery( selector ); selector = jQuery( selector );
return !wpAjax.invalidateForm( selector.find('.form-required').filter( function() { return jQuery('input:visible', this).val() === ''; } ) ).length; 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 unidentified error has occurred.' } ); }, wpAjax || { noPerm: 'Sorry, you are not allowed to do that.', broken: 'An error has occurred.' } );
// Basic form validation // Basic form validation
jQuery(document).ready( function($){ jQuery(document).ready( function($){

View File

@ -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+="<p>"+e.message+"</p>",b.errors.push(e),d.errors=!0}).length||(b.errors=!1),d.responses.push(b)}),f.length&&e.html('<div class="error">'+f+"</div>"),d):isNaN(a)?!e.html('<div class="error"><p>'+a+"</p></div>"):(a=parseInt(a,10),-1==a?!e.html('<div class="error"><p>'+wpAjax.noPerm+"</p></div>"):0!==a||!e.html('<div class="error"><p>'+wpAjax.broken+"</p></div>"))},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 unidentified error has occurred."});jQuery(document).ready(function(a){a("form.validate").submit(function(){return wpAjax.validateForm(a(this))})}); 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+="<p>"+e.message+"</p>",b.errors.push(e),d.errors=!0}).length||(b.errors=!1),d.responses.push(b)}),f.length&&e.html('<div class="error">'+f+"</div>"),d):isNaN(a)?!e.html('<div class="error"><p>'+a+"</p></div>"):(a=parseInt(a,10),-1==a?!e.html('<div class="error"><p>'+wpAjax.noPerm+"</p></div>"):0!==a||!e.html('<div class="error"><p>'+wpAjax.broken+"</p></div>"))},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))})});

View File

@ -137,7 +137,7 @@ function wp_default_scripts( &$scripts ) {
did_action( 'init' ) && $scripts->localize( did_action( 'init' ) && $scripts->localize(
'wp-ajax-response', 'wpAjax', array( 'wp-ajax-response', 'wpAjax', array(
'noPerm' => __( 'Sorry, you are not allowed to do that.' ), 'noPerm' => __( 'Sorry, you are not allowed to do that.' ),
'broken' => __( 'An unidentified error has occurred.' ), 'broken' => __( 'An error has occurred.' ),
) )
); );
@ -605,7 +605,8 @@ function wp_default_scripts( &$scripts ) {
'close' => __( 'Close' ), 'close' => __( 'Close' ),
'action' => __( 'Action' ), 'action' => __( 'Action' ),
'discardChanges' => __( 'Discard changes' ), 'discardChanges' => __( 'Discard changes' ),
'cheatin' => __( 'Cheatin&#8217; uh?' ), 'cheatin' => __( 'An error has occurred.' ),
'notAllowedHeading' => __( 'You don&#8217;t have permission to do this.' ),
'notAllowed' => __( 'Sorry, you are not allowed to customize this site.' ), 'notAllowed' => __( 'Sorry, you are not allowed to customize this site.' ),
'previewIframeTitle' => __( 'Site Preview' ), 'previewIframeTitle' => __( 'Site Preview' ),
'loginIframeTitle' => __( 'Session expired' ), 'loginIframeTitle' => __( 'Session expired' ),
@ -688,7 +689,7 @@ function wp_default_scripts( &$scripts ) {
did_action( 'init' ) && $scripts->localize( did_action( 'init' ) && $scripts->localize(
'admin-tags', 'tagsl10n', array( 'admin-tags', 'tagsl10n', array(
'noPerm' => __( 'Sorry, you are not allowed to do that.' ), 'noPerm' => __( 'Sorry, you are not allowed to do that.' ),
'broken' => __( 'An unidentified error has occurred.' ), 'broken' => __( 'An error has occurred.' ),
) )
); );
@ -917,7 +918,7 @@ function wp_default_scripts( &$scripts ) {
'activateImporter' => __( 'Run Importer' ), 'activateImporter' => __( 'Run Importer' ),
/* translators: %s: Importer name */ /* translators: %s: Importer name */
'activateImporterLabel' => __( 'Run %s' ), 'activateImporterLabel' => __( 'Run %s' ),
'unknownError' => __( 'An unidentified error has occurred.' ), 'unknownError' => __( 'An error has occurred.' ),
'connectionError' => __( 'Connection lost or the server is busy. Please try again later.' ), 'connectionError' => __( 'Connection lost or the server is busy. Please try again later.' ),
'nonceError' => __( 'An error has occurred. Please reload the page and try again.' ), 'nonceError' => __( 'An error has occurred. Please reload the page and try again.' ),
'pluginsFound' => __( 'Number of plugins found: %d' ), 'pluginsFound' => __( 'Number of plugins found: %d' ),

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.0-alpha-42647'; $wp_version = '5.0-alpha-42648';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.