Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'wp_login', function( $user_login, $user ) {
- if ( ! did_action( 'wpf_user_created' ) ) { // only if the user wasn't just registered and auto-logged in.
- wp_fusion()->user->user_register( $user->ID );
- } else {
- $data = array(
- 'last_active' => 'X';
- );
- wp_fusion()->user->push_user_meta( $user_id, $data );
- }
- }, 10, 2 );
- add_filter( 'wpf_user_register', function( $user_meta, $user_id ) {
- $extra_data = array(
- 'last_active' => 'X',
- 'user_id' => $user_id,
- // lastname, firstname, and email are already synced by default, you don't need it;
- );
- $user_meta = array_merge( $user_meta, $extra_data );
- return $user_meta;
- }, 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement