Skip to content

Instantly share code, notes, and snippets.

@lgedeon
Created April 29, 2019 15:45
Show Gist options
  • Save lgedeon/815d44ea495bc942a39ea5f426f36b67 to your computer and use it in GitHub Desktop.
Save lgedeon/815d44ea495bc942a39ea5f426f36b67 to your computer and use it in GitHub Desktop.
from class i-i3.php
<?php
/**
* Determines whether WP CLI is running.
*
* @return bool True if CLI, false otherwise.
*/
public function is_cli() {
return ( defined( 'WP_CLI' ) && true === WP_CLI );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment