Make WordPress Core


Ignore:
Timestamp:
02/05/2018 02:29:53 AM (8 years ago)
Author:
peterwilsoncc
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-tags.php

    r42343 r42648  
    2626if ( ! 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
     
    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
     
    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
     
    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
     
    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
Note: See TracChangeset for help on using the changeset viewer.