Skip to content

Instantly share code, notes, and snippets.

@verygoodplugins
Created July 22, 2022 08:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save verygoodplugins/ffaf723ef190b7dcb2c17e0d8db0ac22 to your computer and use it in GitHub Desktop.
Save verygoodplugins/ffaf723ef190b7dcb2c17e0d8db0ac22 to your computer and use it in GitHub Desktop.
When a user registers in WordPress, applies a tag in the CRM with their username
<?php
function tag_based_on_username( $user_id ) {
$user = get_user_by( 'id', $user_id );
wp_fusion()->user->apply_tags( array( $user->user_login ), $user_id );
}
add_action( 'wpf_user_created', 'tag_based_on_username' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment