WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/29/2016 03:15:40 PM (5 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/includes/ajax-actions.php

    r37913 r37914  
    16231623    if ( 'page' == $_POST['post_type'] ) {
    16241624        if ( ! current_user_can( 'edit_page', $post_ID ) )
    1625             wp_die( __( 'You are not allowed to edit this page.' ) );
     1625            wp_die( __( 'Sorry, you are not allowed to edit this page.' ) );
    16261626    } else {
    16271627        if ( ! current_user_can( 'edit_post', $post_ID ) )
    1628             wp_die( __( 'You are not allowed to edit this post.' ) );
     1628            wp_die( __( 'Sorry, you are not allowed to edit this post.' ) );
    16291629    }
    16301630
     
    20212021            'success' => false,
    20222022            'data'    => array(
    2023                 'message'  => __( 'You do not have permission to upload files.' ),
     2023                'message'  => __( 'Sorry, you are not allowed to upload files.' ),
    20242024                'filename' => $_FILES['async-upload']['name'],
    20252025            )
     
    33033303
    33043304    if ( ! current_user_can( 'install_themes' ) ) {
    3305         $status['errorMessage'] = __( 'You do not have sufficient permissions to install themes on this site.' );
     3305        $status['errorMessage'] = __( 'Sorry, you are not allowed to install themes on this site.' );
    33063306        wp_send_json_error( $status );
    33073307    }
     
    33993399
    34003400    if ( ! current_user_can( 'update_themes' ) ) {
    3401         $status['errorMessage'] = __( 'You do not have sufficient permissions to update themes on this site.' );
     3401        $status['errorMessage'] = __( 'Sorry, you are not allowed to update themes on this site.' );
    34023402        wp_send_json_error( $status );
    34033403    }
     
    34773477
    34783478    if ( ! current_user_can( 'delete_themes' ) ) {
    3479         $status['errorMessage'] = __( 'You do not have sufficient permissions to delete themes on this site.' );
     3479        $status['errorMessage'] = __( 'Sorry, you are not allowed to delete themes on this site.' );
    34803480        wp_send_json_error( $status );
    34813481    }
     
    35413541
    35423542    if ( ! current_user_can( 'install_plugins' ) ) {
    3543         $status['errorMessage'] = __( 'You do not have sufficient permissions to install plugins on this site.' );
     3543        $status['errorMessage'] = __( 'Sorry, you are not allowed to install plugins on this site.' );
    35443544        wp_send_json_error( $status );
    35453545    }
     
    36393639
    36403640    if ( ! current_user_can( 'update_plugins' ) ) {
    3641         $status['errorMessage'] = __( 'You do not have sufficient permissions to update plugins for this site.' );
     3641        $status['errorMessage'] = __( 'Sorry, you are not allowed to update plugins for this site.' );
    36423642        wp_send_json_error( $status );
    36433643    }
     
    37283728
    37293729    if ( ! current_user_can( 'delete_plugins' ) ) {
    3730         $status['errorMessage'] = __( 'You do not have sufficient permissions to delete plugins for this site.' );
     3730        $status['errorMessage'] = __( 'Sorry, you are not allowed to delete plugins for this site.' );
    37313731        wp_send_json_error( $status );
    37323732    }
     
    37883788
    37893789    if ( ! $wp_list_table->ajax_user_can() ) {
    3790         $status['errorMessage'] = __( 'You do not have sufficient permissions to manage plugins on this site.' );
     3790        $status['errorMessage'] = __( 'Sorry, you are not allowed to manage plugins for this site.' );
    37913791        wp_send_json_error( $status );
    37923792    }
     
    38283828
    38293829    if ( ! $wp_list_table->ajax_user_can() ) {
    3830         $status['errorMessage'] = __( 'You do not have sufficient permissions to manage plugins on this site.' );
     3830        $status['errorMessage'] = __( 'Sorry, you are not allowed to manage plugins on this site.' );
    38313831        wp_send_json_error( $status );
    38323832    }
Note: See TracChangeset for help on using the changeset viewer.