WordPress at Your Fingertips
function is not described

WP_Background_Process::generate_key() protected WC 1.0

Generate key

Generates a unique key based on microtime. Queue items are given a unique key so that they can be merged upon save.

{} It's a method of the class: WP_Background_Process{}

No Hooks.

Return

String.

Usage

// protected - for code of main (parent) or child class
$result = $this->generate_key( $length );
$length(int)
Length.
Default: 64

Code of WP_Background_Process::generate_key() WC 5.8.0

protected function generate_key( $length = 64 ) {
	$unique  = md5( microtime() . rand() );
	$prepend = $this->identifier . '_batch_';

	return substr( $prepend . $unique, 0, $length );
}