Advertisement
verygoodplugins

Untitled

Feb 12th, 2021
731
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. function my_stuff() {
  2.  
  3.     if ( isset( $_GET['deactivate'] ) ) {
  4.  
  5.         $user_id = wpf_get_user_id( $_GET['contact_id'] );
  6.  
  7.         // Set user to default usergroup
  8.  
  9.         WPF()->member->set_usergroup( $user_id, get_option( 'wpforo_default_groupid' ) );
  10.  
  11.         // Remove from LD group #123
  12.  
  13.         ld_update_group_access( $user_id, $group_id = 123, $remove = true );
  14.  
  15.         // Remove from course #456
  16.  
  17.         ld_update_course_access( $user_id, $course_id = 456, $remove = true );
  18.  
  19.     }
  20.  
  21. }
  22.  
  23. add_action( 'init', 'my_stuff' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement