Make WordPress Core


Ignore:
Timestamp:
02/05/2018 02:29:53 AM (6 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/user-new.php

    r42343 r42648  
    1313    if ( ! current_user_can( 'create_users' ) && ! current_user_can( 'promote_users' ) ) {
    1414        wp_die(
    15             '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
     15            '<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
    1616            '<p>' . __( 'Sorry, you are not allowed to add users to this network.' ) . '</p>',
    1717            403
     
    2020} elseif ( ! current_user_can( 'create_users' ) ) {
    2121    wp_die(
    22         '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
     22        '<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
    2323        '<p>' . __( 'Sorry, you are not allowed to create users.' ) . '</p>',
    2424        403
     
    5353    if ( ! current_user_can( 'promote_user', $user_details->ID ) ) {
    5454        wp_die(
    55             '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
     55            '<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
    5656            '<p>' . __( 'Sorry, you are not allowed to add users to this network.' ) . '</p>',
    5757            403
     
    137137    if ( ! current_user_can( 'create_users' ) ) {
    138138        wp_die(
    139             '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
     139            '<h1>' . __( 'You don&#8217;t have permission to do this.' ) . '</h1>' .
    140140            '<p>' . __( 'Sorry, you are not allowed to create users.' ) . '</p>',
    141141            403
Note: See TracChangeset for help on using the changeset viewer.