WP_CLI

RequestsLibrary::is_clipublic staticWP-CLI 1.0

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() code WP-CLI 2.13.0-alpha

public static function is_cli() {
	return self::get_source() === self::SOURCE_WP_CLI;
}