Detect if WP is running under WP-CLI

Posted by Prem Tiwari | Updated on

Within the php/wp-cli.php we find these lines. so you could check if WP_CLI or WP_CLI_VERSION are defined.

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@] Your question and answer will appear on and help other developers.

Related Questions & Answers