From ef53c7fb62df58463f9089de188d545e1fd39c39 Mon Sep 17 00:00:00 2001 From: G3ronim0 Date: Thu, 16 Jun 2016 10:44:01 +0200 Subject: [PATCH] Delete transients and options when change license key --- inc/admin/options.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/inc/admin/options.php b/inc/admin/options.php index 4ed8edc..21df21f 100755 --- a/inc/admin/options.php +++ b/inc/admin/options.php @@ -22,6 +22,14 @@ function wptxu_save_extra_profile_fields( $user_id ) { } else { + $old = get_option( 'wptxu_sl_key' ); + + if ( $old && $old != $new ) { + delete_option( 'wptxu_license_status' ); + delete_transient( '_wptxu_license_data' ); + delete_transient( '_wptxu_license_error' ); + } + update_usermeta( absint( $user_id ), 'wptxu_transifex_auth', base64_encode( $_POST['wptxu-tx-username'] . ':' . $_POST['wptxu-tx-password'] ) ); update_usermeta( absint( $user_id ), 'wptxu_transifex_user', $_POST['wptxu-tx-username'] ); update_option( 'wptxu_sl_key', $_POST['wptxu-sl-key'] );