WP_Background_Process::generate_key
Generate key
Generates a unique key based on microtime. Queue items are given a unique key so that they can be merged upon save.
Метод класса: WP_Background_Process{}
Хуков нет.
Возвращает
Строку.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->generate_key( $length );
- $length(int)
- Length.
По умолчанию:64
Код WP_Background_Process::generate_key() WP Background Process::generate key WC 10.8.1
protected function generate_key( $length = 64 ) {
$unique = md5( microtime() . rand() );
$prepend = $this->identifier . '_batch_';
return substr( $prepend . $unique, 0, $length );
}