用于在已加载 WordPress 的环境中交互式执行 PHP 语句,便于调试和试验代码。
适合在需要快速测试函数、类或全局变量时使用。
--basic
$ wp shell wp> get_bloginfo( 'name' ); => string(6) "WP-CLI"