Advertisement
verygoodplugins

Untitled

Aug 31st, 2020
2,322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. function my_add_user_role( $user_id, $role ) {
  2.  
  3.     if ( ! function_exists( 'wp_fusion' ) ) {
  4.         return;
  5.     }
  6.  
  7.     if ( 'enabled' == $role ) {
  8.         wp_fusion()->user->user_register( $user_id );
  9.     }
  10.  
  11. }
  12.  
  13. add_action( 'add_user_role', 'my_add_user_role', 10, 2 );
  14.  
  15. function my_wpf_user_register( $post_data, $user_id ) {
  16.  
  17.     $post_data['user_email'] = get_user_meta( $user_id, 'company_email', true );
  18.  
  19.     return $post_data;
  20.  
  21. }
  22.  
  23. add_filter( 'wpf_user_register', 'my_wpf_user_register', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement