• Resolved miaria00

    (@miaria00)


    Hi there!

    I’m trying to figure out where in the code I can tweak the expiry time when reactivating an account and change it from one day to a month. I’m guessing it’s in the class-wp-temporary-login-without-password.php file but I can’t seem to pinpoint where the variable is stored so I can change the value. Any help would be greatly appreciated, thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • @miaria00,

    Thanks for writing to us.

    We have got few request regarding changing temporary login for more than one day on reactivation. We have already put it into our roadmap and will be incorporated in one of the future release of this plugin.

    Meanwhile, modify the code as described below.

    To change the reactivation from one day to one month, you need to make changes into /temporay-login-without-password/includes/class-wp-temporary-login-without-password-common.php file.

    In the class-wp-temporary-login-without-password-common.php file, you will find following code.

    if ( $action == 'disable' ) {
        $manage_login = update_user_meta( $user_id, '_wtlwp_expire', self::get_current_gmt_timestamp() );
     } elseif ( $action == 'enable' ) {
        $manage_login = update_user_meta( $user_id, '_wtlwp_expire', self::get_user_expire_time() );
     }
    

    In the above code replace

    $manage_login = update_user_meta( $user_id, '_wtlwp_expire', self::get_user_expire_time() );

    with

    $manage_login = update_user_meta( $user_id, '_wtlwp_expire', self::get_user_expire_time( 'month' ) );

    It will reactivate temporary login for one month.

    To change the label from ‘Reactivate for one day‘ to ‘Reactivate for one month‘, make following changes into /temporay-login-without-password/includes/class-wp-temporary-login-without-password-layout.php.

    You will find following code

    $action_row .= '<span class="enable"><a title="' . __( 'Reactivate for one day', 'temporary-login-without-password' ) . '" href="' . $enable_login_url . '"><span class="dashicons dashicons-lock"></a></span></span>';

    replace with

    $action_row .= '<span class="enable"><a title="' . __( 'Reactivate for one month', 'temporary-login-without-password' ) . '" href="' . $enable_login_url . '"><span class="dashicons dashicons-lock"></a></span></span>';

    Hope that helps.

    BTW, if you like this plugin, please consider giving us 5 star ratings here.

    • This reply was modified 6 years, 10 months ago by Malay Ladu.
    • This reply was modified 6 years, 10 months ago by Malay Ladu.

    Hi There,

    Just checking in. Were you able to change the reactivation day from a day to month?

    @miaria00,

    Just want to update you that we have released a new version of Temporary Login Without Password plugin (1.5.3). So, now you can change the role and expiry of a temporary logins.

    You may want to try this feature.

    Hope that helps.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Changing the expiry time when reactivating an account’ is closed to new replies.