Making WordPress.org

Changeset 1421


Ignore:
Timestamp:
03/19/2015 03:31:19 PM (9 years ago)
Author:
ocean90
Message:

Rosetta: Access $user->roles directly to check if a user is already a translation editor.

$user->has_cap() returns always true for super admins.

see #741.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/global.wordpress.org/public_html/wp-content/mu-plugins/roles/rosetta-roles.php

    r1420 r1421  
    253253                    }
    254254
    255                     if ( $user_details->has_cap( $this->translation_editor_role ) ) {
     255                    if ( in_array( $this->translation_editor_role, $user_details->roles ) ) {
    256256                        wp_redirect( add_query_arg( array( 'error' => 'user-exists' ), $redirect ) );
    257257                        exit;
Note: See TracChangeset for help on using the changeset viewer.