fauzanjeg

Give user premium access by manual

Jan 14th, 2021 (edited)
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.76 KB | None | 0 0
  1. /* Give user premium access by manual */
  2. function give_user_premium_access_by_manual() {
  3.     if ( is_admin() ) { /* If admin */
  4.         $email = array( 'your_email@gmail.com', 'exampleemail@yahoo.com' ); /* List Users by Email */
  5.         foreach ($email as &$value) {
  6.             $id_user = get_user_by('email', $value); /* Gey Data Users */
  7.  
  8.             // update_user_option( $id_user->ID, 'jpw_subscribe_status', 'ACTIVE' ); /* Run this function to Enable Premium Users */
  9.             // update_user_option( $id_user->ID, 'jpw_expired_date', '2022-08-11 09:09:09' ); /* Run this function to Enable Premium Users */
  10.  
  11.             update_user_option( $id_user->ID, 'jpw_subscribe_status', false ); /* Run this function to Disable Premium Users */
  12.    
  13.         }
  14.     }
  15. }
  16.  
  17. add_action( 'init', 'give_user_premium_access_by_manual' );
Add Comment
Please, Sign In to add comment