@@ 423-442 (lines=20) @@ | ||
420 | * |
|
421 | * @param int $user_id ID of the deleted user. |
|
422 | */ |
|
423 | public function user_register_handler( $user_id ) { |
|
424 | // Ensure we only sync users who are members of the current blog. |
|
425 | if ( ! is_user_member_of_blog( $user_id, get_current_blog_id() ) ) { |
|
426 | return; |
|
427 | } |
|
428 | ||
429 | if ( Jetpack_Constants::is_true( 'JETPACK_INVITE_ACCEPTED' ) ) { |
|
430 | $this->add_flags( $user_id, array( 'invitation_accepted' => true ) ); |
|
431 | } |
|
432 | /** |
|
433 | * Fires when a new user is registered on a site |
|
434 | * |
|
435 | * @since 4.9.0 |
|
436 | * |
|
437 | * @param object The WP_User object |
|
438 | */ |
|
439 | do_action( 'jetpack_sync_register_user', $user_id, $this->get_flags( $user_id ) ); |
|
440 | $this->clear_flags( $user_id ); |
|
441 | ||
442 | } |
|
443 | ||
444 | /** |
|
445 | * Handler for user addition to the current blog. |
|
@@ 451-470 (lines=20) @@ | ||
448 | * |
|
449 | * @param int $user_id ID of the user. |
|
450 | */ |
|
451 | public function add_user_to_blog_handler( $user_id ) { |
|
452 | // Ensure we only sync users who are members of the current blog. |
|
453 | if ( ! is_user_member_of_blog( $user_id, get_current_blog_id() ) ) { |
|
454 | return; |
|
455 | } |
|
456 | ||
457 | if ( Jetpack_Constants::is_true( 'JETPACK_INVITE_ACCEPTED' ) ) { |
|
458 | $this->add_flags( $user_id, array( 'invitation_accepted' => true ) ); |
|
459 | } |
|
460 | ||
461 | /** |
|
462 | * Fires when a user is added on a site |
|
463 | * |
|
464 | * @since 4.9.0 |
|
465 | * |
|
466 | * @param object The WP_User object |
|
467 | */ |
|
468 | do_action( 'jetpack_sync_add_user', $user_id, $this->get_flags( $user_id ) ); |
|
469 | $this->clear_flags( $user_id ); |
|
470 | } |
|
471 | ||
472 | /** |
|
473 | * Handler for user save. |