0

I have installed WP Cli successfully on my mac. I want to run PHP code from a file by wp shell command which is available in WP Cli

Work: when interactive mode like

  • First, run wp shell
  • then get_bloginfo( 'version' ) it's printing what expected.

Doesn't Work when trying to code from a file. After executing its print nothing!

Here test.php contains get_bloginfo( 'version' ) code.

Try 1: more "/Users/jhon/test.php" | wp shell --path="/Users/jhon/wp-project"

Try 2: more "/Users/jhon/test.php" | php wp shell --path="/Users/jhon/wp-project"

Harun
  • 13
  • 4

0 Answers0