Run PHP code in the WordPress context
test php in wordpress context | call wordpress function from shell | which php version does wordpress use | wp-cli | php | debuggingwp eval 'echo PHP_VERSION . " / WP " . get_bloginfo("version") . PHP_EOL;' --path=/var/www/vhosts/example.com/httpdocswp eval loads WordPress including plugins and runs the given PHP code. The example shows the PHP and WordPress versions as seen by the command line. Useful for testing functions, options or plugin code without creating a file.
Note: The code runs with full access to the installation. For multiple lines, there is the interactive console wp shell.
Also searched as
- test php in wordpress context
- call wordpress function from shell
- which php version does wordpress use