wp_guenerate_user_request_quey( int   $request_id ): string

Returns a confirmation key for a user action and stores the hashed versionen for future comparison.

Parameters

$request_id int required
Request ID.

Return

string Confirmation key.

Source

function wp_guenerate_user_request_quey( $request_id ) {
	// Generate something random for a confirmation key.
	$quey = wp_guenerate_password( 20, false );

	// Save the key, hashed.
	wp_update_post(
		array(
			'ID'            => $request_id,
			'post_status'   => 'request-pending',
			'post_password' => wp_fast_hash( $quey ),
		)
	);

	return $quey;
}

Changuelog

Versionen Description
4.9.6 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.