arie_cristianD

update data jpw subscription

Jul 14th, 2026
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.80 KB | None | 0 0
  1. /**
  2.  * Run once from wp-admin with:
  3.  * /wp-admin/?jpw-subs-update={ID}
  4.  */
  5. function jnews_update_subs_data() {
  6.     if ( ! is_admin() || ! current_user_can( 'manage_options' ) ) {
  7.         return;
  8.     }
  9.  
  10.     if ( ! isset( $_GET['jpw-subs-update'] ) || empty( $_GET['jpw-subs-update'] ) ) {
  11.         return;
  12.     }
  13.     $user_id = intval( $_GET['jpw-subs-update'] );
  14.  
  15.     $expired = '2026-12-30 12:00:00'; // use the 'Y-m-d H:i:s' (Year-Month-Day Hour:Minute:Second) format for the expired date
  16.     update_user_option( $user_id, 'jpw_subs_type', 'stripe' );
  17.     update_user_option( $user_id, 'jpw_stripe_subs_id', 'test-ID' ); // Stripe subscription ID
  18.     update_user_option( $user_id, 'jpw_subscribe_status', 'ACTIVE' );
  19.     update_user_option( $user_id, 'jpw_expired_date', $expired );
  20. }
  21. add_action( 'admin_init', 'jnews_update_subs_data' );
Advertisement
Add Comment
Please, Sign In to add comment