Make WordPress Core


Ignore:
Timestamp:
03/09/2018 12:14:20 AM (9 years ago)
Author:
SergeyBiryukov
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, kristastevens for language; dmsnell for original patch; peterwilsoncc.
Merged [42648] and [42719] to the 4.9 branch.
Fixes #38332.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-admin/themes.php

    r41968 r42811  
    1212if ( ! current_user_can( 'switch_themes' ) && ! current_user_can( 'edit_theme_options' ) ) {
    1313        wp_die(
    14                 '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
     14                '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
    1515                '<p>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>',
    1616                403
    … …  
    2525                if ( ! $theme->exists() || ! $theme->is_allowed() ) {
    2626                        wp_die(
    27                                 '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
     27                                '<h1>' . __( 'Something went wrong.' ) . '</h1>' .
    2828                                '<p>' . __( 'The requested theme does not exist.' ) . '</p>',
    2929                                403
    … …  
    4040                if ( ! current_user_can( 'delete_themes' ) ) {
    4141                        wp_die(
    42                                 '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
     42                                '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
    4343                                '<p>' . __( 'Sorry, you are not allowed to delete this item.' ) . '</p>',
    4444                                403
    … …  
    4848                if ( ! $theme->exists() ) {
    4949                        wp_die(
    50                                 '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
     50                                '<h1>' . __( 'Something went wrong.' ) . '</h1>' .
    5151                                '<p>' . __( 'The requested theme does not exist.' ) . '</p>',
    5252                                403
Note: See TracChangeset for help on using the changeset viewer.