Skip to content

Commit

Permalink
Update user.php
Browse files Browse the repository at this point in the history
  • Loading branch information
takayukister committed Jun 21, 2022
1 parent 7238961 commit 685401e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions includes/user.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
<?php
/**
** Module for WordPress user.
**/
* Module for WordPress users handling
*/


add_action( 'profile_update', 'flamingo_user_profile_update', 10, 1 );
add_action( 'user_register', 'flamingo_user_profile_update', 10, 1 );

/**
* Creates a Flamingo_Contact record for the given user.
*/
function flamingo_user_profile_update( $user_id ) {
$user = new WP_User( $user_id );

Expand All @@ -27,12 +31,15 @@ function flamingo_user_profile_update( $user_id ) {
}
}

/* Collect contact info from existing users when activating plugin */

add_action( 'activate_' . FLAMINGO_PLUGIN_BASENAME,
'flamingo_collect_contacts_from_users',
10, 0
);

/**
* Creates Flamingo_Contact records for existing users.
*/
function flamingo_collect_contacts_from_users() {
$users = get_users( array(
'number' => 20,
Expand Down

0 comments on commit 685401e

Please sign in to comment.