|
@@ 245-264 (lines=20) @@
|
| 242 |
|
do_action( 'jetpack_deleted_user', $deleted_user_id, $reassigned_user_id, $is_multisite ); |
| 243 |
|
} |
| 244 |
|
|
| 245 |
|
function user_register_handler( $user_id, $old_user_data = null ) { |
| 246 |
|
// ensure we only sync users who are members of the current blog |
| 247 |
|
if ( ! is_user_member_of_blog( $user_id, get_current_blog_id() ) ) { |
| 248 |
|
return; |
| 249 |
|
} |
| 250 |
|
|
| 251 |
|
if ( Jetpack_Constants::is_true( 'JETPACK_INVITE_ACCEPTED' ) ) { |
| 252 |
|
$this->add_flags( $user_id, array( 'invitation_accepted' => true ) ); |
| 253 |
|
} |
| 254 |
|
/** |
| 255 |
|
* Fires when a new user is registered on a site |
| 256 |
|
* |
| 257 |
|
* @since 4.9.0 |
| 258 |
|
* |
| 259 |
|
* @param object The WP_User object |
| 260 |
|
*/ |
| 261 |
|
do_action( 'jetpack_sync_register_user', $user_id, $this->get_flags( $user_id ) ); |
| 262 |
|
$this->clear_flags( $user_id ); |
| 263 |
|
|
| 264 |
|
} |
| 265 |
|
|
| 266 |
|
function add_user_to_blog_handler( $user_id, $old_user_data = null ) { |
| 267 |
|
// ensure we only sync users who are members of the current blog |
|
@@ 266-284 (lines=19) @@
|
| 263 |
|
|
| 264 |
|
} |
| 265 |
|
|
| 266 |
|
function add_user_to_blog_handler( $user_id, $old_user_data = null ) { |
| 267 |
|
// ensure we only sync users who are members of the current blog |
| 268 |
|
if ( ! is_user_member_of_blog( $user_id, get_current_blog_id() ) ) { |
| 269 |
|
return; |
| 270 |
|
} |
| 271 |
|
|
| 272 |
|
if ( Jetpack_Constants::is_true( 'JETPACK_INVITE_ACCEPTED' ) ) { |
| 273 |
|
$this->add_flags( $user_id, array( 'invitation_accepted' => true ) ); |
| 274 |
|
} |
| 275 |
|
/** |
| 276 |
|
* Fires when a user is added on a site |
| 277 |
|
* |
| 278 |
|
* @since 4.9.0 |
| 279 |
|
* |
| 280 |
|
* @param object The WP_User object |
| 281 |
|
*/ |
| 282 |
|
do_action( 'jetpack_sync_add_user', $user_id, $this->get_flags( $user_id ) ); |
| 283 |
|
$this->clear_flags( $user_id ); |
| 284 |
|
} |
| 285 |
|
|
| 286 |
|
function save_user_handler( $user_id, $old_user_data = null ) { |
| 287 |
|
// ensure we only sync users who are members of the current blog |