Code Duplication    Length = 10-21 lines in 2 locations

sync/class.jetpack-sync-module-users.php 2 locations

@@ 209-229 (lines=21) @@
206
		do_action( 'jetpack_user_edited', $user_id );
207
	}
208
209
	function user_register_handler( $user_id, $old_user_data = null ) {
210
		// ensure we only sync users who are members of the current blog
211
		if ( ! is_user_member_of_blog( $user_id, get_current_blog_id() ) ) {
212
			return;
213
		}
214
		$raw_user = get_user_by( 'id', $user_id );
215
		$user = $this->sanitize_user( $raw_user );
216
217
		if ( 'user_register' === current_filter() ) {
218
			/**
219
			 * Fires when a new user is registered on a site
220
			 *
221
			 * @since 4.9.0
222
			 *
223
			 * @param object The WP_User object
224
			 */
225
			do_action( 'jetpack_sync_register_user', $user );
226
227
			return;
228
		}
229
	}
230
231
	function add_user_to_blog_handler( $user_id, $old_user_data = null ) {
232
		// ensure we only sync users who are members of the current blog
@@ 231-240 (lines=10) @@
228
		}
229
	}
230
231
	function add_user_to_blog_handler( $user_id, $old_user_data = null ) {
232
		// ensure we only sync users who are members of the current blog
233
		if ( ! is_user_member_of_blog( $user_id, get_current_blog_id() ) ) {
234
			return;
235
		}
236
		$raw_user = get_user_by( 'id', $user_id );
237
		$user = $this->sanitize_user( $raw_user );
238
239
		do_action( 'jetpack_sync_add_user', $user );
240
	}
241
242
	function save_user_handler( $user_id, $old_user_data = null ) {
243
		// ensure we only sync users who are members of the current blog