Making WordPress.org


Ignore:
Timestamp:
09/16/2016 07:23:11 PM (8 years ago)
Author:
ocean90
Message:

Rosetta: Add locale managers as editors to the team site.

See #1983.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/rosetta/inc/user/class-sync.php

    r4030 r4082  
    4848     * Sets the array of roles to sync.
    4949     *
    50      * @param array $roles_to_sync An array of roles to sync.
     50     * @param array $roles_to_sync An array of roles to sync. The key of an item
     51     *                             is the source role, the value the destination role.
    5152     */
    5253    public function set_roles_to_sync( array $roles_to_sync ) {
     
    7980        remove_action( 'set_user_role',    [ $this, 'add_user_to_site' ], 10 );
    8081
    81         if ( ! in_array( $role, $this->roles_to_sync, true ) ) {
     82        if ( ! in_array( $role, array_keys( $this->roles_to_sync ), true ) ) {
    8283            return;
    8384        }
     
    8788        }
    8889
    89         add_user_to_blog( $this->destination_site->id, $user_id, $role );
     90        add_user_to_blog( $this->destination_site->id, $user_id, $this->roles_to_sync[ $role ] );
    9091    }
    9192}
Note: See TracChangeset for help on using the changeset viewer.