Automator_Input_Parser::generate_reset_token( $user_id )


Parameters Parameters

$user_id

(Required)


Top ↑

Return Return

(bool|string)


Source Source

File: src/core/lib/utilities/class-automator-input-parser.php

	public function generate_reset_token( $user_id ) {

		$user = get_user_by( 'ID', $user_id );
		if ( $user ) {
			$adt_rp_key = get_password_reset_key( $user );
			$user_login = $user->user_login;
			$url        = network_site_url( "wp-login.php?action=rp&key=$adt_rp_key&login=" . rawurlencode( $user_login ), 'login' );
			$text       = esc_attr__( 'Click here to reset your password.', 'uncanny-automator' );
			$rp_link    = sprintf( '<a href="%s">%s</a>', $url, $text );
		} else {
			$rp_link = '';
		}

		return $rp_link;

	}