Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Run once from wp-admin with:
- * /wp-admin/?jpw-subs-update={ID}
- */
- function jnews_update_subs_data() {
- if ( ! is_admin() || ! current_user_can( 'manage_options' ) ) {
- return;
- }
- if ( ! isset( $_GET['jpw-subs-update'] ) || empty( $_GET['jpw-subs-update'] ) ) {
- return;
- }
- $user_id = intval( $_GET['jpw-subs-update'] );
- $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
- update_user_option( $user_id, 'jpw_subs_type', 'stripe' );
- update_user_option( $user_id, 'jpw_stripe_subs_id', 'test-ID' ); // Stripe subscription ID
- update_user_option( $user_id, 'jpw_subscribe_status', 'ACTIVE' );
- update_user_option( $user_id, 'jpw_expired_date', $expired );
- }
- add_action( 'admin_init', 'jnews_update_subs_data' );
Advertisement
Add Comment
Please, Sign In to add comment