WC_CLI_COM_Command::ask()protected staticWC 1.0

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

Method of the class: WC_CLI_COM_Command{}

No Hooks.

Return

String.

Usage

$result = WC_CLI_COM_Command::ask( $question );
$question(string) (required)
The question being prompt.

WC_CLI_COM_Command::ask() code WC 8.6.1

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
}