Current Path : /storage/v11800/affypharma/public_html/wp-content/plugins/auxin-elements/admin/includes/classes/ |
Linux v11800 5.3.0-1023-aws #25~18.04.1-Ubuntu SMP Fri Jun 5 15:19:18 UTC 2020 aarch64
|
Current File : /storage/v11800/affypharma/public_html/wp-content/plugins/auxin-elements/admin/includes/classes/class-auxin-cli-commands.php |
<?php
/**
*
*
* @package Auxin
* @license LICENSE.txt
* @author averta
* @link http://phlox.pro/
* @copyright (c) 2010-2024 averta
*/
// no direct access allowed
if ( ! defined('ABSPATH') ) {
die();
}
/**
* WP Cli Auxin Commands
*/
class Auxin_CLI_Commands {
/**
* flush cache
*
* @synopsis [--network]
*/
public function flush_cache( $args, $assoc_args ) {
if ( ! class_exists( 'autoptimizeCache' ) ) {
WP_CLI::error( 'Autoptimize plugin need to be active.' );
return;
}
if ( ! isset( $assoc_args['network'] ) || ! is_multisite() ) {
autoptimizeCache::clearall();
} else {
$sites = get_sites();
foreach ( $sites as $site ) {
switch_to_blog( $site->blog_id );
autoptimizeCache::clearall();
restore_current_blog();
}
}
WP_CLI::success( 'Flushing cache proccess done.' );
}
}
WP_CLI::add_command( 'auxin', 'Auxin_CLI_Commands');