Make WordPress Core


Ignore:
Timestamp:
06/29/2016 03:15:40 PM (9 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/update.php

    r34598 r37914  
    2222    if ( 'update-selected' == $action ) {
    2323        if ( ! current_user_can( 'update_plugins' ) )
    24             wp_die( __( 'You do not have sufficient permissions to update plugins for this site.' ) );
     24            wp_die( __( 'Sorry, you are not allowed to update plugins for this site.' ) );
    2525
    2626        check_admin_referer( 'bulk-update-plugins' );
     
    4848    } elseif ( 'upgrade-plugin' == $action ) {
    4949        if ( ! current_user_can('update_plugins') )
    50             wp_die(__('You do not have sufficient permissions to update plugins for this site.'));
     50            wp_die(__('Sorry, you are not allowed to update plugins for this site.'));
    5151
    5252        check_admin_referer('upgrade-plugin_' . $plugin);
     
    6969    } elseif ('activate-plugin' == $action ) {
    7070        if ( ! current_user_can('update_plugins') )
    71             wp_die(__('You do not have sufficient permissions to update plugins for this site.'));
     71            wp_die(__('Sorry, you are not allowed to update plugins for this site.'));
    7272
    7373        check_admin_referer('activate-plugin_' . $plugin);
     
    9494
    9595        if ( ! current_user_can('install_plugins') )
    96             wp_die( __( 'You do not have sufficient permissions to install plugins on this site.' ) );
     96            wp_die( __( 'Sorry, you are not allowed to install plugins on this site.' ) );
    9797
    9898        include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' ); //for plugins_api..
     
    142142
    143143        if ( ! current_user_can( 'upload_plugins' ) ) {
    144             wp_die( __( 'You do not have sufficient permissions to install plugins on this site.' ) );
     144            wp_die( __( 'Sorry, you are not allowed to install plugins on this site.' ) );
    145145        }
    146146
     
    170170
    171171        if ( ! current_user_can('update_themes') )
    172             wp_die(__('You do not have sufficient permissions to update themes for this site.'));
     172            wp_die(__('Sorry, you are not allowed to update themes for this site.'));
    173173
    174174        check_admin_referer('upgrade-theme_' . $theme);
     
    191191    } elseif ( 'update-selected-themes' == $action ) {
    192192        if ( ! current_user_can( 'update_themes' ) )
    193             wp_die( __( 'You do not have sufficient permissions to update themes for this site.' ) );
     193            wp_die( __( 'Sorry, you are not allowed to update themes for this site.' ) );
    194194
    195195        check_admin_referer( 'bulk-update-themes' );
     
    217217
    218218        if ( ! current_user_can('install_themes') )
    219             wp_die( __( 'You do not have sufficient permissions to install themes on this site.' ) );
     219            wp_die( __( 'Sorry, you are not allowed to install themes on this site.' ) );
    220220
    221221        include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); //for themes_api..
     
    247247
    248248        if ( ! current_user_can( 'upload_themes' ) ) {
    249             wp_die( __( 'You do not have sufficient permissions to install themes on this site.' ) );
     249            wp_die( __( 'Sorry, you are not allowed to install themes on this site.' ) );
    250250        }
    251251
Note: See TracChangeset for help on using the changeset viewer.