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[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers