Code Duplication    Length = 10-21 lines in 2 locations

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

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