Advertisement
GochiSiyan

change subscription status

May 6th, 2021 (edited)
677
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. add_action('wp_head',function (){
  2. $users = [];
  3. array_push ( $users, get_user_by('login','the_user_name') );//change the user name to the user who you wished to modify the paywall status
  4. array_push ( $users, get_user_by('login','username2') );//change the user name to the user who you wished to modify the paywall status
  5.  
  6. foreach ($users as $user) {
  7. //update subscription
  8. update_user_option( $user->ID, 'jpw_subscribe_status', 'ACTIVE' );
  9. update_user_option( $user->ID, 'jpw_expired_date', date( 'Y-m-d H:i:s', strtotime( '+1 week' ) ) );//subscription time
  10. update_user_option( $user->ID, 'jpw_stripe_subs_id', 'demo_user_id_subscription' );
  11. update_user_option( $user->ID, 'jpw_subs_type', 'stripe' );
  12.  
  13. //update unlock
  14. update_user_option( $user->ID, 'jpw_unlock_remaining', 10);
  15. }
  16. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement