Make WordPress Core


Ignore:
Timestamp:
06/29/2016 03:15:40 PM (8 years ago)
Author:
ocean90
Message:

Text Changes: Unify permission error messages.

The new format looks like "Sorry, you are not allowed to <action>.". This provides a consistent experience for all error messages related to missing permissions. It also reduces the number of similar strings and allows translators to provide a consistent style in their language.

Props ramiy, Presskopp.
Fixes #34521.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/network/users.php

    r37680 r37914  
    1515
    1616if ( ! current_user_can( 'manage_network_users' ) )
    17     wp_die( __( 'You do not have permission to access this page.' ), 403 );
     17    wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
    1818
    1919if ( isset( $_GET['action'] ) ) {
     
    2424        case 'deleteuser':
    2525            if ( ! current_user_can( 'manage_network_users' ) )
    26                 wp_die( __( 'You do not have permission to access this page.' ), 403 );
     26                wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
    2727
    2828            check_admin_referer( 'deleteuser' );
     
    4545        case 'allusers':
    4646            if ( !current_user_can( 'manage_network_users' ) )
    47                 wp_die( __( 'You do not have permission to access this page.' ), 403 );
     47                wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
    4848
    4949            if ( ( isset( $_POST['action']) || isset($_POST['action2'] ) ) && isset( $_POST['allusers'] ) ) {
     
    5858                            case 'delete':
    5959                                if ( ! current_user_can( 'delete_users' ) )
    60                                     wp_die( __( 'You do not have permission to access this page.' ), 403 );
     60                                    wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
    6161                                $title = __( 'Users' );
    6262                                $parent_file = 'users.php';
     
    107107            check_admin_referer( 'ms-users-delete' );
    108108            if ( ! ( current_user_can( 'manage_network_users' ) && current_user_can( 'delete_users' ) ) )
    109                 wp_die( __( 'You do not have permission to access this page.' ), 403 );
     109                wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
    110110
    111111            if ( ! empty( $_POST['blog'] ) && is_array( $_POST['blog'] ) ) {
Note: See TracChangeset for help on using the changeset viewer.