WC_CLI_COM_Command::ask()protected staticWC 1.0

We are asking a question and returning an answer as a string.

Метод класса: WC_CLI_COM_Command{}

Хуков нет.

Возвращает

Строку.

Использование

$result = WC_CLI_COM_Command::ask( $question );
$question(строка) (обязательный)
The question being prompt.

Код WC_CLI_COM_Command::ask() WC 8.7.0

protected static function ask( $question ) {
	// phpcs:disable WordPress.WP.AlternativeFunctions.file_system_read_fwrite
	// Adding space to question and showing it.
	fwrite( STDOUT, $question . ' ' );

	return trim( fgets( STDIN ) );
	// phpcs:enable
}