WP_CLI
RequestsLibrary::is_cli
Check if the current source for the Requests library is WP-CLI.
Method of the class: RequestsLibrary{}
No Hooks.
Returns
true|false. Whether the current source is WP-CLI.
Usage
$result = RequestsLibrary::is_cli();
RequestsLibrary::is_cli() RequestsLibrary::is cli code WP-CLI 2.13.0-alpha
public static function is_cli() {
return self::get_source() === self::SOURCE_WP_CLI;
}