WC_CLI_COM_Command::ask
We are asking a question and returning an answer as a string.
Method of the class: WC_CLI_COM_Command{}
No Hooks.
Returns
String.
Usage
$result = WC_CLI_COM_Command::ask( $question );
- $question(string) (required)
- The question being prompt.
WC_CLI_COM_Command::ask() WC CLI COM Command::ask code WC 10.4.3
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
}