WordPress.org

Making WordPress.org

Changeset 4030


Ignore:
Timestamp:
09/11/2016 03:24:36 PM (4 years ago)
Author:
ocean90
Message:

Rosetta: Add an editor to the team site when an editor is added to/promoted on the main site.

See #1983.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/rosetta/inc
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/rosetta/inc/site/class-locale-main.php

    r4028 r4030  
    22namespace WordPressdotorg\Rosetta\Site;
    33
     4use WordPressdotorg\Rosetta\User;
    45use WP_Site;
    56
     
    3940     */
    4041    public function register_events() {
    41         // TODO: Implement register_events() method.
     42        if ( is_admin() ) {
     43            $user_sync = new User\Sync();
     44            $user_sync->set_destination_site( get_site_by_path( get_site()->domain, Locale_Team::$path ) );
     45            $user_sync->set_roles_to_sync( [ 'editor' ] );
     46            $user_sync->setup();
     47        }
    4248    }
    4349}
Note: See TracChangeset for help on using the changeset viewer.