Skip to content

Commit f317869

Browse files
committed
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. git-svn-id: https://develop.svn.wordpress.org/trunk@42648 602fd350-edb4-49c9-b593-d223f7449a82
1 parent d512973 commit f317869

24 files changed

Lines changed: 47 additions & 46 deletions

src/wp-admin/custom-header.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ public function step_2() {
758758
check_admin_referer( 'custom-header-upload', '_wpnonce-custom-header-upload' );
759759
if ( ! current_theme_supports( 'custom-header', 'uploads' ) ) {
760760
wp_die(
761-
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
761+
'<h1>' . __( 'An error has occurred.' ) . '</h1>' .
762762
'<p>' . __( 'The current theme does not support uploading a custom header image.' ) . '</p>',
763763
403
764764
);
@@ -922,15 +922,15 @@ public function step_3() {
922922

923923
if ( ! current_theme_supports( 'custom-header', 'uploads' ) ) {
924924
wp_die(
925-
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
925+
'<h1>' . __( 'An error has occurred.' ) . '</h1>' .
926926
'<p>' . __( 'The current theme does not support uploading a custom header image.' ) . '</p>',
927927
403
928928
);
929929
}
930930

931931
if ( ! empty( $_POST['skip-cropping'] ) && ! ( current_theme_supports( 'custom-header', 'flex-height' ) || current_theme_supports( 'custom-header', 'flex-width' ) ) ) {
932932
wp_die(
933-
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
933+
'<h1>' . __( 'An error has occurred.' ) . '</h1>' .
934934
'<p>' . __( 'The current theme does not support a flexible sized header image.' ) . '</p>',
935935
403
936936
);

src/wp-admin/customize.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
if ( ! current_user_can( 'customize' ) ) {
1616
wp_die(
17-
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
17+
'<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
1818
'<p>' . __( 'Sorry, you are not allowed to customize this site.' ) . '</p>',
1919
403
2020
);
@@ -31,7 +31,7 @@
3131

3232
if ( ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->edit_post, $changeset_post->ID ) ) {
3333
wp_die(
34-
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
34+
'<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
3535
'<p>' . __( 'Sorry, you are not allowed to edit this changeset.' ) . '</p>',
3636
403
3737
);
@@ -76,7 +76,7 @@
7676

7777
if ( in_array( get_post_status( $changeset_post->ID ), array( 'publish', 'trash' ), true ) ) {
7878
wp_die(
79-
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
79+
'<h1>' . __( 'An error has occurred.' ) . '</h1>' .
8080
'<p>' . __( 'This changeset cannot be further modified.' ) . '</p>' .
8181
'<p><a href="' . esc_url( remove_query_arg( 'changeset_uuid' ) ) . '">' . __( 'Customize New Changes' ) . '</a></p>',
8282
403

src/wp-admin/edit-comments.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
require_once( dirname( __FILE__ ) . '/admin.php' );
1111
if ( ! current_user_can( 'edit_posts' ) ) {
1212
wp_die(
13-
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
13+
'<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
1414
'<p>' . __( 'Sorry, you are not allowed to edit comments.' ) . '</p>',
1515
403
1616
);

src/wp-admin/edit-tags.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
if ( ! current_user_can( $tax->cap->manage_terms ) ) {
2727
wp_die(
28-
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
28+
'<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
2929
'<p>' . __( 'Sorry, you are not allowed to manage terms in this taxonomy.' ) . '</p>',
3030
403
3131
);
@@ -81,7 +81,7 @@
8181

8282
if ( ! current_user_can( $tax->cap->edit_terms ) ) {
8383
wp_die(
84-
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
84+
'<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
8585
'<p>' . __( 'Sorry, you are not allowed to create terms in this taxonomy.' ) . '</p>',
8686
403
8787
);
@@ -111,7 +111,7 @@
111111

112112
if ( ! current_user_can( 'delete_term', $tag_ID ) ) {
113113
wp_die(
114-
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
114+
'<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
115115
'<p>' . __( 'Sorry, you are not allowed to delete this item.' ) . '</p>',
116116
403
117117
);
@@ -131,7 +131,7 @@
131131

132132
if ( ! current_user_can( $tax->cap->delete_terms ) ) {
133133
wp_die(
134-
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
134+
'<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
135135
'<p>' . __( 'Sorry, you are not allowed to delete these items.' ) . '</p>',
136136
403
137137
);
@@ -167,7 +167,7 @@
167167

168168
if ( ! current_user_can( 'edit_term', $tag_ID ) ) {
169169
wp_die(
170-
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
170+
'<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
171171
'<p>' . __( 'Sorry, you are not allowed to edit this item.' ) . '</p>',
172172
403
173173
);

src/wp-admin/edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

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

src/wp-admin/includes/bookmark.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function add_link() {
2828
function edit_link( $link_id = 0 ) {
2929
if ( ! current_user_can( 'manage_links' ) ) {
3030
wp_die(
31-
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
31+
'<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
3232
'<p>' . __( 'Sorry, you are not allowed to edit the links for this site.' ) . '</p>',
3333
403
3434
);

src/wp-admin/includes/file.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ function wp_edit_theme_plugin_file( $args ) {
591591
}
592592

593593
if ( ! isset( $result['message'] ) ) {
594-
$message = __( 'An unidentified error has occurred.' );
594+
$message = __( 'An error has occurred.' );
595595
} else {
596596
$message = $result['message'];
597597
unset( $result['message'] );

src/wp-admin/js/customize-controls.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6836,7 +6836,7 @@
68366836

68376837
cheatin: function() {
68386838
$( document.body ).empty().addClass( 'cheatin' ).append(
6839-
'<h1>' + api.l10n.cheatin + '</h1>' +
6839+
'<h1>' + api.l10n.notAllowedHeading + '</h1>' +
68406840
'<p>' + api.l10n.notAllowed + '</p>'
68416841
);
68426842
},

src/wp-admin/media-upload.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@
3535
// Require an ID for the edit screen.
3636
if ( isset( $action ) && $action == 'edit' && ! $ID ) {
3737
wp_die(
38-
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
38+
'<h1>' . __( 'An error has occurred.' ) . '</h1>' .
3939
'<p>' . __( 'Invalid item ID.' ) . '</p>',
4040
403
4141
);
4242
}
4343

4444
if ( ! empty( $_REQUEST['post_id'] ) && ! current_user_can( 'edit_post', $_REQUEST['post_id'] ) ) {
4545
wp_die(
46-
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
46+
'<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
4747
'<p>' . __( 'Sorry, you are not allowed to edit this item.' ) . '</p>',
4848
403
4949
);

src/wp-admin/nav-menus.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
// Permissions Check
2323
if ( ! current_user_can( 'edit_theme_options' ) ) {
2424
wp_die(
25-
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
25+
'<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
2626
'<p>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>',
2727
403
2828
);

0 commit comments

Comments
 (0)