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/edit.php

    r37890 r37914  
    1414
    1515if ( ! in_array( $typenow, get_post_types( array( 'show_ui' => true ) ) ) ) {
    16     wp_die( __( 'You are not allowed to edit posts in this post type.' ) );
     16    wp_die( __( 'Sorry, you are not allowed to edit posts in this post type.' ) );
    1717}
    1818
     
    3838    wp_die(
    3939        '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
    40         '<p>' . __( 'You are not allowed to edit posts in this post type.' ) . '</p>',
     40        '<p>' . __( 'Sorry, you are not allowed to edit posts in this post type.' ) . '</p>',
    4141        403
    4242    );
     
    104104            foreach ( (array) $post_ids as $post_id ) {
    105105                if ( !current_user_can( 'delete_post', $post_id) )
    106                     wp_die( __('You are not allowed to move this item to the Trash.') );
     106                    wp_die( __('Sorry, you are not allowed to move this item to the Trash.') );
    107107
    108108                if ( wp_check_post_lock( $post_id ) ) {
     
    123123            foreach ( (array) $post_ids as $post_id ) {
    124124                if ( !current_user_can( 'delete_post', $post_id) )
    125                     wp_die( __('You are not allowed to restore this item from the Trash.') );
     125                    wp_die( __('Sorry, you are not allowed to restore this item from the Trash.') );
    126126
    127127                if ( !wp_untrash_post($post_id) )
     
    138138
    139139                if ( !current_user_can( 'delete_post', $post_id ) )
    140                     wp_die( __('You are not allowed to delete this item.') );
     140                    wp_die( __('Sorry, you are not allowed to delete this item.') );
    141141
    142142                if ( $post_del->post_type == 'attachment' ) {
Note: See TracChangeset for help on using the changeset viewer.