WC_CLI

Enables WooCommerce, via the the command line.

Defined (1)

The class is defined in the following location(s).

/includes/class-wc-cli.php  
  1. class WC_CLI { 
  2. /** 
  3. * Load required files and hooks to make the CLI work. 
  4. */ 
  5. public function __construct() { 
  6. $this->includes(); 
  7. $this->hooks(); 
  8.  
  9. /** 
  10. * Load command files. 
  11. */ 
  12. private function includes() { 
  13. require_once __DIR__ . '/cli/class-wc-cli-runner.php'; 
  14. require_once __DIR__ . '/cli/class-wc-cli-rest-command.php'; 
  15. require_once __DIR__ . '/cli/class-wc-cli-tool-command.php'; 
  16. require_once __DIR__ . '/cli/class-wc-cli-update-command.php'; 
  17.  
  18. /** 
  19. * Sets up and hooks WP CLI to our CLI code. 
  20. */ 
  21. private function hooks() { 
  22. WP_CLI::add_hook( 'after_wp_load', 'WC_CLI_Runner::after_wp_load' ); 
  23. WP_CLI::add_hook( 'after_wp_load', 'WC_CLI_Tool_Command::register_commands' ); 
  24. WP_CLI::add_hook( 'after_wp_load', 'WC_CLI_Update_Command::register_commands' );