File: //var/cache/hostinger-wp-cli-packages/hostinger-command.php
<?php
use Hostinger\WPCLI\Woocommerce\GetOrdersCommand;
use Hostinger\WPCLI\Woocommerce\GetWooOrdersCommand;
use Hostinger\WPCLI\Woocommerce\GetOrdersUpdatedCommand;
if ( ! class_exists( 'WP_CLI' ) ) {
return;
}
$wpcli_hostinger_autoloader = __DIR__ . '/vendor/autoload.php';
if ( file_exists( $wpcli_hostinger_autoloader ) ) {
require_once $wpcli_hostinger_autoloader;
}
if ( class_exists( GetOrdersCommand::class ) ) {
WP_CLI::add_command( 'hostinger woocommerce get-orders', GetOrdersCommand::class, [
'shortdesc' => 'Retrieve WooCommerce orders based on date range.',
'longdesc' => "Fetch all WooCommerce orders either from a specific date or for a set number of days.\n\n"
. "## EXAMPLES\n\n"
. " wp hostinger woocommerce get-orders --days=7\n"
. " Retrieves orders from the past 7 days.\n\n"
. " wp hostinger woocommerce get-orders --from-date=2025-01-01\n"
. " Retrieves orders from 2025-01-01 until yesterday.\n\n"
. " wp hostinger woocommerce get-orders --from-date=2025-01-01 --to-date=2025-01-31\n"
. " Retrieves orders for the exact date range.",
'when' => 'after_wp_load',
] );
}
if ( class_exists( GetWooOrdersCommand::class ) ) {
WP_CLI::add_command( 'hostinger woocommerce get-woo-orders', GetWooOrdersCommand::class, [
'shortdesc' => 'Retrieve WooCommerce orders based on date range.',
'longdesc' => "Fetch all WooCommerce orders either from a specific date or for a set number of days.\n\n"
. "## EXAMPLES\n\n"
. " wp hostinger woocommerce get-woo-orders --from-date=2025-01-01\n"
. " Retrieves all orders from 2025-01-01 until now.\n\n"
. " wp hostinger woocommerce get-woo-orders --days=7\n"
. " Retrieves all orders from the past 7 days.",
'when' => 'after_wp_load',
] );
}
if ( class_exists( GetOrdersUpdatedCommand::class ) ) {
WP_CLI::add_command( 'hostinger woocommerce get-woo-orders-latest', GetOrdersUpdatedCommand::class, [
'shortdesc' => 'Retrieve WooCommerce orders based on date range.',
'longdesc' => "Fetch all WooCommerce orders either from a specific date or for a set number of days.\n\n"
. "## EXAMPLES\n\n"
. " wp hostinger woocommerce get-woo-orders-latest --from-date=2025-01-01\n"
. " Retrieves all orders from 2025-01-01 until now.\n\n"
. " wp hostinger woocommerce get-woo-orders-latest --days=7\n"
. " Retrieves all orders from the past 7 days.",
'when' => 'after_wp_load',
] );
}