Changeset 4082 for sites/trunk/wordpress.org/public_html/wp-content/plugins/rosetta/inc/user/class-sync.php
- Timestamp:
- 09/16/2016 07:23:11 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/rosetta/inc/user/class-sync.php
r4030 r4082 48 48 * Sets the array of roles to sync. 49 49 * 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. 51 52 */ 52 53 public function set_roles_to_sync( array $roles_to_sync ) { … … 79 80 remove_action( 'set_user_role', [ $this, 'add_user_to_site' ], 10 ); 80 81 81 if ( ! in_array( $role, $this->roles_to_sync, true ) ) {82 if ( ! in_array( $role, array_keys( $this->roles_to_sync ), true ) ) { 82 83 return; 83 84 } … … 87 88 } 88 89 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 ] ); 90 91 } 91 92 }
Note: See TracChangeset
for help on using the changeset viewer.