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

    r37714 r37914  
    1111
    1212if ( ! current_user_can('activate_plugins') )
    13     wp_die( __( 'You do not have sufficient permissions to manage plugins for this site.' ) );
     13    wp_die( __( 'Sorry, you are not allowed to manage plugins for this site.' ) );
    1414
    1515$wp_list_table = _get_list_table('WP_Plugins_List_Table');
     
    3131        case 'activate':
    3232            if ( ! current_user_can('activate_plugins') )
    33                 wp_die(__('You do not have sufficient permissions to activate plugins for this site.'));
     33                wp_die(__('Sorry, you are not allowed to activate plugins for this site.'));
    3434
    3535            if ( is_multisite() && ! is_network_admin() && is_network_only_plugin( $plugin ) ) {
     
    7070        case 'activate-selected':
    7171            if ( ! current_user_can('activate_plugins') )
    72                 wp_die(__('You do not have sufficient permissions to activate plugins for this site.'));
     72                wp_die(__('Sorry, you are not allowed to activate plugins for this site.'));
    7373
    7474            check_admin_referer('bulk-plugins');
     
    148148        case 'error_scrape':
    149149            if ( ! current_user_can('activate_plugins') )
    150                 wp_die(__('You do not have sufficient permissions to activate plugins for this site.'));
     150                wp_die(__('Sorry, you are not allowed to activate plugins for this site.'));
    151151
    152152            check_admin_referer('plugin-activation-error_' . $plugin);
     
    169169        case 'deactivate':
    170170            if ( ! current_user_can('activate_plugins') )
    171                 wp_die(__('You do not have sufficient permissions to deactivate plugins for this site.'));
     171                wp_die(__('Sorry, you are not allowed to deactivate plugins for this site.'));
    172172
    173173            check_admin_referer('deactivate-plugin_' . $plugin);
     
    194194        case 'deactivate-selected':
    195195            if ( ! current_user_can('activate_plugins') )
    196                 wp_die(__('You do not have sufficient permissions to deactivate plugins for this site.'));
     196                wp_die(__('Sorry, you are not allowed to deactivate plugins for this site.'));
    197197
    198198            check_admin_referer('bulk-plugins');
     
    229229        case 'delete-selected':
    230230            if ( ! current_user_can('delete_plugins') ) {
    231                 wp_die(__('You do not have sufficient permissions to delete plugins for this site.'));
     231                wp_die(__('Sorry, you are not allowed to delete plugins for this site.'));
    232232            }
    233233
Note: See TracChangeset for help on using the changeset viewer.