Changeset 4082
- Timestamp:
- 09/16/2016 07:23:11 PM (8 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/rosetta/inc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/rosetta/inc/site/class-locale-main.php
r4081 r4082 56 56 $user_sync = new User\Sync(); 57 57 $user_sync->set_destination_site( $team_site ); 58 $user_sync->set_roles_to_sync( [ 'editor' ] ); 58 $user_sync->set_roles_to_sync( [ 59 'editor' => 'editor', 60 Role\Locale_Manager::get_name() => 'editor', 61 ] ); 59 62 $user_sync->setup(); 60 63 } -
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.