{"repo":"wp-cli/shell-command","free":true,"listed":false,"github":"https://github.com/wp-cli/shell-command","clone":"git clone https://github.com/wp-cli/shell-command.git","description":"Opens an interactive PHP console for running and testing PHP code.","language":"PHP","stars":24,"topics":["wp-cli","wp-cli-package","wordpress","cli","shell","debugger","psysh","hacktoberfest"],"license":"MIT","category":"cli-tools","readme_excerpt":"wp-cli/shell-command ==================== Opens an interactive PHP console for running and testing PHP code. Quick links: Using Installing Contributing Support Using wp shell [--basic] [--watch= ] [--hook= ] wp shell allows you to evaluate PHP statements and expressions interactively, from within a WordPress environment. Type a bit of code, hit enter, and see the code execute right before you. Because WordPress is loaded, you have access to all the functions, classes and globals that you can use within a WordPress plugin, for example. The restart command reloads the shell by spawning a new PHP process, allowing modified code to be fully reloaded. Note that this requires the pcntl exec() function. If not available, the shell restarts in-process, which resets variables but doesn't reload PHP files. OPTIONS [--basic] Force the use of WP-CLI's built-in PHP REPL, even if the Boris or PsySH PHP REPLs are available. [--watch= ] Watch a file or directory for changes and automatically restart the shell. Only works with the built-in REPL (--basic). [--hook= ] Ensure that a specific WordPress action hook has fired before starting the shell. This validates that the preconditions associated with that hook are met. Only hooks that have already been triggered can be used (e.g., init, plugins loaded, wp loaded). --- default: '' --- EXAMPLES # Call get bloginfo() to get the name of the site. $ wp shell wp get bloginfo( 'name' ); = string(6) \"WP-CLI\" # Restart the shell to reload code changes.","default_branch":null,"files":null,"tree":[],"storefront":"/r/wp-cli","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/wp-cli/shell-command/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}