Advertisement
verygoodplugins

Untitled

Oct 11th, 2018
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.34 KB | None | 0 0
  1. function wpf_set_additional_roles( $user_id, $action ) {
  2.  
  3.     $user = new WP_User( $user_id );
  4.  
  5.     if( isset( $_GET['add_role'] ) ) {
  6.         $user->add_role( $_GET['add_role'] );
  7.     }
  8.  
  9.     if( isset( $_GET['remove_role'] ) ) {
  10.         $user->remove_role( $_GET['remove_role'] );
  11.     }
  12.  
  13. }
  14.  
  15. add_action( 'wpf_api_success', 'wpf_set_additional_roles', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement